From 58b2e9a664d9395654cd3865f01043e3cfc2f1dd Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期五, 06 二月 2026 15:11:53 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java |   53 ++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java b/src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
index d7965f9..c81bf43 100644
--- a/src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
+++ b/src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
@@ -105,45 +105,60 @@
                 // 濡傛灉鏈�杩戜竴娆℃槸鍏ュ簱妯″紡
                 if (crnProtocol.getLastIo().equals("I")) {
                     if (basCrnp.getInEnable().equals("Y")) {
-                        this.crnExecuteIn(basCrnp, crnThread); //  鍏ュ簱
+                        boolean result = this.crnExecuteIn(basCrnp, crnThread);//  鍏ュ簱
                         crnProtocol.setLastIo("O");
+                        if (result) {
+                            break;
+                        }
                     } else if (basCrnp.getOutEnable().equals("Y")) {
-                        this.crnExecuteOut(basCrnp, crnThread); //  鍑哄簱
+                        boolean result = this.crnExecuteOut(basCrnp, crnThread);//  鍑哄簱
                         crnProtocol.setLastIo("I");
+                        if (result) {
+                            break;
+                        }
                     }
                 }
                 // 濡傛灉鏈�杩戜竴娆℃槸鍑哄簱妯″紡
                 else if (crnProtocol.getLastIo().equals("O")) {
                     if (basCrnp.getOutEnable().equals("Y")) {
-                        this.crnExecuteOut(basCrnp, crnThread); //  鍑哄簱
+                        boolean result = this.crnExecuteOut(basCrnp, crnThread);//  鍑哄簱
                         crnProtocol.setLastIo("I");
+                        if (result) {
+                            break;
+                        }
                     } else if (basCrnp.getInEnable().equals("Y")) {
-                        this.crnExecuteIn(basCrnp, crnThread); //  鍏ュ簱
+                        boolean result = this.crnExecuteIn(basCrnp, crnThread);//  鍏ュ簱
                         crnProtocol.setLastIo("O");
+                        if (result) {
+                            break;
+                        }
                     }
                 }
 
                 //搴撲綅绉昏浆
-                this.crnExecuteLocTransfer(basCrnp, crnThread);
+                boolean transfer = this.crnExecuteLocTransfer(basCrnp, crnThread);
+                if (transfer) {
+                    break;
+                }
             }
         }
     }
 
-    private synchronized void crnExecuteIn(BasCrnp basCrnp, CrnThread crnThread) {
+    private synchronized boolean crnExecuteIn(BasCrnp basCrnp, CrnThread crnThread) {
         CrnProtocol crnProtocol = crnThread.getStatus();
         if(crnProtocol == null){
-            return;
+            return false;
         }
 
         if(!basCrnp.getInEnable().equals("Y")){
             News.info("鍫嗗灈鏈�:{} 鍙叆淇″彿涓嶆弧瓒�", basCrnp.getCrnNo());
-            return;
+            return false;
         }
 
         List<StationObjModel> inStationList = basCrnp.getInStationList$();
         if(inStationList.isEmpty()){
             News.info("鍫嗗灈鏈�:{} 鍏ュ簱绔欑偣鏈缃�", basCrnp.getCrnNo());
-            return;
+            return false;
         }
 
         Integer crnNo = basCrnp.getCrnNo();
@@ -219,25 +234,27 @@
                 MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command));
                 notifyUtils.notify(String.valueOf(SlaveType.Crn), crnNo, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_IN_TASK_RUN, null);
                 News.info("鍫嗗灈鏈哄懡浠や笅鍙戞垚鍔燂紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", crnNo, JSON.toJSON(command));
+                return true;
             }
         }
+        return false;
     }
 
-    private synchronized void crnExecuteOut(BasCrnp basCrnp, CrnThread crnThread) {
+    private synchronized boolean crnExecuteOut(BasCrnp basCrnp, CrnThread crnThread) {
         CrnProtocol crnProtocol = crnThread.getStatus();
         if(crnProtocol == null){
-            return;
+            return false;
         }
 
         if(!basCrnp.getOutEnable().equals("Y")){
             News.info("鍫嗗灈鏈�:{} 鍙嚭淇″彿涓嶆弧瓒�", basCrnp.getCrnNo());
-            return;
+            return false;
         }
 
         List<StationObjModel> outStationList = basCrnp.getOutStationList$();
         if(outStationList.isEmpty()){
             News.info("鍫嗗灈鏈�:{} 鍑哄簱绔欑偣鏈缃�", basCrnp.getCrnNo());
-            return;
+            return false;
         }
 
         Integer crnNo = basCrnp.getCrnNo();
@@ -308,10 +325,11 @@
                     MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command));
                     notifyUtils.notify(String.valueOf(SlaveType.Crn), crnNo, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_OUT_TASK_RUN, null);
                     News.info("鍫嗗灈鏈哄懡浠や笅鍙戞垚鍔燂紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", crnNo, JSON.toJSON(command));
-                    return;
+                    return true;
                 }
             }
         }
+        return false;
     }
 
     private synchronized boolean crnExecuteInPlanner(BasCrnp basCrnp, CrnThread crnThread, WrkMast wrkMast) {
@@ -492,10 +510,10 @@
         return false;
     }
 
-    private synchronized void crnExecuteLocTransfer(BasCrnp basCrnp, CrnThread crnThread) {
+    private synchronized boolean crnExecuteLocTransfer(BasCrnp basCrnp, CrnThread crnThread) {
         CrnProtocol crnProtocol = crnThread.getStatus();
         if(crnProtocol == null){
-            return;
+            return false;
         }
 
         Integer crnNo = basCrnp.getCrnNo();
@@ -540,9 +558,10 @@
                 MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command));
                 notifyUtils.notify(String.valueOf(SlaveType.Crn), crnNo, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_TRANSFER_TASK_RUN, null);
                 News.info("鍫嗗灈鏈哄懡浠や笅鍙戞垚鍔燂紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", crnNo, JSON.toJSON(command));
-                return;
+                return true;
             }
         }
+        return false;
     }
 
     //鍫嗗灈鏈轰换鍔℃墽琛屽畬鎴�

--
Gitblit v1.9.1