From f640a3ab00189bb0f55a7bfb65f309f80803e88b Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期六, 18 四月 2026 14:25:25 +0800
Subject: [PATCH] 优化成品移库任务,添加WMS任务号加流水号确保WMS任务号唯一
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 58 +++++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 49 insertions(+), 9 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index a939d58..35f50a3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -392,7 +392,7 @@
bool isAGV = dt_Task.TaskType == (int)TaskTypeEnum.CPInbound || dt_Task.TaskType == (int)TaskTypeEnum.CPOutbound;
//娴峰悍
- bool isHK = dt_Task.TaskType == (int)TaskTypeEnum.F01 || dt_Task.TaskType == (int)TaskTypeEnum.RK3F || dt_Task.TaskType == (int)TaskTypeEnum.CK3F || dt_Task.TaskType == (int)TaskTypeEnum.Q1TSJ4 || dt_Task.TaskType == (int)TaskTypeEnum.STU0003 || dt_Task.TaskType == (int)TaskTypeEnum.F02 || dt_Task.TaskType == (int)TaskTypeEnum.CHUKU1 || dt_Task.TaskType == (int)TaskTypeEnum.Q3RK || dt_Task.TaskType == (int)TaskTypeEnum.Q3CK||dt_Task.TaskType == (int)TaskTypeEnum.STUPTBY;
+ bool isHK = dt_Task.TaskType == (int)TaskTypeEnum.F01 || dt_Task.TaskType == (int)TaskTypeEnum.RK3F || dt_Task.TaskType == (int)TaskTypeEnum.CK3F || dt_Task.TaskType == (int)TaskTypeEnum.Q1TSJ4 || dt_Task.TaskType == (int)TaskTypeEnum.STU0003 || dt_Task.TaskType == (int)TaskTypeEnum.F02 || dt_Task.TaskType == (int)TaskTypeEnum.CHUKU1 || dt_Task.TaskType == (int)TaskTypeEnum.Q3RK || dt_Task.TaskType == (int)TaskTypeEnum.Q3CK || dt_Task.TaskType == (int)TaskTypeEnum.STUPTBY;
//淇敼鍘熸湰浠诲姟浼樺厛绾�
dt_Task.Grade = updateTaskPriority.taskPriority;
#region 鍑箰澹�
@@ -523,7 +523,7 @@
var kls = new List<Dt_KLSLocationInfo>();
var hk = new List<Dt_HKLocationInfo>();
List<Dt_StationInfo> pk = new List<Dt_StationInfo>();
- if (wMSUpdateLocationArea==null)
+ if (wMSUpdateLocationArea == null)
{
return content.Error("璇锋眰鍙傛暟涓嶈兘涓虹┖");
}
@@ -1155,7 +1155,8 @@
LoctionCode = item.LocationCode,
LocationStatus = item.LocationStatus,
EnableStatus = item.EnableStatus,
- PalletCode = item.PalletCode
+ PalletCode = item.PalletCode,
+ AreaCode = item.WarehouseId
});
}
@@ -1175,7 +1176,8 @@
LoctionCode = item.LocationCode,
LocationStatus = item.LocationStatus,
EnableStatus = item.EnableStatus,
- PalletCode = item.PalletCode
+ PalletCode = item.PalletCode,
+ AreaCode = item.WarehouseId
});
}
content.OK(data: list);
@@ -1209,7 +1211,8 @@
LoctionCode = item.LocationCode,
LocationStatus = item.LocationStatus,
EnableStatus = item.EnableStatus,
- PalletCode = item.PalletCode
+ PalletCode = item.PalletCode,
+ AreaCode = item.WarehouseId
});
}
content.OK(data: list);
@@ -1247,7 +1250,9 @@
LoctionCode = item.StationCode,
LocationStatus = item.StationStatus,
EnableStatus = item.IsOccupied,
- PalletCode = item.PalletCode
+ PalletCode = item.PalletCode,
+ AreaCode = item.StationRegion
+
});
}
content.OK(data: list);
@@ -1281,6 +1286,7 @@
{
throw new NotImplementedException();
}
+
public WebResponseContent InboundElevatorExit(string LocationCode, string containerCode)
{
WebResponseContent content = new WebResponseContent();
@@ -1400,6 +1406,7 @@
{
stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
stationManger.Remark = "";
+ _stationMangerService.UpdateData(stationManger);
FOURBOToccupyStation fOURBOToccupyStation = new FOURBOToccupyStation()
{
stationCode = wMSContainerFlow.slotCode,
@@ -1408,7 +1415,6 @@
FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
content.OK(data: fOURBOTReturn);
if (fOURBOTReturn.returnCode != 0) throw new Exception(fOURBOTReturn.returnUserMsg);
- _stationMangerService.UpdateData(stationManger);
}
return content.OK();
}
@@ -1526,7 +1532,10 @@
{
// 鏌ユ壘鎵�鏈変换鍔′腑鍖呭惈杩欎釜id鐨�
var take = BaseDal.QueryData(x => keys.Contains(x.TaskId));
-
+ foreach (var item in take)
+ {
+ item.Modifier = App.User.UserName;
+ }
// 鎵ц绉诲叆鍘嗗彶鎿嶄綔锛屽苟妫�鏌ョ粨鏋�
bool moveResult = BaseDal.DeleteAndMoveIntoHty(take, OperateTypeEnum.浜哄伐鍒犻櫎);
@@ -1777,7 +1786,7 @@
var station = _stationInfo.Repository.QueryFirst(x => x.StationCode == locationCode);
if (station != null)
{
- station.IsOccupied = upLocationStatusDTO.EnableStatus==0?0:1;
+ station.IsOccupied = upLocationStatusDTO.EnableStatus == 0 ? 0 : 1;
locationsToUpdate.Add(station);
resultList.Add(new
@@ -1860,5 +1869,36 @@
return content.Error($"鏇存柊绔欏彴鐘舵�佸け璐ワ細{ex.Message}");
}
}
+
+
+ /// <summary>
+ /// PLC鎶ヨ淇℃伅
+ /// </summary>
+ /// <param name="ErrorMsg"></param>
+ /// <returns></returns>
+ public WebResponseContent PLCAlarmtoWMS(string ErrorMsg)
+ {
+ PLCAlarmDTO PLCAlarmDTO = new PLCAlarmDTO();
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(PLCAlarmDTO)) ?? throw new Exception("鏈壘鍒癙LC鎶ヨ淇℃伅鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+ PLCAlarmDTO.errorMsg = ErrorMsg;
+ string response = HttpHelper.Post(apiInfo.ApiAddress, PLCAlarmDTO.Serialize());
+ content.OK(data: response);
+ WMSReturn wMSReturn = response.DeserializeObject<WMSReturn>();
+ if (wMSReturn == null) throw new Exception("WMS杩斿洖缁撴灉杞崲澶辫触锛�");
+ if (!wMSReturn.success) throw new Exception(wMSReturn.message);
+ return content.OK();
+ }
+ catch (Exception ex)
+ {
+ return content.Error(ex.Message);
+ }
+ finally
+ {
+ _trackloginfoService.AddTrackLog(PLCAlarmDTO, content, "PLC鎶ヨ淇℃伅涓婃姤WMS", "", "");
+ }
+ }
}
}
--
Gitblit v1.9.3