From 62b1f39e60f64ec4e05b21d11af3e36f5891a91a Mon Sep 17 00:00:00 2001
From: zc <zc@123>
Date: 星期二, 29 四月 2025 20:10:27 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/NoLiftOutServiceImpl.java |   78 ++++++++++++++++----------------------
 1 files changed, 33 insertions(+), 45 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/NoLiftOutServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/NoLiftOutServiceImpl.java
index a1900f7..1013d93 100644
--- a/src/main/java/com/zy/asrs/service/impl/NoLiftOutServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/NoLiftOutServiceImpl.java
@@ -60,14 +60,16 @@
     @Autowired
     private LiftAction liftAction;
 
+    @Autowired
+    private MainServiceImpl mainService;
 
     /**
      * 浠庢病鏈夋彁鍗囨満渚у嚭搴擄紝鏈変袱绉嶆儏鍐碉紝涓�绉�1锛�5搴撳埌鍚屽眰锛屼竴绉嶉潪1锛�5搴撳埌1锛�5锛屽垯闇�瑕佹彁鍗囨満
      * @param wrkMast
      */
-    public void shuttleMoveExecute(WrkMast wrkMast) {
+    public void shuttleMoveExecute(WrkMast wrkMast, Integer staNo, Integer lev) {
         //鍒ゆ柇鐩爣搴撲綅鏄惁鍦�1灞傛垨5灞�
-        if (Utils.getLev(wrkMast.getSourceLocNo()) == 1 || Utils.getLev(wrkMast.getSourceLocNo()) == 5) {
+        if ((lev == 1 & staNo == 1013) || (lev == 5 && staNo == 1024)) {
             boolean stepMoveSta = this.shuttleMoveExecuteTransportLiftStepCallShuttle2(wrkMast);//鍛煎彨灏忚溅鑷冲彇璐х偣
             if (!stepMoveSta) {
                 return;
@@ -142,20 +144,18 @@
             if (devpThread == null) {
                 return false;
             }
-            int lev = Utils.getLev(wrkMast.getLocNo());
-            StaProtocol staProtocol2 = devpThread.getStation().get(lev == 1 ? 1014 : 1025);
 
-            if (!staProtocol2.isOutEnable()) {
-                log.error("{}浠诲姟锛寋}鍙疯緭閫佺嚎涓嶅彲鍑�", wrkMast.getWrkNo(), lev == 1 ? 1014 : 1025);
-                News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}鍙疯緭閫佺嚎涓嶅彲鍑�", wrkMast.getWrkNo(), lev == 1 ? 1014 : 1025);
-                return false;
-            }
-
-            StaProtocol staProtocol = devpThread.getStation().get(lev == 1 ? 1015 : 1026);
-            if (staProtocol.isLoading()) {
-                log.error("{}浠诲姟锛寋}鍙疯緭閫佺嚎鏈夌墿", wrkMast.getWrkNo(), wrkMast.getSourceStaNo());
-                News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}鍙疯緭閫佺嚎鏈夌墿", wrkMast.getWrkNo(), wrkMast.getSourceStaNo());
-                return false;
+            WrkMast wrkMast1 = wrkMastService.selectByWorkNo(wrkMast.getMainWrkNo());
+            if (wrkMast1 != null) {
+                if (!mainService.isOutEnable(devpThread, wrkMast1.getStaNo())) {
+                    News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}鍙疯緭閫佺嚎涓嶅彲鍑�111", wrkMast.getWrkNo(), wrkMast1.getStaNo());
+                    return false;
+                }
+                StaProtocol staProtocol = devpThread.getStation().get(wrkMast1.getStaNo() + 2);
+                if (staProtocol.isLoading()) {
+                    News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}鍙疯緭閫佺嚎鏈夌墿111", wrkMast.getWrkNo(), wrkMast1.getStaNo() + 1);
+                    return false;
+                }
             }
 
             if (shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) {
@@ -397,42 +397,32 @@
             //鑾峰彇鍥涘悜绌挎杞︾嚎绋�
             ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, wrkMast.getShuttleNo());
             if (shuttleThread == null) {
-                News.info("{}浠诲姟锛寋}鍙峰皬杞︼紝灏忚溅绾跨▼涓嶅瓨鍦紝绂佹娲惧彂", wrkMast.getWrkNo(), wrkMast.getLiftNo());
+                News.info("{}浠诲姟锛寋}鍙峰皬杞︼紝灏忚溅绾跨▼涓嶅瓨鍦紝绂佹娲惧彂", wrkMast.getWrkNo(), wrkMast.getShuttleNo());
                 return false;
             }
 
             ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
             if (shuttleProtocol == null) {
-                News.info("{}浠诲姟锛寋}鍙峰皬杞︼紝灏忚溅瀵硅薄涓嶅瓨鍦紝绂佹娲惧彂", wrkMast.getWrkNo(), wrkMast.getLiftNo());
+                News.info("{}浠诲姟锛寋}鍙峰皬杞︼紝灏忚溅瀵硅薄涓嶅瓨鍦紝绂佹娲惧彂", wrkMast.getWrkNo(), wrkMast.getShuttleNo());
                 return false;
             }
 
-            if (wrkMast.getLiftNo() == null) {
-                News.info("{}浠诲姟锛屾湭缁戝畾鎻愬崌鏈猴紝绂佹娲惧彂", wrkMast.getWrkNo());
-                return false;
-            }
-
-            LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, wrkMast.getLiftNo());
-            if (liftThread == null) {
-                News.info("{}鍙锋彁鍗囨満涓嶅瓨鍦�", wrkMast.getLiftNo());
-                return false;
-            }
-
+            LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, 1);
             LiftProtocol liftProtocol = liftThread.getStatus();
             if (liftProtocol == null) {
-                News.info("{}鍙锋彁鍗囨満瀵硅薄涓嶅瓨鍦�", wrkMast.getLiftNo());
+                News.info("{}鍙锋彁鍗囨満瀵硅薄涓嶅瓨鍦�", 1);
                 return false;
             }
 
             //鍒ゆ柇鎻愬崌鏈烘槸鍚︽湁鍏朵粬浠诲姟
             WrkMast liftWrkMast = wrkMastService.selectLiftWrkMastAndWrkNo(wrkMast.getLiftNo(), wrkMast.getWrkNo(), wrkMast.getMainWrkNo());
             if (liftWrkMast != null) {
-                News.info("{}浠诲姟锛寋}鍙锋彁鍗囨満锛屾彁鍗囨満瀛樺湪鏈畬鎴愪换鍔★紝绂佹娲惧彂", wrkMast.getWrkNo(), wrkMast.getLiftNo());
+                News.info("{}浠诲姟锛寋}鍙锋彁鍗囨満锛屾彁鍗囨満瀛樺湪鏈畬鎴愪换鍔★紝绂佹娲惧彂", wrkMast.getWrkNo(), 1);
                 return false;//褰撳墠鎻愬崌鏈哄瓨鍦ㄦ湭瀹屾垚浠诲姟锛岀瓑寰呬笅涓�娆¤疆璇�
             }
 
             if (!liftThread.isIdle()) {
-                News.info("{}浠诲姟锛寋}鍙锋彁鍗囨満锛屾彁鍗囨満蹇欑涓紝绂佹娲惧彂", wrkMast.getWrkNo(), wrkMast.getLiftNo());
+                News.info("{}浠诲姟锛寋}鍙锋彁鍗囨満锛屾彁鍗囨満蹇欑涓紝绂佹娲惧彂", wrkMast.getWrkNo(), 1);
                 return false;
             }
 
@@ -475,7 +465,7 @@
             assignCommand.setAuto(true);//鑷姩妯″紡
 
             //鑾峰彇灏忚溅鍒版彁鍗囨満琛岃蛋鍛戒护
-            List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), liftThread.getLiftLocNo(Utils.getLev(shuttleProtocol.getCurrentLocNo())), NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
+            List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), liftThread.getLiftLocNo(Utils.getLev(shuttleProtocol.getCurrentLocNo())), NavigationMapType.DFX.id, assignCommand, shuttleThread);
             if (commands == null) {
                 News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}灏忚溅锛岃矾寰勮绠楀け璐�", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo());
                 return false;
@@ -830,19 +820,17 @@
             if (devpThread == null) {
                 return false;
             }
-            int lev = Utils.getLev(wrkMast.getLocNo());
-            StaProtocol staProtocol2 = devpThread.getStation().get(lev == 1 ? 1014 : 1025);
-
-            if (!staProtocol2.isOutEnable()) {
-                log.error("{}浠诲姟锛寋}鍙疯緭閫佺嚎涓嶅彲鍑�", wrkMast.getWrkNo(), lev == 1 ? 1014 : 1025);
-                News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}鍙疯緭閫佺嚎涓嶅彲鍑�", wrkMast.getWrkNo(), lev == 1 ? 1014 : 1025);
-                return false;
-            }
-            StaProtocol staProtocol = devpThread.getStation().get(lev == 1 ? 1015 : 1026);
-            if (staProtocol.isLoading()) {
-                log.error("{}浠诲姟锛寋}鍙疯緭閫佺嚎鏈夌墿", wrkMast.getWrkNo(), wrkMast.getSourceStaNo());
-                News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}鍙疯緭閫佺嚎鏈夌墿", wrkMast.getWrkNo(), wrkMast.getSourceStaNo());
-                return false;
+            WrkMast wrkMast1 = wrkMastService.selectByWorkNo(wrkMast.getMainWrkNo());
+            if (wrkMast1 != null) {
+                if (!mainService.isOutEnable(devpThread, wrkMast1.getStaNo())) {
+                    News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}鍙疯緭閫佺嚎涓嶅彲鍑�222", wrkMast.getWrkNo(), wrkMast1.getStaNo());
+                    return false;
+                }
+                StaProtocol staProtocol = devpThread.getStation().get(wrkMast1.getStaNo() + 2);
+                if (staProtocol.isLoading()) {
+                    News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}鍙疯緭閫佺嚎鏈夌墿222", wrkMast.getWrkNo(), wrkMast1.getStaNo());
+                    return false;
+                }
             }
 
             if (shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) {

--
Gitblit v1.9.1