From 03e09a08f4609cc61e64ca16129db5a3ccb85c1d Mon Sep 17 00:00:00 2001
From: chenyong <chenyong@hnkhzn.com>
Date: 星期四, 22 五月 2025 14:32:31 +0800
Subject: [PATCH] Revert "三楼大屏"

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs |   66 ++++++++++++++++++++++----------
 1 files changed, 45 insertions(+), 21 deletions(-)

diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
index aea5799..3514374 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -216,9 +216,14 @@
                 }
                 else
                 {
-                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
-                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
+                    //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
+                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+                    //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
+                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)task.TaskNum, childDeviceCode);
+                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode);
+                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, childDeviceCode);
                     conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
+
                     _taskService.UpdateTaskStatusToNext(task);
                 }
             }
@@ -236,7 +241,8 @@
         /// <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)
@@ -248,13 +254,11 @@
                 Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                 if (newTask != null)
                 {
-                    //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, newTask.TaskNum, childDeviceCode);
-                    //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, newTask.NextAddress, childDeviceCode);
-                    //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, command.ConveyorLineBarcode, childDeviceCode);
-                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
-                    //taskCommand.InteractiveSignal = command.InteractiveSignal;
-                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
+                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)newTask.TaskNum, childDeviceCode);
+                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, newTask.NextAddress, childDeviceCode);
+                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, newTask.PalletCode, childDeviceCode);
                     conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
+                    _taskService.UpdateData(newTask);
                 }
             }
         }
@@ -294,10 +298,16 @@
         public void RequestOutbound(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
         {
             var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
+            //var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode, command.ConveyorLineBarcode);
             if (task != null)
             {
-                ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
-                conveyorLine.SendCommand(taskCommand, childDeviceCode);
+                //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
+                //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+                //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
+
+                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)task.TaskNum, childDeviceCode);
+                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode);
+                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, childDeviceCode);
                 conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
 
                 //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
@@ -317,7 +327,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);
@@ -351,16 +362,27 @@
                     Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                     if (newTask != null)
                     {
-                        ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
-                        conveyorLine.SendCommand(taskCommand, childDeviceCode);
+                        //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
+                        //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+                        //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
+
+                        conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)newTask.TaskNum, childDeviceCode);
+                        conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, newTask.NextAddress, childDeviceCode);
+                        conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, newTask.PalletCode, childDeviceCode);
                         conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
+                        _taskService.UpdateData(newTask);
                     }
                 }
                 else
                 {
-                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
-                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
-                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
+                    //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.ConveyorLineTaskNum, (long)task.TaskNum, childDeviceCode);
+                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode);
+                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, childDeviceCode);
                     conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                     _taskService.UpdateTaskStatusToNext(task);
                 }
@@ -377,7 +399,8 @@
         {
             try
             {
-                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();
@@ -424,6 +447,7 @@
                     conveyorLine.Communicator.Write(address, 1);
                     //conveyorLine.SetValue(ConveyorLineDBName_After.InteractiveSignal, taskCommand.InteractiveSignal, childDeviceCode);
                     //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
+                    WriteInfo($"{conveyorLine.DeviceName}杈撻�佺嚎鍑哄簱瀹屾垚", $"瀛愯妭鐐广�恵childDeviceCode}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆�");
                 }
             }
             catch (Exception ex)
@@ -494,8 +518,8 @@
                 }
                 var wmsIpAddress = wmsBase + requestTrayOutTask;
 
-                var device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1" && x.DeviceRemark == platform.Id.ToString());
-                var deviceCode = device.Select(x => x.DeviceCode).ToList();
+                //var device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1" && x.DeviceRemark == platform.Id.ToString());
+                //var deviceCode = device.Select(x => x.DeviceCode).ToList();
                 List<string> strings = platform.Location.Split(',').ToList();
 
                 var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = platform.Stacker, AreaCdoes = strings, platform.ProductionLine }.ToJsonString());
@@ -508,7 +532,7 @@
                     return;
 
                 taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
-                //WriteInfo("鍑哄簱", $"銆恵JsonConvert.SerializeObject(taskDTO)}銆�");
+                WriteInfo("鍑哄簱", $"銆恵JsonConvert.SerializeObject(taskDTO)}銆�");
                 #endregion 璋冪敤WMS鑾峰彇鍑哄簱浠诲姟
 
                 CreateAndSendTask(taskDTO);

--
Gitblit v1.9.3