From d0cbacfe348c5702f5e6a2d929f7e16f37d276de Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 06 四月 2026 22:11:13 +0800
Subject: [PATCH] #出库检测站台空闲超时后的恢复处理
---
src/main/java/com/zy/core/utils/StationOperateProcessUtils.java | 25 +++++++++++++++++++++++++
src/main/java/com/zy/core/utils/station/StationRerouteProcessor.java | 24 ++++++++++++++++++++++++
2 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java b/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
index ee42d03..5c852ad 100644
--- a/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
+++ b/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -26,6 +26,7 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
@Component
public class StationOperateProcessUtils {
@@ -423,6 +424,9 @@
if (stationId == null) {
continue;
}
+ if (!isIdleRecoverCandidateStation(basDevp, stationId)) {
+ continue;
+ }
if (!stationProtocol.isAutoing()
|| !stationProtocol.isLoading()
|| stationProtocol.getTaskNo() <= 0
@@ -460,6 +464,27 @@
return stationRerouteProcessor.shouldUseRunBlockDirectReassign(wrkMast, stationId, runBlockReassignLocStationList);
}
+ public boolean isIdleRecoverCandidateStation(BasDevp basDevp, Integer stationId) {
+ if (basDevp == null || stationId == null) {
+ return false;
+ }
+ return !containsStation(basDevp.getBarcodeStationList$(), stationId)
+ && !containsStation(basDevp.getInStationList$(), stationId)
+ && !containsStation(basDevp.getOutStationList$(), stationId);
+ }
+
+ private boolean containsStation(List<StationObjModel> stationList, Integer stationId) {
+ if (stationList == null || stationList.isEmpty() || stationId == null) {
+ return false;
+ }
+ for (StationObjModel stationObjModel : stationList) {
+ if (stationObjModel != null && Objects.equals(stationObjModel.getStationId(), stationId)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private boolean shouldSkipIdleRecoverForRecentDispatch(Integer taskNo, Integer stationId) {
return stationRerouteProcessor.shouldSkipIdleRecoverForRecentDispatch(taskNo, stationId);
}
diff --git a/src/main/java/com/zy/core/utils/station/StationRerouteProcessor.java b/src/main/java/com/zy/core/utils/station/StationRerouteProcessor.java
index 9deba63..6031758 100644
--- a/src/main/java/com/zy/core/utils/station/StationRerouteProcessor.java
+++ b/src/main/java/com/zy/core/utils/station/StationRerouteProcessor.java
@@ -183,6 +183,9 @@
if (basDevp == null || basDevp.getDevpNo() == null || stationId == null) {
return;
}
+ if (!isIdleRecoverCandidateStation(basDevp, stationId)) {
+ return;
+ }
StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo());
if (stationThread == null) {
return;
@@ -476,6 +479,27 @@
return true;
}
+ private boolean isIdleRecoverCandidateStation(BasDevp basDevp, Integer stationId) {
+ if (basDevp == null || stationId == null) {
+ return false;
+ }
+ return !containsStation(basDevp.getBarcodeStationList$(), stationId)
+ && !containsStation(basDevp.getInStationList$(), stationId)
+ && !containsStation(basDevp.getOutStationList$(), stationId);
+ }
+
+ private boolean containsStation(List<StationObjModel> stationList, Integer stationId) {
+ if (stationList == null || stationList.isEmpty() || stationId == null) {
+ return false;
+ }
+ for (StationObjModel stationObjModel : stationList) {
+ if (stationObjModel != null && Objects.equals(stationObjModel.getStationId(), stationId)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private RerouteExecutionResult executeReroutePlanWithTaskLock(RerouteContext context,
RerouteCommandPlan plan,
StationProtocol stationProtocol,
--
Gitblit v1.9.1