From 3be5c88fbc583d17a932ca937d8e293d28b5c974 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期六, 12 四月 2025 15:11:25 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
index c5e2346..34dcb90 100644
--- a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
+++ b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
@@ -68,7 +68,7 @@
     /**
      * 璋冨害杞﹁締
      */
-    public boolean dispatchShuttle(Integer wrkNo, String locNo) {
+    public boolean searchDispatchShuttle(Integer wrkNo, String sourceLocNo, String locNo, String flag) {
         ArrayList<ShuttleThread> sameLev = new ArrayList<>();//鐩稿悓妤煎眰鐨勭┛姊溅
         ArrayList<ShuttleThread> diffLev = new ArrayList<>();//涓嶅悓妤煎眰鐨勭┛姊溅
 
@@ -128,6 +128,11 @@
                 Integer shuttleNo = shuttleProtocol.getShuttleNo();
                 //褰撳墠绌挎杞﹀簱浣嶅彿
                 String currentLocNo = shuttleProtocol.getCurrentLocNo();
+                if (currentLocNo.equals(locNo)) {
+                    sameShuttles.put(-1, shuttleThread);
+                    continue;
+                }
+
                 //褰撳墠绌挎杞︾嚎绋嬪埌鐩爣鍦扮偣璺濈
                 List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//鎼滅储绌洪棽绌挎杞︼紝浣跨敤姝e父閫氶亾鍦板浘
                 if (currentShuttlePath == null) {
@@ -143,7 +148,7 @@
                 ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
                 Integer shuttleNo = shuttleProtocol.getShuttleNo();
                 //灏濊瘯璋冨害灏忚溅
-                boolean result = shuttleMoveGenerate(wrkNo, locNo, shuttleNo);
+                boolean result = shuttleMoveGenerate(wrkNo, sourceLocNo, locNo, shuttleNo, flag, false);
                 if (result) {
                     return true;//璋冨害鎴愬姛
                 }
@@ -190,7 +195,7 @@
                     ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
                     Integer shuttleNo = shuttleProtocol.getShuttleNo();
                     //灏濊瘯璋冨害灏忚溅
-                    boolean result = shuttleMoveGenerate(wrkNo, locNo, shuttleNo);
+                    boolean result = shuttleMoveGenerate(wrkNo, sourceLocNo, locNo, shuttleNo, flag, false);
                     if (result) {
                         return true;//璋冨害鎴愬姛
                     }
@@ -279,6 +284,11 @@
         wrkMast.setAppeTime(now);
         wrkMast.setModiTime(now);
         wrkMast.setMainWrkNo(mainWrkMast.getWrkNo());
+
+        if ("TRANSPORT_LIFT".equals(flag)) {
+            wrkMast.setMainWrkNo(wrkNo);
+        }
+
         boolean res = wrkMastService.insert(wrkMast);
         if (!res) {
             News.error("灏忚溅杩佺Щ --- 淇濆瓨宸ヤ綔妗eけ璐ワ紒 绌挎杞﹀彿锛�" + shuttleNo);

--
Gitblit v1.9.1