From e08cf3df4a7f37cbb41f6f179fc8fc5d409e4ea3 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期三, 25 六月 2025 16:51:17 +0800 Subject: [PATCH] 1 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs | 33 ++++++++++++++++++++------------- 1 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs index 6dc3b07..8656569 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs @@ -212,9 +212,15 @@ } else { + var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList(); + if (GWTask.Count >= 2 && childDeviceCode == "1039"&& task.Roadway.Contains("GWSC2")) + { + ConsoleHelper.WriteErrorLine($"鎵樼洏鍙凤細銆恵command.ConveyorLineBarcode}銆戦珮娓╀簩宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�"); + return; + } ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); conveyorLine.SendCommand(taskCommand, childDeviceCode); - conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); + conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); _taskService.UpdateTaskStatusToNext(task); } } @@ -232,12 +238,13 @@ /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param> public void RequestInNextAddress(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode) { - Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); + //Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); + Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode); if (task != null) { if (command.ConveyorLineBarcode != task.PalletCode) { - conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 2, childDeviceCode); + conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); return; } @@ -246,7 +253,7 @@ { ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask); conveyorLine.SendCommand(taskCommand, childDeviceCode); - conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); + conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); _taskService.UpdateData(newTask); } } @@ -268,7 +275,7 @@ if (content.Status) { - conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); + conveyorLine.SetValue(ConveyorLineDBName_After.ResponState,Convert.ToInt16(1), childDeviceCode); } Console.Out.WriteLine(content.Serialize()); @@ -289,9 +296,8 @@ { ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); conveyorLine.SendCommand(taskCommand, childDeviceCode); - conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); + conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); - //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); _taskService.UpdateTaskStatusToNext(task); if (task.TaskType == (int)TaskOutboundTypeEnum.OutTray) { @@ -308,7 +314,8 @@ /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param> public void RequestOutNextAddress(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode) { - Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); + //Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); + Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode); if (task != null) { var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); @@ -344,7 +351,7 @@ { ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask); conveyorLine.SendCommand(taskCommand, childDeviceCode); - conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); + conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); _taskService.UpdateData(newTask); } } @@ -353,7 +360,7 @@ ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode); conveyorLine.SendCommand(taskCommand, childDeviceCode); - conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); + conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); _taskService.UpdateTaskStatusToNext(task); } } @@ -367,7 +374,8 @@ /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param> public void ConveyorLineOutFinish(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode) { - var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); + //var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); + var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode); if (task != null) { WebResponseContent content = new WebResponseContent(); @@ -398,8 +406,7 @@ } conveyorLine.SendCommand(taskCommand, childDeviceCode); - conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); - //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); + conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); content = _taskService.UpdateTaskStatusToNext(task); } //else -- Gitblit v1.9.3