From 209626ba2b4797f7d1c003a2876026ffcd39928a Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期五, 24 十月 2025 16:56:35 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/core/thread/RgvThread.java |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/RgvThread.java b/src/main/java/com/zy/core/thread/RgvThread.java
index bc3d44d..ce27b3f 100644
--- a/src/main/java/com/zy/core/thread/RgvThread.java
+++ b/src/main/java/com/zy/core/thread/RgvThread.java
@@ -5,11 +5,14 @@
 import HslCommunication.Profinet.Siemens.SiemensPLCS;
 import HslCommunication.Profinet.Siemens.SiemensS7Net;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.core.common.DateUtils;
 import com.core.common.SpringUtils;
+import com.zy.asrs.entity.BasCircularShuttle;
 import com.zy.asrs.entity.BasRgv;
 import com.zy.asrs.entity.BasRgvErrLog;
 import com.zy.asrs.entity.BasRgvOpt;
+import com.zy.asrs.service.BasCircularShuttleService;
 import com.zy.asrs.service.BasRgvErrLogService;
 import com.zy.asrs.service.BasRgvOptService;
 import com.zy.asrs.service.BasRgvService;
@@ -63,14 +66,6 @@
     @SuppressWarnings("InfiniteLoopStatement")
     public void run() {
         connectRgv = this.connect();
-        while(!connectRgv){
-            try {
-                connectRgv = this.connect();
-                Thread.sleep(100);
-            } catch (Exception e){
-
-            }
-        }
 
         // 鍚姩绾跨▼鑷姩閲嶈繛
         new Thread(this::rgvConnect).start();
@@ -159,6 +154,16 @@
                 Thread.sleep(1000);
                 if(!connectRgv){
                     try {
+                        // 鏍规嵁瀹炴椂淇℃伅鏇存柊鏁版嵁搴�
+                        BasCircularShuttleService basCircularShuttleService = SpringUtils.getBean(BasCircularShuttleService.class);
+                        BasCircularShuttle basCircularShuttle = basCircularShuttleService.selectOne(new EntityWrapper<BasCircularShuttle>().eq("rgv_no",  slave.getId()));
+                        if (basCircularShuttle.getStatus() != 0){
+                            continue;
+                        }
+                    } catch (Exception ignore) {
+
+                    }
+                    try {
                         connectRgv = this.connect();
                         Thread.sleep(100);
                     } catch (Exception e){

--
Gitblit v1.9.1