From 2ecf5dfa71bf0c553c30ced6f68a81fa3be6a93f Mon Sep 17 00:00:00 2001
From: xiaoyang <xiaoyang@hnkhzn.com>
Date: 星期五, 08 十一月 2024 20:03:58 +0800
Subject: [PATCH] 11.08-1
---
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs | 1
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 122 ++++------------------------------------
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/Unbind/UnbindService.cs | 6 +
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/Dt_EquipmentProcess.cs | 36 +++++++++++
4 files changed, 51 insertions(+), 114 deletions(-)
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/Dt_EquipmentProcess.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/Dt_EquipmentProcess.cs
index 58c02df..15c9ae6 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/Dt_EquipmentProcess.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/Dt_EquipmentProcess.cs
@@ -64,7 +64,7 @@
/// <summary>
/// 琛ㄧず宸ヨ壓璺嚎涓婅澶囧弬鏁颁俊鎭殑妯″瀷銆�
/// </summary>
- public class EquipmentParameterInfo
+ public class EBParameterInfo
{
/// <summary>
/// 鍙傛暟缂栫爜銆�
@@ -127,4 +127,38 @@
[Required(ErrorMessage = "璁惧鍙傛暟淇℃伅鏄惁鍙敤鏄繀濉」銆�")]
public string EquipmentAvailabilityFlag { get; set; }
}
+
+
+ public class ResponseEqptRunDto : BasicResult
+ {
+ /// <summary>
+ /// 浜у搧鍚嶇О
+ /// </summary>
+ public string ProductDesc { get; set; }
+
+ /// <summary>
+ /// 棣栦欢鏁伴噺
+ /// </summary>
+ public string FirstArticleNum { get; set; }
+
+ /// <summary>
+ /// 璋冩満鏁伴噺
+ /// </summary>
+ public string DebugNum { get; set; }
+
+ /// <summary>
+ /// 鍙傛暟鐗堟湰淇℃伅
+ /// </summary>
+ public string ParamVersion { get; set; }
+
+ /// <summary>
+ /// 鏄惁闇�瑕佽鍙栧弬鏁�
+ /// </summary>
+ public bool ParamRefreshFlag { get; set; }
+
+ /// <summary>
+ /// 鍙傛暟淇℃伅
+ /// </summary>
+ public List<EBParameterInfo> ParameterInfo { get; set; }
+ }
}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs
index d880a04..b4b7cc5 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/AgingInOrOutInput/AgingInOrOutInputService.cs
@@ -59,7 +59,6 @@
content.OK(data: x);
LogFactory.GetLog("闈欑疆闄堝寲鍑哄簱锛堟暣鎵樼洏锛�").Info(true, $"\r\r--------------------------------------");
LogFactory.GetLog("闈欑疆闄堝寲鍑哄簱锛堟暣鎵樼洏锛�").Info(true, x);
- content.OK();
}
catch (Exception err)
{
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/Unbind/UnbindService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/Unbind/UnbindService.cs
index 18f563a..f4f8c6e 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/Unbind/UnbindService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/Unbind/UnbindService.cs
@@ -26,6 +26,8 @@
try
{
input.SessionId = Guid.NewGuid().ToString();
+ input.Software = "WMS";
+ input.EquipmentCode = "ECH001-B";
input.EmployeeNo = "T00001";
input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ");
var inputJson = input.ToDictionary();
@@ -53,8 +55,8 @@
try
{
input.SessionId = Guid.NewGuid().ToString();
- input.Software = "闄堝寲鏈�";
- input.EquipmentCode = "P1K10040";
+ input.Software = "WMS";
+ input.EquipmentCode = "ECH001-B";
input.EmployeeNo = "T00001";
input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ");
var inputJson = input.ToDictionary();
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index 5901b8a..cd77752 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -81,105 +81,6 @@
#region 鍑哄簱浠诲姟瀹屾垚
- /// <summary>
- /// 鍑哄簱浠诲姟瀹屾垚
- /// </summary>
- /// <param name="saveModel">浠诲姟鏁版嵁鍚堥泦</param>
- /// <returns>杩斿洖缁撴灉闆�</returns>
- //public async Task<WebResponseContent> CompleteStackTaskAsync(Dt_Task task, DtStockInfo stock)
- //{
- // WebResponseContent content = new WebResponseContent();
- // try
- // {
- // if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound)
- // {
- // var process = await SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
- // .FirstAsync(x => x.EquipmentName == task.Roadway);
- // EquipmentParameterInfo info = JsonConvert.DeserializeObject<EquipmentParameterInfo>(process.ProcessValue);
- // AgingOutputDto agingOutputDto = new AgingOutputDto()
- // {
- // OpFlag = 1,
- // EquipmentCode = stock.LocationInfo.RoadwayNo,
- // TrayBarcode = stock.PalletCode,
- // SerialNos = stock.StockInfoDetails.Select(x => new SerialNoOutDto()
- // {
- // SlotNo = x.OrderNo.ToInt32(),
- // SerialNo = x.SerialNumber,
- // SerialNoResult = true,
- // ParameterInfo = new List<ParameterInfo>()
- // {
- // new ParameterInfo()
- // {
- // LowerLomit =info.LowerControlLimit,
- // UpperLimit = info.UpperControlLimit,
- // ParameterResult = info.EquipmentAvailabilityFlag,
- // ParameterCode = info.ParameterCode,
- // ParameterDesc = info.Description,
- // TargetValue = info.TargetValue,
- // Value = info.TargetValue,
- // DefectCode = info.UOMCode
- // }
- // }
- // }).ToList()
- // };
- // content = await _agingInOrOutInputService.GetOCVOutputAsync(agingOutputDto);
- // var result = JsonConvert.DeserializeObject<BasicResult>(content.ToString());
- // if (!result.Success)
- // {
- // throw new Exception(result.MOMMessage);
- // }
- // }
- // // 鏇存柊搴撳瓨鐘舵��
- // var loation = _locationRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
- // var detail = _stockInfoDetailRepository.QueryData(x => x.StockId == stock.Id);
-
- // // 璁剧疆搴撲綅鐘舵�佷负绌洪棽
- // loation.LocationStatus = LocationEnum.Free.ObjToInt();
-
- // // 鏇存柊浠诲姟鐘舵��
- // task.TaskState = TaskOutStatusEnum.OutFinish.ObjToInt();
- // task.CurrentAddress = task.NextAddress;
- // task.NextAddress = task.TargetAddress;
-
- // LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍫嗗灈鏈哄嚭搴撳畬鎴�", "鏇存柊搴撳瓨鐘舵�佷笌浠诲姟鐘舵��");
-
- // // 浜嬪姟澶勭悊
- // // 寮�濮嬩簨鍔�
- // _unitOfWorkManage.BeginTran();
- // // 鍒犻櫎搴撳瓨淇℃伅
- // var isStockUpdated = _stockInfoRepository.DeleteDataById(stock.Id);
- // // 鍒犻櫎搴撳瓨淇℃伅
- // var isStockDetailUpdated = _stockInfoDetailRepository.DeleteDataByIds(detail.Select(x => (object)x.Id).ToArray());
- // // 鍒犻櫎浠诲姟淇℃伅
- // var isTaskUpdated = BaseDal.DeleteDataById(task.TaskId);
-
- // // 濡傛灉搴撳瓨淇℃伅鍜屼换鍔′俊鎭兘鏇存柊鎴愬姛
- // if (isStockUpdated && isTaskUpdated && isStockDetailUpdated)
- // {
- // // 璁板綍鏃ュ織
- // LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍫嗗灈鏈哄嚭搴撳畬鎴�", $"浜嬪姟澶勭悊瀹屾垚锛屽簱瀛樼姸鎬佹洿鏂帮細{isStockUpdated}锛屼换鍔$姸鎬佹洿鏂�:{isTaskUpdated}");
- // // 鎻愪氦浜嬪姟
- // _unitOfWorkManage.CommitTran();
- // // 杩斿洖鎴愬姛缁撴灉
- // return content.OK("浠诲姟瀹屾垚鎴愬姛");
- // }
- // else
- // {
- // // 璁板綍鏃ュ織
- // LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍫嗗灈鏈哄嚭搴撳畬鎴�", $"浜嬪姟澶勭悊澶辫触锛屽簱瀛樼姸鎬佹洿鏂帮細{isStockUpdated}锛屼换鍔$姸鎬佹洿鏂�:{isTaskUpdated}");
- // // 鍥炴粴浜嬪姟
- // _unitOfWorkManage.RollbackTran();
- // // 杩斿洖澶辫触缁撴灉
- // return content.Error("浠诲姟鎴栧簱瀛樻洿鏂板け璐�");
- // }
- // }
- // catch (Exception err)
- // {
- // LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, $"绯荤粺寮傚父锛屽紓甯镐俊鎭細{err.Message}", "");
- // Console.WriteLine(err.Message);
- // return content.Error(err.Message);
- // }
- //}
public async Task<WebResponseContent> CompleteStackTaskAsync(Dt_Task task, DtStockInfo stock)
{
@@ -190,7 +91,7 @@
{
var process = await SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
.FirstAsync(x => x.EquipmentName == task.Roadway);
- var info = JsonConvert.DeserializeObject<List<EquipmentParameterInfo>>(process.ProcessValue);
+ var info = JsonConvert.DeserializeObject<ResponseEqptRunDto>(process.ProcessValue);
var agingOutputDto = MapToAgingOutputDto(stock, info);
content = await _agingInOrOutInputService.GetOCVOutputAsync(agingOutputDto);
@@ -206,7 +107,7 @@
await UpdateLocationAsync(loc);
await DeleteStockInfoAsync(stock.Id);
await DeleteStockInfoDetailsAsync(stock.StockInfoDetails);
- await DeleteTaskAsync(task.TaskId);
+ //await DeleteTaskAsync(task.TaskId);
});
return content.OK("浠诲姟瀹屾垚鎴愬姛");
@@ -218,19 +119,20 @@
}
}
- private AgingOutputDto MapToAgingOutputDto(DtStockInfo stock, List<EquipmentParameterInfo> info)
+ private AgingOutputDto MapToAgingOutputDto(DtStockInfo stock, ResponseEqptRunDto info)
{
return new AgingOutputDto
{
OpFlag = 1,
- EquipmentCode = stock.LocationInfo.RoadwayNo,
+ Software = "WMS",
+ EquipmentCode = "ECH001-B",
TrayBarcode = stock.PalletCode,
SerialNos = stock.StockInfoDetails.Select(x => new SerialNoOutDto
{
SlotNo = x.OrderNo.ToInt32(),
SerialNo = x.SerialNumber,
SerialNoResult = true,
- ParameterInfo = info.Select(x => new ParameterInfo()
+ ParameterInfo = info.ParameterInfo.Select(x => new ParameterInfo()
{
LowerLomit = x.LowerControlLimit,
UpperLimit = x.UpperControlLimit,
@@ -247,7 +149,7 @@
private void ValidateResponse(WebResponseContent content)
{
- var result = JsonConvert.DeserializeObject<BasicResult>(content.ToString());
+ var result = JsonConvert.DeserializeObject<BasicResult>(content.Data.ToString());
if (!result.Success)
{
throw new Exception(result.MOMMessage);
@@ -259,10 +161,10 @@
var location = _locationRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
var details = _stockInfoDetailRepository.QueryData(x => x.StockId == stock.Id);
- location.LocationStatus = LocationEnum.Free.ObjToInt();
- task.TaskState = TaskOutStatusEnum.OutFinish.ObjToInt();
- task.CurrentAddress = task.NextAddress;
- task.NextAddress = task.TargetAddress;
+ location.LocationStatus = (int)LocationEnum.Free;
+ task.TaskState = (int)TaskOutStatusEnum.OutFinish;
+ //task.CurrentAddress = task.NextAddress;
+ //task.NextAddress = task.TargetAddress;
LogFactory.GetLog("浠诲姟瀹屾垚").Info(true, "鏇存柊搴撳瓨鐘舵�佷笌浠诲姟鐘舵��");
return (location, task);
@@ -474,7 +376,7 @@
LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "楠岃瘉浠诲姟鏄惁瀛樺湪", JsonConvert.SerializeObject(task));
// 楠岃瘉搴撳瓨鏄惁瀛樺湪
- var stock = await _stockInfoRepository.QueryFirstAsync(x => x.PalletCode == task.PalletCode);
+ var stock = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == task.PalletCode);
// 鏍规嵁浠诲姟绫诲瀷璋冪敤鐩稿簲鐨勫畬鎴愪换鍔℃柟娉�
switch (task.TaskType)
--
Gitblit v1.9.3