From 8741f7e84dc7c0a1150c92758ebb2cf4b7d18c73 Mon Sep 17 00:00:00 2001 From: pulg <plg@Haninfo> Date: 星期五, 18 七月 2025 14:49:30 +0800 Subject: [PATCH] 1 --- HH.WCS.QingXiNongfu/core/TaskCore.cs | 68 ++++++++++++++++++++++++++++++++- 1 files changed, 65 insertions(+), 3 deletions(-) diff --git a/HH.WCS.QingXiNongfu/core/TaskCore.cs b/HH.WCS.QingXiNongfu/core/TaskCore.cs index ebe053a..2c83a51 100644 --- a/HH.WCS.QingXiNongfu/core/TaskCore.cs +++ b/HH.WCS.QingXiNongfu/core/TaskCore.cs @@ -7,8 +7,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Web.Configuration; -using System.Xml.Schema; using static HH.WCS.QingXigongchang.api.ApiModel; namespace HH.WCS.QingXigongchang.core @@ -36,7 +34,7 @@ && wmsTask.S_B_STATE.Trim() != "寮哄埗瀹屾垚" && wmsTask.S_B_STATE.Trim() != "鍙栨秷") { - if (model.State < 8 || model.State > 1000) + if (model.State < 10 || model.State > 1000) { if (model.State < 7 && string.IsNullOrEmpty(model.ForkliftNo)) { @@ -93,12 +91,76 @@ TaskProcess.OperateStatus(wmsTask, 7); wmsTask.T_END_TIME = DateTime.Now; TaskHelper.UpdateStatus(wmsTask, "鍙栨秷"); + try + { + if (wmsTask.S_TYPE.Contains("娉ㄥ婊℃墭-鍏ュ簱")) + { + var plc = Settings.GetDeviceInfoList().Where(a => a.location.Any(str => str == wmsTask.S_START_LOC)).FirstOrDefault(); + if (plc != null) + { + for (var i = 0; i < plc.location.Length; i++) + { + if (wmsTask.S_START_LOC == plc.location[i]) + { + PlcHelper.SendHex(plc.address, "3F00" + (i + 1) + "0" + "0d0a"); + break; + } + } + } + } + else if (wmsTask.S_TYPE.Contains("娉ㄥ绌烘嫋-鍑哄簱")) + { + var plc = Settings.GetDeviceInfoList().Where(a => a.location.Any(str => str == wmsTask.S_END_LOC)).FirstOrDefault(); + if (plc != null) + { + for (var i = 0; i < plc.location.Length; i++) + { + if (wmsTask.S_END_LOC == plc.location[i]) + { + PlcHelper.SendHex(plc.address, "3F00" + (i + 1) + "0" + "0d0a"); + break; + } + } + } + } + else if (wmsTask.S_TYPE.Contains("鐡跺澂缈绘枟鏈烘弧鎵�鍑哄簱")) + { + var plc = Settings.GetDeviceInfoList().Where(a => a.location.Any(str => str == wmsTask.S_END_LOC)).FirstOrDefault(); + if (plc != null) + { + PlcHelper.SendHex(plc.address, "3F00110D0A"); + } + + } + else if (wmsTask.S_TYPE.Contains("鐡跺澂缈绘枟鏈虹┖鎵�鍏ュ簱")) + { + var plc = Settings.GetDeviceInfoList().Where(a => a.location.Any(str => str == wmsTask.S_START_LOC)).FirstOrDefault(); + if (plc != null) + { + PlcHelper.SendHex(plc.address, "3F00110D0A"); + } + } + } + catch (Exception ex) + { + + throw; + } break; case 8://寮哄埗瀹屾垚 - 鏈娇鐢� r = TaskProcess.OperateStatus(wmsTask, 8); if (r.ResultCode != -1) TaskHelper.BeEnd(wmsTask); break; + case 9://寮哄埗鍙栨秷 //璧风偣瑙g粦閿侀噴鏀�缁堢偣閿侀噴鏀�+ // var R = NDCHelper.CancelS(model.No); + r = TaskProcess.OperateStatus(wmsTask, 9); + if (r.ResultCode != -1) + { + wmsTask.T_END_TIME = DateTime.Now; + TaskHelper.UpdateStatus(wmsTask, "鍙栨秷"); + } + break; case 1101://鍙栬揣鐢宠 - -- Gitblit v1.9.1