From d0712fcf60aa1ef5ddfb8d18b583a742893a7aea Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <1247017146@qq.com>
Date: 星期二, 03 六月 2025 11:04:52 +0800
Subject: [PATCH] 代码提交

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
index 82cde70..e6c1dac 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -259,7 +259,7 @@
                     Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                     if (platform != null && !string.IsNullOrEmpty(platform.Location))
                     {
-                        if (platform.PlatCode == "1299" || platform.PlatCode == "1295" || platform.PlatCode == "1291" || platform.PlatCode == "1287" || platform.PlatCode == "1283")
+                        if (platform.PlatCode == "2040" || platform.PlatCode == "2036" || platform.PlatCode == "2032" || platform.PlatCode == "2028" || platform.PlatCode == "2024")
                         {
                             Platform platformJZ = _platFormRepository.QueryFirst(x => x.PlatCode == "10086" && x.Status == "Active");
                             if (platformJZ != null)
@@ -285,10 +285,6 @@
                                     }
                                 }
                             }
-                            //else
-                            //{
-                            //    //ConsoleHelper.WriteErrorLine("闈欑疆绌烘墭涓嶅厑璁稿嚭鏂�");
-                            //}
                         }
                         else
                         {
@@ -392,7 +388,8 @@
                 }
                 else
                 {
-                    var taskInTray = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+                    //var taskInTray = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+                    var taskInTray = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode,command.Barcode);
                     if (taskInTray != null && taskInTray.TaskType == (int)TaskInboundTypeEnum.InTray)
                     {
                         RequestInNextAddress(conveyorLine, command, childDeviceCode, ProtocalDetailValue);
@@ -447,6 +444,7 @@
                                 // 濡傛灉宸叉湁浠诲姟鏁伴噺灏忎簬鎸囧畾绱㈠紩
                                 if (tasks.Count < Location.Count)
                                 {
+                                    ConsoleHelper.WriteSuccessLine($"{childDeviceCode}");
                                     return childDeviceCode;
                                 }
                                 else
@@ -493,7 +491,8 @@
             _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
             WriteInfo(conveyorLine.DeviceName, log);
 
-            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+            //Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode);
             if (task != null)
             {
                 if (command.Barcode == task.PalletCode)
@@ -501,6 +500,7 @@
                     Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                     if (newTask != null)
                     {
+                        
                         //ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(newTask);
                         //taskCommand.InteractiveSignal = command.InteractiveSignal;
                         var next = newTask.NextAddress;
@@ -516,6 +516,7 @@
                         conveyorLine.SendCommand(taskCommand, childDeviceCode);
 
                         ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
+
                         _taskService.UpdateData(newTask);
                     }
                 }
@@ -541,7 +542,8 @@
                 _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                 WriteInfo(conveyorLine.DeviceName, log);
 
-                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+                //var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode);
                 if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish)
                 {
                     if (command.Barcode == task.PalletCode && childDeviceCode == task.NextAddress)
@@ -599,6 +601,7 @@
             {
                 // 鏌ヨ杈撻�佺嚎浠诲姟锛屾牴鎹緭閫佺嚎璁惧鍜屽瓙璁惧浠g爜鑾峰彇浠诲姟淇℃伅
                 var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
+                //var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode, command.Barcode);
 
                 // 杈撳嚭鎴愬姛淇℃伅锛屽寘鎷緭閫佺嚎鍚嶇О銆佷换鍔″彿銆佹墭鐩樻潯鐮佸拰瀛愯澶囦唬鐮侊紝浠ュ強浠诲姟淇℃伅
                 var logs = $"銆恵conveyorLine._deviceName}銆戜换鍔″彿锛氥�恵command.TaskNum}銆�,鎵樼洏鏉$爜锛氥�恵command.Barcode}銆戝凡鍒拌揪銆恵childDeviceCode}銆戣緭閫佺嚎璇锋眰鍑哄簱,task{task.ToJsonString()}";
@@ -663,7 +666,8 @@
             WriteInfo(conveyorLine.DeviceName, log);
 
             // 鏌ヨ姝e湪鎵ц鐨勮緭閫佺嚎浠诲姟锛屾牴鎹换鍔″彿鍜屽瓙璁惧浠g爜鑾峰彇浠诲姟淇℃伅
-            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+            //Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode);
 
             // 濡傛灉浠诲姟瀛樺湪
             if (task != null)
@@ -677,6 +681,7 @@
                     // 濡傛灉鏇存柊鍚庣殑浠诲姟瀵硅薄涓嶄负绌�
                     if (newTask != null)
                     {
+                        //_taskService.UpdateData(newTask);
                         // 鑾峰彇涓嬩竴鐩爣鍦板潃
                         var next = newTask.NextAddress;
 
@@ -698,6 +703,7 @@
 
                         // 鏍囪杈撻�佺嚎鍙戦�佷换鍔″畬鎴�
                         ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
+
                         _taskService.UpdateData(newTask);
                     }
                 }
@@ -722,7 +728,8 @@
                 WriteInfo(conveyorLine.DeviceName, logs);
 
                 // 鏌ヨ姝e湪鎵ц鐨勮緭閫佺嚎浠诲姟
-                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+                //var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
+                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode);
 
                 // 濡傛灉浠诲姟瀛樺湪
                 if (task != null)

--
Gitblit v1.9.3