From 3d53b8a757df0bc9dbc7307454f5c6302ddae216 Mon Sep 17 00:00:00 2001
From: ytfl <ytfl@qq.com>
Date: 星期二, 15 七月 2025 14:25:39 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 51 insertions(+), 6 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 d9339be..4a445a0 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -643,6 +643,10 @@
      */
     public synchronized void crnMove() {
         for (CrnSlave crn : slaveProperties.getCrn()) {
+            if (crn.getId() == 1) {
+                continue;
+            }
+
             // 鑾峰彇鍫嗗灈鏈轰俊鎭�
             CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId());
             CrnProtocol crnProtocol = crnThread.getCrnProtocol();
@@ -791,12 +795,14 @@
                     if (null == waitWrkMast) {
                         News.error(""+mark+" - 1"+" - 10"+" - {}搴撲綅寮傚父锛屾湭妫�绱㈠埌鐩稿簲宸ヤ綔妗o紒", shallowLocNo);
                     } else {
-                        waitWrkMast.setIoPri(15D);
-                        waitWrkMast.setModiTime(new Date());
-                        if (wrkMastMapper.updateById(waitWrkMast) == 0) {
-                            News.error(""+mark+" - 1"+" - 11"+" - 璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo());
+                        if (waitWrkMast.getWrkSts() != 14 && waitWrkMast.getIoType() > 100) {
+                            waitWrkMast.setIoPri(15D);
+                            waitWrkMast.setModiTime(new Date());
+                            if (wrkMastMapper.updateById(waitWrkMast) == 0) {
+                                News.error(""+mark+" - 1"+" - 11"+" - 璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo());
+                            }
+                            continue;
                         }
-                        continue;
                     }
 
                 } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) {
@@ -962,7 +968,7 @@
 
                     if (crnProtocol.getCrnNo() == 1) {
                         //鍒ゆ柇鍫嗗灈鏈哄拰褰撳墠浠诲姟鏄惁澶勪簬涓�涓贩閬�
-                        if (Utils.getLaneByLocNo(wrkMast.getLocNo()) != crnProtocol.getCrnLane()) {
+                        if (Utils.getLaneByLocNo(wrkMast.getSourceLocNo()) != crnProtocol.getCrnLane()) {
                             //鍒ゆ柇鍫嗗灈鏈烘墍鍦ㄥ贩閬撴槸鍚﹀瓨鍦ㄥ叾浠栦换鍔★紝濡傚瓨鍦ㄥ垯浼樺厛鎵ц
                             List<WrkMast> currentWrkMasts = wrkMastService.selectLaneWrkMast(crnProtocol.getCrnLane(), false);
                             if (!currentWrkMasts.isEmpty()) {
@@ -2206,13 +2212,16 @@
         ArrayList<Integer> list = new ArrayList<Integer>(){{add(2003);add(2002);}};
         for (Integer staNo : list) {
             Integer devpId = null;
+            Integer rgvStaNoDevpId = null;
             Integer rgvStaNo = null;
             if (staNo == 2003) {
                 devpId = 1;
                 rgvStaNo = 2002;
+                rgvStaNoDevpId = 2;
             }else {
                 devpId = 2;
                 rgvStaNo = 2003;
+                rgvStaNoDevpId = 1;
             }
 
             SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devpId);
@@ -2239,6 +2248,38 @@
                 }
 
                 if (wrkMast.getWrkSts() == 201) {
+                    continue;
+                }
+
+                SiemensDevpThread devpThread2 = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, rgvStaNoDevpId);
+                if (devpThread2 == null) {
+                    continue;
+                }
+                StaProtocol staProtocolRgvStaNo = devpThread2.getStation().get(rgvStaNo);
+                if (staProtocolRgvStaNo == null) {
+                    continue;
+                }
+
+                if (!staProtocolRgvStaNo.isAutoing()) {
+                    continue;
+                }
+
+                if (staProtocolRgvStaNo.isLoading()) {
+                    continue;
+                }
+
+                // 鑾峰彇RGV淇℃伅
+                RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, 1);
+                if (rgvThread == null) {
+                    continue;
+                }
+
+                RgvProtocol rgvProtocol = rgvThread.getRgvProtocol();
+                if (rgvProtocol == null) {
+                    continue;
+                }
+
+                if (rgvProtocol.statusType1 != RgvStatusType.IDLE && rgvProtocol.getTaskNo1() != 0) {
                     continue;
                 }
 
@@ -2293,6 +2334,10 @@
                     continue;
                 }
 
+                if (wrkMast.getWrkSts() != 201) {
+                    continue;
+                }
+
                 Integer devpId = null;
                 Integer devpStaNo = null;
                 String locNo = null;

--
Gitblit v1.9.1