From 819bef1aeacf77eaaac809f87971db1056d18ee5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 14 十一月 2024 13:57:55 +0800
Subject: [PATCH] #
---
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/TrafficService.java | 10 +++++++++-
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/JamServiceImpl.java | 18 ++++++++++++++++++
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/JamService.java | 2 ++
3 files changed, 29 insertions(+), 1 deletions(-)
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 a213cac..428c9f0 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
@@ -220,11 +220,19 @@
if (!pathList.get(pathList.size() - 1).equals(endCode.getData())) {
assert !Cools.isEmpty(blockVehicleList);
- boolean hasUnavoidableBlocks = blockVehicleList.stream().anyMatch(blockVehicleDto -> !blockVehicleDto.isAvoidable());
+ boolean hasUnavoidableBlocks = blockVehicleList.stream().anyMatch(blockVehicleDto -> !blockVehicleDto.isAvoidable());
if (hasUnavoidableBlocks && pathList.size() <= MIN_SLICE_PATH_LENGTH) {
log.info("AGV[{}] waiting in place, because the path list is too short...", agvNo);
pathList.clear();
}
+
+ boolean hasCycleJam = blockVehicleList.stream().anyMatch(
+ blockVehicleDto -> null != jamService.getCycleJam(agv.getId(), segment.getId(), blockVehicleDto.getVehicle())
+ );
+ if (hasCycleJam) {
+ log.info("AGV[{}] waiting in place, because has cycle jam...", agvNo);
+ pathList.clear();
+ }
}
// 鏃犲彲璧拌璺緞
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/JamService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/JamService.java
index 14d09ac..ce8407c 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/JamService.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/JamService.java
@@ -10,6 +10,8 @@
Jam getJam(Long agvId, Long jamCode, Long jamSeg);
+ Jam getCycleJam(Long jamAgv, Long jamSeg, String avoAgvNo);
+
List<Jam> queryByAvoid(Long avoAgv, JamStateType jamState);
Boolean checkIfFinish(Long avoAgv, String currCodeData);
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/JamServiceImpl.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/JamServiceImpl.java
index 9e3899c..af8c23b 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/JamServiceImpl.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/JamServiceImpl.java
@@ -7,6 +7,7 @@
import com.zy.acs.manager.manager.entity.Jam;
import com.zy.acs.manager.manager.enums.JamStateType;
import com.zy.acs.manager.manager.mapper.JamMapper;
+import com.zy.acs.manager.manager.service.AgvService;
import com.zy.acs.manager.manager.service.CodeService;
import com.zy.acs.manager.manager.service.JamService;
import lombok.extern.slf4j.Slf4j;
@@ -22,6 +23,8 @@
@Autowired
private CodeService codeService;
+ @Autowired
+ private AgvService agvService;
@Override
public Jam getJam(Long agvId, Long jamCode, Long jamSeg) {
@@ -38,6 +41,21 @@
}
@Override
+ public Jam getCycleJam(Long jamAgv, Long jamSeg, String avoAgvNo) {
+ List<Jam> jams = this.list(new LambdaQueryWrapper<Jam>()
+ .eq(Jam::getJamAgv, jamAgv)
+ .eq(Jam::getJamSeg, jamSeg)
+ .eq(Jam::getAvoAgv, agvService.selectByUuid(avoAgvNo).getId())
+ .eq(Jam::getCycleAvo, 1)
+// .eq(Jam::getState, JamStateType.RUNNING.toString())
+ );
+ if (!Cools.isEmpty(jams)) {
+ return jams.stream().findFirst().orElse(null);
+ }
+ return null;
+ }
+
+ @Override
public List<Jam> queryByAvoid(Long avoAgv, JamStateType jamState) {
if (null == avoAgv) {
return null;
--
Gitblit v1.9.1