From 21caf282f3d903a729d72b3398e0dbedab7f244d Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期日, 20 四月 2025 15:06:07 +0800
Subject: [PATCH] 999

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   45 +++++++++++++--------------------------------
 1 files changed, 13 insertions(+), 32 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index d8c52b0..0283968 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -40,6 +40,7 @@
 import com.zy.system.service.ConfigService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
@@ -98,6 +99,8 @@
     private LiftAction liftAction;
     @Autowired
     private BasWrkStatusService wrkStatusService;
+    @Value("${asrs.wmsUrl}")
+    private String wmsUrl;
 
 
     public boolean isInEnable(DevpThread devpThread, Integer staNo) {
@@ -199,7 +202,6 @@
                             continue;
                         }
                         try {
-                            String wmsUrl = "192.168.10.201:8080/fyxcwms";
                             SearchLocParam param = new SearchLocParam();
                             param.setBarcode(barcode);
                             param.setIoType(1);
@@ -278,7 +280,6 @@
                         WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_sta_no", inSta.getStaNo()).eq("barcode", barcode));
                         if (wrkMast == null) {
                             try {
-                                String wmsUrl = "192.168.10.201:8080/fyxcwms";
                                 SearchLocParam param = new SearchLocParam();
                                 param.setBarcode(barcode);
                                 param.setIoType(1);
@@ -351,7 +352,7 @@
                 if (wrkMast.getStaNo() == 1026) {
                     locNo = "1200305";
                 }
-                boolean dispatchShuttle = shuttleDispatchUtils.searchDispatchShuttleS(wrkMast.getWrkNo(), locNo, wrkMast.getLocNo(), "TRANSPORT_DEVP");
+                boolean dispatchShuttle = shuttleDispatchUtils.searchDispatchShuttleNoLift(wrkMast.getWrkNo(), locNo, wrkMast.getLocNo(), "TRANSPORT_DEVP");
                 if (!dispatchShuttle) {
                     News.info("{}浠诲姟锛岃皟搴﹀皬杞﹀け璐�", wrkMast.getWrkNo());
                     continue;
@@ -398,18 +399,10 @@
             if (wrkMast.getStaNo() == 1024) {
                 locNo = "1200305";
             }
-            boolean dispatchShuttle = shuttleDispatchUtils.searchDispatchShuttleS(wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), locNo, "TRANSPORT_DEVP");
+            boolean dispatchShuttle = shuttleDispatchUtils.searchDispatchShuttleNoLift(wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), locNo, "TRANSPORT_DEVP");
             if (!dispatchShuttle) {
                 News.info("{}浠诲姟锛岃皟搴﹀皬杞﹀け璐�", wrkMast.getWrkNo());
                 continue;
-            } else {
-                WrkMast wrkMast1 = wrkMastService.selectByMainWrkNo(wrkMast.getWrkNo());
-                if (wrkMast1 == null) {
-                    News.info("{}浠诲姟锛岃皟搴﹀皬杞﹀け璐�,缁堜簬鍙戠幇浜�", wrkMast.getWrkNo());
-                    continue;
-                } else {
-                    News.info("{}浠诲姟锛屾棤鎻愬崌鏈哄璋冨害灏忚溅鎴愬姛", wrkMast.getWrkNo());
-                }
             }
 
             wrkMast.setWrkSts(WrkStsType.OUTBOUND_SHUTTLE_RUN.sts);
@@ -882,7 +875,7 @@
             short staNo = 1012;
             if (wrkMast.getSourceStaNo() == 1022) {
                 staNo = 1023;
-            } else if (wrkMast.getSourceStaNo() == 1031 || wrkMast.getSourceStaNo() == 1032) {
+            } else if ( wrkMast.getSourceStaNo() == 1032) {
                 staNo = 1032;
             }
 
@@ -971,26 +964,14 @@
                     News.info("{}浠诲姟锛寋}绔欑偣锛屼换鍔″彿涓嶄竴鑷�", wrkMast.getWrkNo(), staProtocol.getSiteId());
                     return false;
                 }
-                if (!station.get(1022).getBarcode().equals(wrkMast.getBarcode())) {
-                    News.info("{}浠诲姟锛寋}绔欑偣锛屾墭鐩樼爜涓嶅尮閰嶏紝绔欑偣鎵樼洏鐮侊細{}锛屼换鍔℃墭鐩樼爜锛歿}", wrkMast.getWrkNo(), staProtocol.getSiteId(), staProtocol.getBarcode(), wrkMast.getBarcode());
-                    return false;
-                }
             } else if (sourceStaNo == 1012) {
                 if (staProtocol.getWorkNo().intValue() != wrkMast.getWrkNo()) {
                     News.info("{}浠诲姟锛寋}绔欑偣锛屼换鍔″彿涓嶄竴鑷�", wrkMast.getWrkNo(), staProtocol.getSiteId());
                     return false;
                 }
-                if (!staProtocol.getBarcode().equals(wrkMast.getBarcode())) {
-                    News.info("{}浠诲姟锛寋}绔欑偣锛屾墭鐩樼爜涓嶅尮閰嶏紝绔欑偣鎵樼洏鐮侊細{}锛屼换鍔℃墭鐩樼爜锛歿}", wrkMast.getWrkNo(), staProtocol.getSiteId(), staProtocol.getBarcode(), wrkMast.getBarcode());
-                    return false;
-                }
-            } else if (sourceStaNo == 1032 || sourceStaNo == 1031) {
+            } else if (sourceStaNo == 1032 ) {
                 if (staProtocol.getWorkNo().intValue() != wrkMast.getWrkNo()) {
                     News.info("{}浠诲姟锛寋}绔欑偣锛屼换鍔″彿涓嶄竴鑷�", wrkMast.getWrkNo(), staProtocol.getSiteId());
-                    return false;
-                }
-                if (!staProtocol.getBarcode().equals(wrkMast.getBarcode())) {
-                    News.info("{}浠诲姟锛寋}绔欑偣锛屾墭鐩樼爜涓嶅尮閰嶏紝绔欑偣鎵樼洏鐮侊細{}锛屼换鍔℃墭鐩樼爜锛歿}", wrkMast.getWrkNo(), staProtocol.getSiteId(), staProtocol.getBarcode(), wrkMast.getBarcode());
                     return false;
                 }
             }
@@ -998,7 +979,7 @@
             String locNo = "0200305";
             if (wrkMast.getSourceStaNo() == 1012) {
                 locNo = "0200301";
-            } else if (wrkMast.getSourceStaNo() == 1032 || wrkMast.getSourceStaNo() == 1031) {
+            } else if (wrkMast.getSourceStaNo() == 1032 ) {
                 locNo = "0200308";
             }
             boolean dispatchShuttle = shuttleDispatchUtils.searchDispatchShuttleS(wrkMast.getWrkNo(), locNo, wrkMast.getLocNo(), "TRANSPORT_LIFT");
@@ -1012,7 +993,7 @@
                 //TODO
                 // lev = 105;
                 lev = 1021;
-            } else if (wrkMast.getSourceStaNo() == 1032 || wrkMast.getSourceStaNo() == 1031) {
+            } else if ( wrkMast.getSourceStaNo() == 1031) {
                 lev = 1031;
             }
             //鑾峰彇鎻愬崌鏈哄懡浠�
@@ -1102,7 +1083,7 @@
 
     public synchronized void liftOutExecute() {
         try {
-            List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().in("wrk_sts", WrkStsType.NEW_OUTBOUND.sts, WrkStsType.OUTBOUND_SHUTTLE_RUN_COMPLETE.sts).in("sta_no", 1011, 1021));
+            List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().in("wrk_sts", WrkStsType.NEW_OUTBOUND.sts, WrkStsType.OUTBOUND_SHUTTLE_RUN_COMPLETE.sts).in("sta_no", 1011, 1021, 1031));
             for (WrkMast wrkMast : wrkMasts) {
                 boolean step1 = this.liftOutExecuteStep1(wrkMast);//瑙﹀彂鎼繍浠诲姟
                 if (!step1) {
@@ -1146,7 +1127,7 @@
             String locNo = "0200305";
             if (wrkMast.getStaNo() == 1011) {
                 locNo = "0200301";
-            } else if (wrkMast.getStaNo() == 1032) {
+            } else if (wrkMast.getStaNo() == 1031) {
                 locNo = "0200308";
             }
             boolean dispatchShuttle = shuttleDispatchUtils.searchDispatchShuttleS(wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), locNo, "TRANSPORT_LIFT");
@@ -2168,10 +2149,10 @@
         WrkMast mainWrk = wrkMastService.selectByWorkNo(wrkMast.getMainWrkNo());
         if (mainWrk != null && mainWrk.getIoType() == 1) {
             //鍏ュ簱
-            noLiftInService.shuttleMoveExecute(wrkMast, mainWrk.getStaNo());
+            noLiftInService.shuttleMoveExecute(wrkMast, mainWrk.getStaNo(), Utils.getLev(mainWrk.getLocNo()));
         } else if (mainWrk != null && mainWrk.getIoType() == 101) {
             //鍑哄簱
-            noLiftOutService.shuttleMoveExecute(wrkMast);
+            noLiftOutService.shuttleMoveExecute(wrkMast, mainWrk.getStaNo(), Utils.getLev(mainWrk.getSourceLocNo()));
         }
     }
 

--
Gitblit v1.9.1