From 6daf900a09adcca981f620744bf89851654d88e0 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 05 八月 2025 09:58:08 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java b/src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java
index 1f3f4f2..721e5ee 100644
--- a/src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java
+++ b/src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java
@@ -56,6 +56,17 @@
                 List<TrafficControlDataModel> allTrafficControl = getAllTrafficControl();
                 //鏇存柊浜ょ淇℃伅
                 redisUtil.set(RedisKeyType.TRAFFIC_CONTROL_MAP.key, allTrafficControl);
+
+                for (TrafficControlDataModel dataModel : allTrafficControl) {
+                    Integer shuttleNo = dataModel.getShuttleNo();
+                    Integer taskNo = dataModel.getTaskNo();
+
+                    Object object1 = redisUtil.get(RedisKeyType.TRAFFIC_CONTROL_SUCCESS_APPLY.key + shuttleNo + "_" + taskNo);
+                    if(object1 == null) {
+                        redisUtil.set(RedisKeyType.TRAFFIC_CONTROL_SUCCESS_APPLY.key + shuttleNo + "_" + taskNo, 1, 60 * 60);
+                    }
+                }
+
                 Thread.sleep(200);
             }catch (Exception e){
                 e.printStackTrace();
@@ -165,7 +176,7 @@
                             //妫�娴嬮殰纰嶇墿杞�
                             boolean checkObstacle = shuttleOperaUtils.checkObstacle(shuttleProtocol.getCurrentLocNo(), new ArrayList<Integer>() {{
                                 add(shuttleNo);
-                            }});
+                            }}, totalNodeList);
                             pathIdleShuttleMap.remove(shuttleProtocol.getShuttleNo());
                         }
                     }else {
@@ -199,6 +210,7 @@
         operateTrafficControl(param);
 
         applyRecordsMap.remove(shuttleNo);
+        redisUtil.set(RedisKeyType.TRAFFIC_CONTROL_SUCCESS_APPLY.key + shuttleNo + "_" + taskNo, 1, 60 * 60);
         News.info("receipt traffic {},{}", shuttleNo, taskNo);
         return true;
     }
@@ -259,7 +271,7 @@
     }
 
     @Override
-    public synchronized boolean cancelTrafficControl(Integer shuttleNo, Integer taskNo) {
+    public boolean cancelTrafficControl(Integer shuttleNo, Integer taskNo) {
         TrafficControlDataModel dataModel = queryTrafficControl(shuttleNo, taskNo);
         if (dataModel == null) {
             return false;
@@ -273,7 +285,7 @@
     }
 
     @Override
-    public synchronized boolean forceCancelTrafficControl(Integer shuttleNo) {
+    public boolean forceCancelTrafficControl(Integer shuttleNo) {
         TrafficControlDataModel dataModel = queryTrafficControl(shuttleNo);
         if (dataModel == null) {
             return false;
@@ -381,6 +393,7 @@
         }
 
         trafficControlDataList.remove(idx);//鍙栨秷绠″埗
+        redisUtil.del(RedisKeyType.TRAFFIC_CONTROL_SUCCESS_APPLY.key + shuttleNo + "_" + taskNo);
         return true;
     }
 

--
Gitblit v1.9.1