From 925b834a3341dbe9f486964a7ad5d1affd7a404d Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 24 十月 2023 13:33:05 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java b/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java
index 603d742..525078e 100644
--- a/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java
+++ b/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java
@@ -69,6 +69,14 @@
      * 璋冨害杞﹁締
      */
     public boolean dispatchShuttle(Integer wrkNo, String locNo) {
+        //妫�娴嬬洰鏍囧簱浣嶇粍鏄惁瀛樺湪灏忚溅锛屽瀛樺湪灏忚溅鍒欑洿鎺ユ寚瀹氳杞�
+        List<String> groupLoc = Utils.getGroupLoc(locNo);
+        Integer groupShuttleNo = Utils.checkGroupLocHasShuttle(groupLoc);
+        if (groupShuttleNo != null) {
+            //瀛樺湪灏忚溅锛岀洿鎺ヨ皟搴﹁杞�
+            return shuttleMoveGenerate(wrkNo, locNo, groupShuttleNo);
+        }
+
         ArrayList<NyShuttleThread> sameLev = new ArrayList<>();//鐩稿悓妤煎眰鐨勭┛姊溅
         ArrayList<NyShuttleThread> diffLev = new ArrayList<>();//涓嶅悓妤煎眰鐨勭┛姊溅
 
@@ -236,7 +244,7 @@
         if (Utils.getLev(locNo) != shuttleProtocol.getPoint().getZ()) {
             //鐩爣搴撲綅鍜屽皬杞﹀簱浣嶅浜庝笉鍚屼竴妤煎眰锛岄渶瑕侀�氳繃鎻愬崌鏈鸿皟搴�
             //鑾峰彇绌挎杞︽渶杩戜笖绌洪棽鐨勬彁鍗囨満杈撻�佺珯鐐�
-            LiftStaProtocol liftSta = this.getRecentLiftSta(shuttleNo);
+            LiftStaProtocol liftSta = this.getRecentLiftSta(shuttleNo, Utils.getLev(locNo));
             if (liftSta == null) {
                 return false;//娌℃湁鍙敤涓旂┖闂茬殑杈撻�佺珯鐐�
             }
@@ -344,7 +352,7 @@
     /**
      * 鑾峰彇绌挎杞︽渶杩戜笖绌洪棽鐨勬彁鍗囨満杈撻�佺珯鐐�
      */
-    public LiftStaProtocol getRecentLiftSta(Integer shuttleNo) {
+    public LiftStaProtocol getRecentLiftSta(Integer shuttleNo, Integer targetLev) {
         //鑾峰彇鍥涘悜绌挎杞︾嚎绋�
         NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo);
         if (shuttleThread == null) {
@@ -376,6 +384,16 @@
                 continue;
             }
 
+            //鍒ゆ柇鐩爣妤煎眰绔欑偣鏄惁鏃犳墭鐩�
+            LiftStaProtocol targetLiftStaProtocol = NyLiftUtils.getLiftStaByLev(slave.getId(), targetLev);
+            if (targetLiftStaProtocol == null) {
+                continue;
+            }
+
+            if (targetLiftStaProtocol.getHasTray()) {
+                continue;//鏈夋墭鐩樿烦杩�
+            }
+
             list.add(liftStaProtocol);
         }
 

--
Gitblit v1.9.1