From b0aca4f6dc0d314c6ef336d915740e017b6fccee Mon Sep 17 00:00:00 2001
From: zc <zc@123>
Date: 星期一, 05 五月 2025 16:09:39 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   93 +++++++++++++++++++++++++++++++++++-----------
 1 files changed, 70 insertions(+), 23 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 4df0f9f..9215770 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -36,13 +36,11 @@
 import com.zy.core.thread.impl.FyDevpThread;
 import com.zy.core.thread.impl.NormalLedThread;
 import com.zy.system.service.ConfigService;
-import io.swagger.models.auth.In;
 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.io.IOException;
 import java.util.*;
 
 /**
@@ -182,15 +180,27 @@
                     LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                     String errMsg = "";
                     if (!back && staProtocol.isBackErr()) {
-                        errMsg = "瓒呴暱寮傚父";
+                        errMsg = "鍚庤秴闄�";
                         back = true;
                     }
                     if (!back && staProtocol.isHighErr()) {
                         errMsg = "瓒呴珮寮傚父";
                         back = true;
                     }
+                    if (!back && staProtocol.isWeightErr()) {
+                        errMsg = "瓒呴噸寮傚父";
+                        back = true;
+                    }
                     if (!back && staProtocol.isRightErr()) {
-                        errMsg = "瓒呭寮傚父";
+                        errMsg = "鍙宠秴闄�";
+                        back = true;
+                    }
+                    if (!back && staProtocol.isLeftErr()) {
+                        errMsg = "宸﹁秴闄�";
+                        back = true;
+                    }
+                    if (!back && staProtocol.isBarcodeErr()) {
+                        errMsg = "鎵爜寮傚父";
                         back = true;
                     }
                     // 閫�鍥�
@@ -279,6 +289,9 @@
                                         .setJson(JSON.toJSONString(hashMap))
                                         .build()
                                         .doPost();
+//                                if (!Cools.isEmpty(msg)&&"璇峰厛缁勬墭".equalsIgnoreCase(msg)){
+//                                    ledThread.error(msg);
+//                                }
                                 News.error("鍏ュ簱鐢宠澶辫触锛屼换鍔℃暟鎹�={}锛岃姹傚搷搴�={}", JSON.toJSON(param), JSON.toJSON(jsonObject));
                             }
                         } catch (Exception e) {
@@ -298,19 +311,27 @@
                     String errMsg = "";
                     boolean back = false;
                     if (!back && staProtocol.isBackErr()) {
-                        errMsg = "瓒呭寮傚父";
+                        errMsg = "鍚庤秴闄�";
                         back = true;
                     }
                     if (!back && staProtocol.isHighErr()) {
                         errMsg = "瓒呴珮寮傚父";
                         back = true;
                     }
-                    if (!back && staProtocol.isRightErr()) {
-                        errMsg = "瓒呴暱寮傚父";
+                    if (!back && staProtocol.isWeightErr()) {
+                        errMsg = "瓒呴噸寮傚父";
                         back = true;
                     }
-                    if (!back && staProtocol.isWeightErr()) {
-                        errMsg = "瓒呴噸";
+                    if (!back && staProtocol.isRightErr()) {
+                        errMsg = "鍙宠秴闄�";
+                        back = true;
+                    }
+                    if (!back && staProtocol.isLeftErr()) {
+                        errMsg = "宸﹁秴闄�";
+                        back = true;
+                    }
+                    if (!back && staProtocol.isBarcodeErr()) {
+                        errMsg = "鎵爜寮傚父";
                         back = true;
                     }
                     // 閫�鍥�
@@ -355,6 +376,9 @@
                                             .setJson(JSON.toJSONString(hashMap))
                                             .build()
                                             .doPost();
+//                                    if (!Cools.isEmpty(msg)&&"璇峰厛缁勬墭".equalsIgnoreCase(msg)){
+//                                        ledThread.error(msg);
+//                                    }
                                     News.error("鍏ュ簱鐢宠澶辫触锛屼换鍔℃暟鎹�={}锛岃姹傚搷搴�={}", JSON.toJSON(param), JSON.toJSON(jsonObject));
                                 }
                             } catch (Exception e) {
@@ -460,13 +484,22 @@
             if (staProtocol == null) {
                 continue;
             }
-
+            List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<WrkMast>().in("wrk_sts", WrkStsType.OUTBOUND_SHUTTLE_RUN.sts, WrkStsType.OUTBOUND_SHUTTLE_RUN_COMPLETE.sts).in("sta_no", 1013, 1024));
+            if (wrkMastList != null && wrkMastList.size() >= 2) {
+                News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛岃烦杩囷紝瀛樺湪2鏉″伐浣滄。", wrkMast.getWrkNo());
+                continue;
+            }
             if (!staProtocol.isAutoing()) {
-                News.info("{}浠诲姟锛寋}绔欑偣锛屼笉鍦ㄨ嚜鍔ㄧ姸鎬�", wrkMast.getWrkNo(), staProtocol.getSiteId());
+                News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}绔欑偣锛屼笉鍦ㄨ嚜鍔ㄧ姸鎬�", wrkMast.getWrkNo(), staProtocol.getSiteId());
                 continue;
             }
             if (!isOutEnable(devpThread, wrkMast.getStaNo())) {
-                News.info("{}浠诲姟锛寋}绔欑偣锛屾病鏈夊彲鍑轰俊鍙�", wrkMast.getWrkNo(), staProtocol.getSiteId());
+                News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}绔欑偣锛屾病鏈夊彲鍑轰俊鍙�", wrkMast.getWrkNo(), staProtocol.getSiteId());
+                continue;
+            }
+            StaProtocol staProtocol2 = station.get(wrkMast.getStaNo() + 2);
+            if (staProtocol2.isLoading()) {
+                News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛寋}鍙疯緭閫佺嚎鏈夌墿222", wrkMast.getWrkNo(), wrkMast.getStaNo() + 2);
                 continue;
             }
             String locNo = "1200301";
@@ -476,7 +509,7 @@
 
             boolean dispatchShuttle = shuttleDispatchUtils.searchDispatchShuttleNoLift(wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), locNo, "TRANSPORT_DEVP");
             if (!dispatchShuttle) {
-                News.info("{}浠诲姟锛岃皟搴﹀皬杞﹀け璐�", wrkMast.getWrkNo());
+                News.taskInfo(wrkMast.getWrkNo(), "{}浠诲姟锛岃皟搴﹀皬杞﹀け璐�", wrkMast.getWrkNo());
                 continue;
             }
             WrkMast wrkMast2 = wrkMastService.selectByMainWrkNo(wrkMast.getWrkNo());
@@ -926,17 +959,17 @@
             for (WrkMast wrkMast : wrkMasts) {
                 boolean step0 = this.liftInExecuteStep0(wrkMast);//璁惧涓婅蛋
                 if (!step0) {
-                    return;
+                    continue;
                 }
 
                 boolean step1 = this.liftInExecuteStep1(wrkMast);//鎻愬崌鏈烘惉杩�
                 if (!step1) {
-                    return;
+                    continue;
                 }
 
                 boolean step2 = this.liftInExecuteStep2(wrkMast);//瑙﹀彂鎼繍浠诲姟
                 if (!step2) {
-                    return;
+                    continue;
                 }
             }
         } catch (Exception e) {
@@ -967,19 +1000,27 @@
             LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led);
             String errMsg = "";
             if (!back && staProtocol.isBackErr()) {
-                errMsg = "瓒呴暱寮傚父";
+                errMsg = "鍚庤秴闄�";
                 back = true;
             }
             if (!back && staProtocol.isHighErr()) {
                 errMsg = "瓒呴珮寮傚父";
                 back = true;
             }
-            if (!back && staProtocol.isRightErr()) {
-                errMsg = "瓒呭寮傚父";
+            if (!back && staProtocol.isWeightErr()) {
+                errMsg = "瓒呴噸寮傚父";
                 back = true;
             }
-            if (!back && staProtocol.isWeightErr()) {
-                errMsg = "瓒呴噸";
+            if (!back && staProtocol.isRightErr()) {
+                errMsg = "鍙宠秴闄�";
+                back = true;
+            }
+            if (!back && staProtocol.isLeftErr()) {
+                errMsg = "宸﹁秴闄�";
+                back = true;
+            }
+            if (!back && staProtocol.isBarcodeErr()) {
+                errMsg = "鎵爜寮傚父";
                 back = true;
             }
             // 閫�鍥�
@@ -1236,12 +1277,12 @@
             for (WrkMast wrkMast : wrkMasts) {
                 boolean step1 = this.liftOutExecuteStep1(wrkMast);//瑙﹀彂鎼繍浠诲姟
                 if (!step1) {
-                    return;
+                    continue;
                 }
 
                 boolean step2 = this.liftOutExecuteStep2(wrkMast);//鎻愬崌鏈烘惉杩�
                 if (!step2) {
-                    return;
+                    continue;
                 }
             }
         } catch (Exception e) {
@@ -1437,6 +1478,7 @@
                                 continue;//灏忚溅鏈埌杈剧洰鏍囧眰
                             }
                             wrkMast.setWrkSts(WrkStsType.MOVE_OUT_LIFT_COMPLETE.sts);
+                            wrkMast.setLiftNo(null);
                             shuttleThread.setSyncTaskNo(0);
                         } else if (wrkMast.getWrkSts() == WrkStsType.MOVE_SHUTTLE.sts) {
                             //310.灏忚溅绉诲姩涓� ==> 311.灏忚溅绉诲姩瀹屾垚
@@ -1501,6 +1543,11 @@
                             notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_POWER_COMPLETE);//瑙﹀彂閫氱煡
                         } else if (wrkMast.getWrkSts() == WrkStsType.MOVE_OUT_NO_LIFT_12.sts) {
                             wrkMast.setWrkSts(WrkStsType.MOVE_OUT_NO_LIFT_13.sts);
+                            WrkMast wrkMast1 = wrkMastService.selectByWorkNo(wrkMast.getMainWrkNo());
+                            if (wrkMast1 != null) {
+                                wrkMast1.setShuttleNo(wrkMast.getShuttleNo());
+                                log.info("瀵逛富宸ヤ綔妗h繘琛岀粦瀹氬皬杞︼紝涓轰簡灏忚溅杩涜绉昏溅,{},{}", wrkMast1.getWrkNo(), wrkMast.getShuttleNo());
+                            }
                             shuttleThread.setSyncTaskNo(0);
                             notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_POWER_COMPLETE);//瑙﹀彂閫氱煡
                         } else if (wrkMast.getWrkSts() == WrkStsType.MOVE_OUT_NO_LIFT_10.sts) {

--
Gitblit v1.9.1