From b690250002ee04f4309e6a90fd16fbfd9bd959e2 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 01 五月 2026 23:11:23 +0800
Subject: [PATCH] feat(router): 添加托盘操作页面路由

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
index 8cba5b3..33bce5e 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
@@ -1,3 +1,4 @@
+using Masuit.Tools;
 using Serilog;
 using WIDESEAWCS_Common.TaskEnum;
 using WIDESEAWCS_Core.Helper;
@@ -241,7 +242,6 @@
                     }
                     return;
                 }
-
             }
 
             // 闈炴崲鐩樹换鍔★細浣跨敤鍘熸湁鏍煎紡
@@ -271,6 +271,7 @@
                 if (stateToUpdate != null)
                 {
                     stateToUpdate.CurrentTask = task;
+                    stateToUpdate.CurrentTaskNum = task.RobotTaskNum;
 
                     if (_stateManager.TryUpdateStateSafely(ipAddress, stateToUpdate))
                     {
@@ -336,7 +337,7 @@
                 string trayBarcode1 = RobotBarcodeGenerator.GenerateTrayBarcode("DB40.1020");
 
                 // 濡傛灉鏉$爜鐢熸垚鎴愬姛
-                if (!string.IsNullOrEmpty(trayBarcode1) && !string.IsNullOrEmpty(trayBarcode2))
+                if (!trayBarcode1.IsNullOrEmpty() && !trayBarcode2.IsNullOrEmpty())
                 {
                     //if (stateForUpdate.CellBarcode.Contains(trayBarcode1) || stateForUpdate.CellBarcode.Contains(trayBarcode2))
                     //{
@@ -356,15 +357,23 @@
 
                         QuartzLogHelper.LogInfo(_logger, $"HandlePutFinishedStateAsync锛氳鍙栫殑鐢佃姱鏉$爜鍞竴锛岀户缁墽琛岋紝浠诲姟鍙�: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress);
 
-                        // 灏嗘潯鐮佹坊鍔犲埌鐘舵�佷腑锛屼緵鍚庣画鏀捐揣鏃朵娇鐢�
-                        stateForUpdate.CellBarcode = new List<string>()
-                        {
-                            trayBarcode1,trayBarcode2
-                        };
-                    }
+                        // 璁板綍鏃ュ織锛氳鍙栨墭鐩樻潯鐮佹垚鍔�
+                        QuartzLogHelper.LogInfo(_logger, $"HandlePutFinishedStateAsync锛氳鍙栫數鑺潯鐮佹垚鍔�: 銆恵trayBarcode1}銆�-----銆恵trayBarcode2}銆戯紝浠诲姟鍙�: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress);
 
-                    // 璁板綍鏃ュ織锛氳鍙栨墭鐩樻潯鐮佹垚鍔�
-                    QuartzLogHelper.LogInfo(_logger, $"HandlePutFinishedStateAsync锛氳鍙栫數鑺潯鐮佹垚鍔�: 銆恵trayBarcode1}銆�-----銆恵trayBarcode2}銆戯紝浠诲姟鍙�: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress);
+                        // 灏嗘潯鐮佺疮绉埌 CellBarcode锛堝幓閲嶏級锛屽苟璁剧疆褰撳墠鎵规鏉$爜
+                        if (!stateForUpdate.CellBarcode.Contains(trayBarcode1) || !stateForUpdate.CellBarcode.Contains(trayBarcode2))
+                        {
+
+                            stateForUpdate.CellBarcode.Add(trayBarcode1);
+                            stateForUpdate.CellBarcode.Add(trayBarcode2);
+
+                            // 璁剧疆褰撳墠鎵规鏉$爜锛岀敤浜� WMS 鎻愪氦
+                            stateForUpdate.CurrentBatchBarcodes = new List<string>()
+                            {
+                                trayBarcode1, trayBarcode2
+                            };
+                        }
+                    }
 
                     // 鍙戦�佸彇璐ф寚浠�
                     await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate);
@@ -401,7 +410,7 @@
                     return;
                 }
 
-                QuartzLogHelper.LogDebug(_logger,$"HandlePutFinishedStateAsync锛氭崲鐩樹换鍔$洰鏍囨暟閲�: {targetNormalCount}锛屽綋鍓嶅凡瀹屾垚鏁伴噺: {currentCompletedCount}锛屾祦鍚�: {(isFlowA ? "A" : "B")}锛屼换鍔″彿: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress);
+                QuartzLogHelper.LogDebug(_logger, $"HandlePutFinishedStateAsync锛氭崲鐩樹换鍔$洰鏍囨暟閲�: {targetNormalCount}锛屽綋鍓嶅凡瀹屾垚鏁伴噺: {currentCompletedCount}锛屾祦鍚�: {(isFlowA ? "A" : "B")}锛屼换鍔″彿: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress);
 
                 // 鍒濆鍖栨壒娆℃ā寮�
                 if (stateForUpdate.ChangePalletPhase == 0)

--
Gitblit v1.9.3