From 715a556c62dddf22e8a6a2154473977915fb2e80 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 02 三月 2026 17:05:03 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/network/fake/ZyStationFakeSegConnect.java |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/main/java/com/zy/core/network/fake/ZyStationFakeSegConnect.java b/src/main/java/com/zy/core/network/fake/ZyStationFakeSegConnect.java
index a39b1b7..ccf3230 100644
--- a/src/main/java/com/zy/core/network/fake/ZyStationFakeSegConnect.java
+++ b/src/main/java/com/zy/core/network/fake/ZyStationFakeSegConnect.java
@@ -128,8 +128,6 @@
             boolean initialized = false;
             // 涓婁竴姝ユ墽琛屾椂闂达紙鐢ㄤ簬鍫靛妫�娴嬶級
             long stepExecuteTime = System.currentTimeMillis();
-            // 閬垮厤鍦ㄥ埌杈剧洰鏍囧悗閲嶅鎵ц鍒颁綅閫昏緫
-            boolean arrivalHandled = false;
 
             while (true) {
                 if (Thread.currentThread().isInterrupted()) {
@@ -150,7 +148,6 @@
                     Integer commandTargetStationId = command.getTargetStaNo();
                     if (commandTargetStationId != null) {
                         if (!commandTargetStationId.equals(finalTargetStationId)) {
-                            arrivalHandled = false;
                             News.info("[WCS Debug] 浠诲姟{}鍒囨崲鐩爣: {} -> {}", taskNo, finalTargetStationId,
                                     commandTargetStationId);
                         }
@@ -235,7 +232,6 @@
                             currentStationId = nextStationId;
                             pendingPathQueue.poll();
                             stepExecuteTime = System.currentTimeMillis();
-                            arrivalHandled = false;
                             News.info("[WCS Debug] 浠诲姟{}绉诲姩鍒扮珯鐐�: {}, 鍓╀綑闃熷垪: {}", taskNo, currentStationId,
                                     pendingPathQueue.size());
                             sleep(1000); // 妯℃嫙绉诲姩鑰楁椂
@@ -265,17 +261,18 @@
                     // 璺緞闃熷垪涓虹┖锛岀瓑寰呮柊鐨勫垎娈靛懡浠�
                     if (currentStationId != null && finalTargetStationId != null
                             && currentStationId.equals(finalTargetStationId)) {
-                        // 宸插埌杈剧洰鏍囷紝鍏堟墽琛屼竴娆″埌浣嶉�昏緫锛岀劧鍚庣户缁瓑寰呬笅涓�鏉$Щ鍔ㄥ懡浠�
-                        if (!arrivalHandled) {
-                            if (generateBarcode) {
-                                Integer targetDeviceNo = getDeviceNoByStationId(finalTargetStationId);
-                                if (targetDeviceNo != null) {
-                                    generateStationBarcode(taskNo, finalTargetStationId, targetDeviceNo);
-                                    News.info("[WCS Debug] 浠诲姟{}鍒拌揪鐩爣{}骞剁敓鎴愭潯鐮�", taskNo, finalTargetStationId);
-                                }
+                        // 宸插埌杈剧洰鏍囷細绔嬪嵆娓呯┖褰撳墠闃熷垪骞剁粨鏉熸湰杞墽琛岋紝鍚庣画鏂板懡浠ら噸鏂板垱寤烘墽琛岀嚎绋�
+                        if (generateBarcode) {
+                            Integer targetDeviceNo = getDeviceNoByStationId(finalTargetStationId);
+                            if (targetDeviceNo != null) {
+                                generateStationBarcode(taskNo, finalTargetStationId, targetDeviceNo);
+                                News.info("[WCS Debug] 浠诲姟{}鍒拌揪鐩爣{}骞剁敓鎴愭潯鐮�", taskNo, finalTargetStationId);
                             }
-                            arrivalHandled = true;
                         }
+                        commandQueue.clear();
+                        pendingPathQueue.clear();
+                        News.info("[WCS Debug] 浠诲姟{}鍒拌揪鐩爣鍚庢竻绌洪槦鍒楀苟缁撴潫锛岀瓑寰呭悗缁柊鍛戒护閲嶅惎", taskNo);
+                        break;
                     }
 
                     // 缁х画绛夊緟鏂扮殑鍒嗘鍛戒护

--
Gitblit v1.9.1