From f2631e786cc1c939e0a0698eadee76fd3d9a1fa9 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期五, 10 一月 2025 16:39:41 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/constants.js                                                       |    2 +-
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/TrafficService.java       |    4 ++--
 zy-acs-manager/src/main/java/com/zy/acs/manager/fake/AgvSimulatorTask.java             |    7 ++++++-
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MapDataWsScheduler.java |    2 +-
 zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java                |    4 ++++
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java  |    4 +++-
 version/db/sqlIndex                                                                    |    2 ++
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/PatrolService.java        |   26 +++++++++++++-------------
 8 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/version/db/sqlIndex b/version/db/sqlIndex
index f77521b..02c890b 100644
--- a/version/db/sqlIndex
+++ b/version/db/sqlIndex
@@ -7,6 +7,8 @@
 CREATE INDEX idx_action_sts_uuid ON man_action_sts(uuid);
 # man_action_type
 CREATE INDEX idx_action_type_uuid ON man_action_type(uuid);
+# man_travel
+CREATE INDEX idx_agv_id_state on man_travel(agv_id, state);
 # man_agv_model
 CREATE INDEX idx_agv_model_type ON man_agv_model(type);
 # man_bus_sts
diff --git a/zy-acs-flow/src/map/constants.js b/zy-acs-flow/src/map/constants.js
index 8ab6ce1..8088dcf 100644
--- a/zy-acs-flow/src/map/constants.js
+++ b/zy-acs-flow/src/map/constants.js
@@ -1,5 +1,5 @@
 
-export const ANIMATE_DURING_TIME = 600;
+export const ANIMATE_DURING_TIME = 200;
 
 export const MAP_DEFAULT_ROTATION = 270;
 
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MapDataWsScheduler.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MapDataWsScheduler.java
index 560bc73..2fbdeb4 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MapDataWsScheduler.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MapDataWsScheduler.java
@@ -35,7 +35,7 @@
 @Component
 public class MapDataWsScheduler {
 
-    public static final int WEBSOCKET_BROADCAST_INTERVAL = 600;
+    public static final int WEBSOCKET_BROADCAST_INTERVAL = 200;
 
     private ExecutorService singleThreadExecutor;
 
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java
index 927e1a9..08e7042 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java
@@ -116,7 +116,9 @@
 
             stopWatch.stop();
             if (stopWatch.getTime() > 0) {
-                log.info("婊ゆ尝鍑芥暟鑺辫垂鏃堕棿涓猴細{}姣......", stopWatch.getTime());
+                if (stopWatch.getTime() > 50) {
+                    log.info("婊ゆ尝鍑芥暟鑺辫垂鏃堕棿涓猴細{}姣......", stopWatch.getTime());
+                }
             }
         }
     }
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/PatrolService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/PatrolService.java
index bbc1028..b217b39 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/PatrolService.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/PatrolService.java
@@ -3,17 +3,12 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.zy.acs.common.utils.RedisSupport;
 import com.zy.acs.framework.common.R;
-import com.zy.acs.manager.manager.entity.Agv;
-import com.zy.acs.manager.manager.entity.AgvDetail;
-import com.zy.acs.manager.manager.entity.Code;
-import com.zy.acs.manager.manager.entity.Task;
+import com.zy.acs.manager.manager.entity.*;
 import com.zy.acs.manager.manager.enums.StatusType;
 import com.zy.acs.manager.manager.enums.TaskStsType;
 import com.zy.acs.manager.manager.enums.TaskTypeType;
-import com.zy.acs.manager.manager.service.AgvDetailService;
-import com.zy.acs.manager.manager.service.AgvService;
-import com.zy.acs.manager.manager.service.CodeService;
-import com.zy.acs.manager.manager.service.TaskService;
+import com.zy.acs.manager.manager.enums.TravelStateType;
+import com.zy.acs.manager.manager.service.*;
 import com.zy.acs.manager.system.service.ConfigService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -55,7 +50,7 @@
     @Autowired
     private MapService mapService;
     @Autowired
-    private LaneService laneService;
+    private TravelService travelService;
     @Autowired
     private AllocateService allocateService;
     @Autowired
@@ -68,12 +63,17 @@
     private void patrolOfMove(String agvNo) {
         Long agvId = agvService.getAgvId(agvNo);
         AgvDetail agvDetail = agvDetailService.selectMajorByAgvId(agvId);
-        if (taskService.count(new LambdaQueryWrapper<Task>()
-                .eq(Task::getAgvId, agvId)
-                .in(Task::getTaskSts, TaskStsType.ASSIGN.val(), TaskStsType.PROGRESS.val())
-                ) > 0) {
+        if (0 < travelService.count(new LambdaQueryWrapper<Travel>()
+                .eq(Travel::getAgvId, agvId)
+                .eq(Travel::getState, TravelStateType.RUNNING.toString()))) {
             return;
         }
+//        if (taskService.count(new LambdaQueryWrapper<Task>()
+//                .eq(Task::getAgvId, agvId)
+//                .in(Task::getTaskSts, TaskStsType.ASSIGN.val(), TaskStsType.PROGRESS.val())
+//                ) > 0) {
+//            return;
+//        }
         if (!agvService.judgeEnable(agvId)) {
             return;
         }
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/TrafficService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/TrafficService.java
index 0d5d835..4b84676 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/TrafficService.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/TrafficService.java
@@ -137,7 +137,7 @@
             Code endCode = codeService.getById(endNode);
             long startTime = System.currentTimeMillis();
             List<String> pathList = this.checkoutPath(agv, startCode, endCode, segment);
-            System.out.println("checkoutPath: " + (System.currentTimeMillis() - startTime));
+//            System.out.println("checkoutPath: " + (System.currentTimeMillis() - startTime));
             if (Cools.isEmpty(pathList)) {
                 return;
             }
@@ -204,7 +204,7 @@
 
             startTime = System.currentTimeMillis();
             mainService.generateAction(segment.getAgvId(), segmentList, pathList, now);
-            System.out.println("generateAction: " + (System.currentTimeMillis() - startTime));
+//            System.out.println("generateAction: " + (System.currentTimeMillis() - startTime));
 
         } catch (Exception e) {
             log.error("TrafficService.trigger", e);
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/AgvSimulatorTask.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/AgvSimulatorTask.java
index 5d8013b..874926c 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/AgvSimulatorTask.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/AgvSimulatorTask.java
@@ -6,6 +6,7 @@
 import com.zy.acs.common.enums.AgvCompleteType;
 import com.zy.acs.common.utils.RedisSupport;
 import com.zy.acs.manager.core.scheduler.MapDataWsScheduler;
+import com.zy.acs.manager.core.service.MainService;
 import com.zy.acs.manager.core.service.MapService;
 import com.zy.acs.manager.manager.entity.Action;
 import com.zy.acs.manager.manager.entity.Agv;
@@ -34,6 +35,7 @@
     private final CodeService codeService;
     private final MapService mapService;
     private final JamService jamService;
+    private final MainService mainService;
     private final List<Action> actionList;
 
     private final RedisSupport redis;
@@ -48,6 +50,7 @@
             , CodeService codeService
             , MapService mapService
             , JamService jamService
+            , MainService mainService
             , List<Action> actionList
     ) {
         this.agv = agv;
@@ -57,6 +60,7 @@
         this.codeService = codeService;
         this.mapService = mapService;
         this.jamService = jamService;
+        this.mainService = mainService;
         this.actionList = actionList;
 
         this.groupId = actionList.get(0).getGroupId();
@@ -149,6 +153,7 @@
         agv_11_up.setQrCode(qrCode);
 
         AgvProtocol agvProtocol = AgvProtocol.build(this.agv.getUuid()).setMessageBody(agv_11_up);
-        redis.push(RedisConstant.AGV_COMPLETE_FLAG, agvProtocol);
+        mainService.upDataSubscribe(agvProtocol);
+//        redis.push(RedisConstant.AGV_COMPLETE_FLAG, agvProtocol);
     }
 }
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java
index 0dfeb08..2860cb1 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java
@@ -7,6 +7,7 @@
 import com.zy.acs.common.domain.protocol.AGV_01_UP;
 import com.zy.acs.common.utils.RedisSupport;
 import com.zy.acs.framework.common.Cools;
+import com.zy.acs.manager.core.service.MainService;
 import com.zy.acs.manager.core.service.MapService;
 import com.zy.acs.manager.manager.entity.Action;
 import com.zy.acs.manager.manager.entity.Agv;
@@ -64,6 +65,8 @@
     private MapService mapService;
     @Autowired
     private JamService jamService;
+    @Autowired
+    private MainService mainService;
 
     @PostConstruct
     public void init() {
@@ -135,6 +138,7 @@
                                             , codeService
                                             , mapService
                                             , jamService
+                                            , mainService
                                             , actionList
                                     ));
                                 }

--
Gitblit v1.9.1