From acb4d07da40454517a3b211d6dc92ac5bd4a65d3 Mon Sep 17 00:00:00 2001
From: cpT <1@123>
Date: 星期二, 24 六月 2025 20:26:45 +0800
Subject: [PATCH] #改造

---
 src/main/java/com/zy/core/model/RgvSlave.java               |    6 +++
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   40 +++++++++++++++++---
 src/main/resources/application-prod.yml                     |   65 ++++++++++++++++++++++++++++++++
 3 files changed, 105 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 5881a59..5653854 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -979,8 +979,11 @@
                     }
 
                     // 鍒ゆ柇鍫嗗灈鏈哄嚭搴撶珯鐘舵��
-                    if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")
-                            && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
+                    if (staProtocol.isAutoing() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")) {
+
+//                    // 鍒ゆ柇鍫嗗灈鏈哄嚭搴撶珯鐘舵��
+//                    if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")
+//                            && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
                         // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
 
                         // 鍫嗗灈鏈烘帶鍒惰繃婊�
@@ -1568,9 +1571,15 @@
         }
         if (rgvProtocolOther.statusEnable) {
             BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", staNo));
-            if (Math.abs(basDevpPosition.getPlcPosition()-rgvProtocol.getRgvPos())
+            long abs = Math.abs(Math.abs(basDevpPosition.getPlcPosition() - rgvProtocol.getRgvPos())
+                    -
+                    Math.abs(basDevpPosition.getPlcPosition() - rgvProtocolOther.getRgvPos()));
+            if (abs<100){
+                return true;
+            }
+            if (Math.abs(basDevpPosition.getPlcPosition() - rgvProtocol.getRgvPos())
                     >=
-                    Math.abs(basDevpPosition.getPlcPosition()-rgvProtocolOther.getRgvPos())){
+                    Math.abs(basDevpPosition.getPlcPosition() - rgvProtocolOther.getRgvPos())){
                 return false;
             }
         }
@@ -1594,6 +1603,12 @@
         }
         if (rgvProtocolOther.statusEnable) {
             BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", staNo));
+            long abs = Math.abs(Math.abs(basDevpPosition.getPlcPosition() - rgvProtocol.getRgvPos())
+                    -
+                    Math.abs(basDevpPosition.getPlcPosition() - rgvProtocolOther.getRgvPos()));
+            if (abs<100){
+                return true;
+            }
             if (Math.abs(basDevpPosition.getPlcPosition()-rgvProtocol.getRgvPos())
                     >=
                     Math.abs(basDevpPosition.getPlcPosition()-rgvProtocolOther.getRgvPos())){
@@ -1618,7 +1633,6 @@
             TaskWrk taskWrk = taskWrkService.selectByWrkNo(staProtocol.getWorkNo());
             if (taskWrk != null) {
                 Integer stano = staProtocol.getStaNo();
-
                 if (staProtocol.getSiteId() == 1004 || staProtocol.getSiteId()==1020){
 
                     // 灏哄妫�娴嬪紓甯�
@@ -1682,6 +1696,21 @@
                     }
                 }
                 return taskWrk;
+            }
+        } else if (staProtocol.isAutoing() && staProtocol.getWorkNo() == 0 && !staProtocol.isLoading()){
+            if (inSta.isDirectionOther()){
+                StaProtocol staProtocolOther = devpThread.getStation().get(inSta.getStaNoOther());
+                if (staProtocolOther == null) {
+                    return null;
+                }
+                // 鍒ゆ柇鏄惁婊¤冻鍙栬揣鏉′欢
+                if (staProtocolOther.isAutoing()
+                        && staProtocolOther.getWorkNo() != 0) {
+                    TaskWrk taskWrkOther = taskWrkService.selectByWrkNo(staProtocolOther.getWorkNo());
+                    if (taskWrkOther != null) {
+                        return taskWrkOther;
+                    }
+                }
             }
         }
         return null;
@@ -1828,7 +1857,6 @@
                             if (rgvOtherIDLEOther2(rgvSlave)){
                                 if (!rgvOtherIDLE2(rgvSlave,staList.get(0))){
                                     System.out.println("杩愯灏辫繎璺宠繃==="+rgvSlave.getId()+"===");
-
                                     sign=true;
                                 }
                             }
diff --git a/src/main/java/com/zy/core/model/RgvSlave.java b/src/main/java/com/zy/core/model/RgvSlave.java
index d44a06c..39ed85a 100644
--- a/src/main/java/com/zy/core/model/RgvSlave.java
+++ b/src/main/java/com/zy/core/model/RgvSlave.java
@@ -45,6 +45,12 @@
         // RGV绔欑偣缂栧彿
         private boolean direction;
 
+        // RGV绔欑偣缂栧彿
+        private Integer staNoOther;
+
+        // RGV绔欑偣缂栧彿
+        private boolean directionOther;
+
 //        // 鎺�
 //        private Integer row;
 //
diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml
index bf48877..af45d92 100644
--- a/src/main/resources/application-prod.yml
+++ b/src/main/resources/application-prod.yml
@@ -101,76 +101,109 @@
     rgvInSta[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1004
+      #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: true
+      staNoOther: 1005
+      directionOther: false
     rgvInSta[1]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1014
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: true
+      staNoOther: 1016
+      directionOther: true
     rgvInSta[2]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1020
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: true
+      staNoOther: 1021
+      directionOther: false
     rgvInSta[3]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1003
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1003
+      directionOther: false
     rgvInSta[4]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1007
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1007
+      directionOther: false
     rgvInSta[5]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1013
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1013
+      directionOther: false
     rgvInSta[6]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1018
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1018
+      directionOther: false
     rgvInSta[7]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1019
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1019
+      directionOther: false
     #RGV鐩爣绔欑偣
     rgvOutSta[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1002
       direction: true
+      staNoOther: 1002
+      directionOther: false
     rgvOutSta[1]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1009
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: true
+      staNoOther: 1009
+      directionOther: false
     rgvOutSta[2]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1001
       direction: false
+      staNoOther: 1001
+      directionOther: false
     rgvOutSta[3]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1006
       direction: false
+      staNoOther: 1006
+      directionOther: false
     rgvOutSta[4]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1008
       direction: false
+      staNoOther: 1008
+      directionOther: false
     rgvOutSta[5]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1017
       direction: false
+      staNoOther: 1017
+      directionOther: false
     rgvSuperSta[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1001
       direction: false
+      staNoOther: 1001
+      directionOther: false
     rgvSuperSta[1]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1002
       direction: false
+      staNoOther: 1002
+      directionOther: false
   # RGV绌挎杞�2
   rgv[0]:
     id: 1
@@ -186,75 +219,107 @@
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1004
       direction: true
+      staNoOther: 1005
+      directionOther: false
     rgvInSta[1]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1014
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: true
+      staNoOther: 1016
+      directionOther: true
     rgvInSta[2]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1020
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: true
+      staNoOther: 1021
+      directionOther: false
     rgvInSta[3]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1003
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1003
+      directionOther: false
     rgvInSta[4]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1007
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1007
+      directionOther: false
     rgvInSta[5]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1013
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1013
+      directionOther: false
     rgvInSta[6]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1018
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1018
+      directionOther: false
     rgvInSta[7]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1019
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: false
+      staNoOther: 1019
+      directionOther: false
     #RGV鐩爣绔欑偣
     rgvOutSta[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1023
       direction: true
+      staNoOther: 1023
+      directionOther: false
     rgvOutSta[1]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1009
       #鎵ц鏂瑰悜锛堥潰鏈濊建閬� 瀹氫綅鍊煎乏灏忓彸澶э級  true:宸�   false:鍙�
       direction: true
+      staNoOther: 1009
+      directionOther: false
     rgvOutSta[2]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1022
       direction: false
+      staNoOther: 1022
+      directionOther: false
     rgvOutSta[3]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1006
       direction: false
+      staNoOther: 1006
+      directionOther: false
     rgvOutSta[4]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1008
       direction: false
+      staNoOther: 1008
+      directionOther: false
     rgvOutSta[5]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1017
       direction: false
+      staNoOther: 1017
+      directionOther: false
     rgvSuperSta[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1023
       direction: false
+      staNoOther: 1023
+      directionOther: false
     rgvSuperSta[1]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 1022
       direction: false
+      staNoOther: 1022
+      directionOther: false
 
   barcode[0]: #鏉$爜鎵弿浠�1004
     port: 51236

--
Gitblit v1.9.1