From b7cc572e1511119da0901d3b26fec74681c3d9c7 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 04 十一月 2024 21:19:46 +0800
Subject: [PATCH] #

---
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/RetreatNavigateService.java       |    2 ++
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java          |    8 ++++++--
 zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/AgvDetailServiceImpl.java |    2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java
index a0769c3..239ff50 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java
@@ -17,6 +17,7 @@
 import java.util.Date;
 import java.util.List;
 import java.util.Objects;
+import java.util.Optional;
 
 /**
  * judge whether agv go to funcSta which be charging or standby
@@ -124,13 +125,16 @@
             )) {
                 continue;
             }
-            // the time between the latest task and now that be must more that 10 seconds
+            // the time between the latest task and now that be must more that @{param} seconds
 //            if (!Optional.ofNullable((Boolean) redis.getObject(RedisConstant.AGV_TO_STANDBY_FLAG, agv.getUuid())).orElse(false)) {
                 Integer intervalOfAutoStandby = configService.getVal("intervalOfAutoStandby", Integer.class);
                 if (null != intervalOfAutoStandby && intervalOfAutoStandby > 0) {
                     Task latestTask = taskService.findLatestTask(agv.getId(), null);
                     if (null != latestTask) {
-                        long seconds = DateUtils.diffToSeconds(latestTask.getUpdateTime(), new Date());
+                        long seconds = DateUtils.diffToSeconds(
+                                Optional.ofNullable(latestTask.getEndTime()).orElse(latestTask.getUpdateTime())
+                                , new Date()
+                        );
                         if (seconds < intervalOfAutoStandby) { continue; }
                     }
                 }
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/RetreatNavigateService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/RetreatNavigateService.java
index c7c6600..4e66ed4 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/RetreatNavigateService.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/RetreatNavigateService.java
@@ -218,6 +218,8 @@
                             availablePointOfTurn = currentNode;
                             availablePointWaveScopeOfTurn = mapService.getWaveScopeByCode(lev, availablePointOfTurn.getCodeData(), avoidDistance)
                                     .stream().map(NavigateNode::getCodeData).distinct().collect(Collectors.toList());
+                        } else {
+                            actualLanesOfTurn = 0;
                         }
                     }
                 }
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/AgvDetailServiceImpl.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/AgvDetailServiceImpl.java
index 279d972..fad3e00 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/AgvDetailServiceImpl.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/AgvDetailServiceImpl.java
@@ -54,7 +54,7 @@
         if (null == agvModel) {
             agvModel = agvModelService.getById(agv.getAgvModel());
         }
-        return agvDetail.getVol() < agv.getChargeLine() || agvDetail.getVol() < agvModel.getLowBattery();
+        return agvDetail.getVol() < Math.min(agv.getChargeLine(), agvModel.getLowBattery());
     }
 
 }

--
Gitblit v1.9.1