From 2c1e3b7b10c0d4afbf09a9151e132f1ee85b9c6f Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期六, 02 八月 2025 11:15:25 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/impl/NyShuttleThread.java |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java b/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
index 19af9d7..e311708 100644
--- a/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
@@ -52,6 +52,7 @@
     private DeviceConfig deviceConfig;
     private RedisUtil redisUtil;
     private ShuttleProtocol shuttleProtocol;
+    private ShuttleAction shuttleAction = null;
 
     private static final boolean DEBUG = false;//璋冭瘯妯″紡
 
@@ -92,14 +93,11 @@
 //        Thread executeThread = new Thread(() -> {
 //            while (true) {
 //                try {
-//                    ShuttleAction shuttleAction = null;
-//                    try {
-//                        shuttleAction = SpringUtils.getBean(ShuttleAction.class);
-//                    }catch (Exception e){
-//                        continue;
-//                    }
-//
 //                    if (shuttleAction == null) {
+//                        try {
+//                            shuttleAction = SpringUtils.getBean(ShuttleAction.class);
+//                        }catch (Exception e){
+//                        }
 //                        continue;
 //                    }
 //
@@ -929,8 +927,11 @@
             return false;
         }
 
+        List<NavigationMapType> restartCalcMapTypes = new ArrayList<>(mapTypes);
+        restartCalcMapTypes.add(NavigationMapType.SHUTTLE);
+
         String currentLocNo = shuttleProtocol.getCurrentLocNo();
-        List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(currentLocNo, locNo, mapTypes, assignCommand, this);
+        List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(currentLocNo, locNo, restartCalcMapTypes, assignCommand, this);
         if (commands == null) {
             return false;
         }
@@ -1214,16 +1215,16 @@
 
     private JSONObject queryCommandStatus(String resultKey) {
         // 鑾峰彇鏈嶅姟鍣ㄥ搷搴�
-        // 灏濊瘯50娆�
         JSONObject result = null;
-        for (int i = 0; i < 50; i++) {
+        long startTime = System.currentTimeMillis();
+        while (true) {
+            if((System.currentTimeMillis() - startTime) > 1000 * 10) {
+                break;
+            }
+
             result = getRequestBody(resultKey);
             if (result == null) {
-                try {
-                    Thread.sleep(500);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
+                continue;
             }else {
                 break;
             }

--
Gitblit v1.9.1