From 12633568e27fcb9046367d6db981e2b4d1462cc7 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期六, 21 三月 2026 14:36:53 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/utils/StationOperateProcessUtils.java | 81 +++++++++++++++++++++++++++++-----------
1 files changed, 58 insertions(+), 23 deletions(-)
diff --git a/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java b/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
index eb1a6a7..fca1f0d 100644
--- a/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
+++ b/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -523,9 +523,17 @@
continue;
}
- StationCommand command = stationThread.getCommand(StationCommandType.MOVE, wrkMast.getWrkNo(), stationProtocol.getStationId(), moveStaNo, 0);
+ StationCommand command = stationThread.getRunBlockRerouteCommand(
+ wrkMast.getWrkNo(),
+ stationProtocol.getStationId(),
+ moveStaNo,
+ 0
+ );
if (command == null) {
- News.taskInfo(wrkMast.getWrkNo(), "鑾峰彇杈撻�佺嚎鍛戒护澶辫触");
+ News.taskInfo(wrkMast.getWrkNo(),
+ "杈撻�佺珯鐐瑰牭濉為噸瑙勫垝鏈壘鍒板彲涓嬪彂璺嚎锛屽綋鍓嶇珯鐐�={}锛岀洰鏍囩珯鐐�={}",
+ stationProtocol.getStationId(),
+ moveStaNo);
continue;
}
@@ -731,15 +739,27 @@
if (!shouldApplyOutOrder(wrkMast, outOrderStationIds)) {
return new OutOrderDispatchDecision(wrkMast.getStaNo(), false);
}
+ Integer dispatchStationId = resolveDispatchOutOrderTarget(
+ wrkMast.getSourceStaNo(),
+ wrkMast.getStaNo(),
+ outOrderStationIds
+ );
+ if (dispatchStationId == null) {
+ return null;
+ }
if (isCurrentOutOrderDispatchStation(currentStationId, wrkMast, outOrderStationIds)) {
return resolveCurrentOutOrderDispatchDecision(currentStationId, wrkMast, outOrderStationIds);
}
-
- Integer moveStaNo = resolveDispatchOutOrderTarget(currentStationId, wrkMast.getStaNo(), outOrderStationIds, true);
- if (moveStaNo == null) {
- return null;
+ if (!Objects.equals(dispatchStationId, wrkMast.getStaNo())
+ && isCurrentOutOrderStation(currentStationId, outOrderStationIds)
+ && isWatchingCircleArrival(wrkMast.getWrkNo(), currentStationId)) {
+ Integer circleTarget = resolveNextCircleOrderTarget(currentStationId, outOrderStationIds);
+ if (circleTarget == null) {
+ return null;
+ }
+ return new OutOrderDispatchDecision(circleTarget, true);
}
- return new OutOrderDispatchDecision(moveStaNo, false);
+ return new OutOrderDispatchDecision(dispatchStationId, false);
}
private OutOrderDispatchDecision resolveCurrentOutOrderDispatchDecision(Integer currentStationId,
@@ -786,10 +806,15 @@
&& currentBatchSeq.equals(wrkMast.getBatchSeq());
}
if (toTarget) {
- if (!hasReachableOutReleaseSlot(currentStationId, wrkMast.getStaNo())) {
+ if (hasReachableOutReleaseSlot(currentStationId, wrkMast.getStaNo())) {
+ return new OutOrderDispatchDecision(wrkMast.getStaNo(), false);
+ }
+ Integer circleTarget = resolveNextCircleOrderTarget(currentStationId, outOrderStationIds);
+ if (circleTarget == null) {
+ News.taskInfo(wrkMast.getWrkNo(), "鐩爣绔欏綋鍓嶄笉鍙繘锛屼笖鏈壘鍒板彲鎵ц鐨勪笅涓�鎺掑簭妫�娴嬬偣锛屽綋鍓嶇珯鐐�={}", currentStationId);
return null;
}
- return new OutOrderDispatchDecision(wrkMast.getStaNo(), false);
+ return new OutOrderDispatchDecision(circleTarget, true);
}
Integer circleTarget = resolveNextCircleOrderTarget(currentStationId, outOrderStationIds);
@@ -813,9 +838,23 @@
private boolean isCurrentOutOrderDispatchStation(Integer currentStationId,
WrkMast wrkMast,
List<Integer> outOrderStationIds) {
+ if (!shouldApplyOutOrder(wrkMast, outOrderStationIds) || currentStationId == null) {
+ return false;
+ }
+ Integer dispatchStationId = resolveDispatchOutOrderTarget(
+ wrkMast.getSourceStaNo(),
+ wrkMast.getStaNo(),
+ outOrderStationIds
+ );
+ return dispatchStationId != null
+ && !Objects.equals(dispatchStationId, wrkMast.getStaNo())
+ && Objects.equals(currentStationId, dispatchStationId);
+ }
+
+ private boolean isCurrentOutOrderStation(Integer currentStationId,
+ List<Integer> outOrderStationIds) {
return currentStationId != null
- && shouldApplyOutOrder(wrkMast, outOrderStationIds)
- && !Objects.equals(currentStationId, wrkMast.getStaNo())
+ && outOrderStationIds != null
&& outOrderStationIds.contains(currentStationId);
}
@@ -824,10 +863,7 @@
List<Integer> outOrderStationIds,
OutOrderDispatchDecision dispatchDecision,
StationCommand command) {
- if (dispatchDecision == null || command == null) {
- return;
- }
- if (!isCurrentOutOrderDispatchStation(currentStationId, wrkMast, outOrderStationIds)) {
+ if (dispatchDecision == null || command == null || !shouldApplyOutOrder(wrkMast, outOrderStationIds)) {
return;
}
if (dispatchDecision.isCircle()) {
@@ -837,25 +873,24 @@
}
}
- private Integer resolveDispatchOutOrderTarget(Integer currentStationId,
+ private Integer resolveDispatchOutOrderTarget(Integer sourceStationId,
Integer finalTargetStationId,
- List<Integer> outOrderList,
- boolean skipCurrentStation) {
+ List<Integer> outOrderList) {
if (finalTargetStationId == null) {
return null;
}
- if (currentStationId == null || outOrderList == null || outOrderList.isEmpty()) {
+ if (sourceStationId == null || outOrderList == null || outOrderList.isEmpty()) {
return finalTargetStationId;
}
try {
- List<NavigateNode> nodes = navigateUtils.calcByStationId(currentStationId, finalTargetStationId);
- for (NavigateNode node : nodes) {
- Integer stationId = getStationIdFromNode(node);
+ List<NavigateNode> nodes = navigateUtils.calcByStationId(sourceStationId, finalTargetStationId);
+ for (int i = nodes.size() - 1; i >= 0; i--) {
+ Integer stationId = getStationIdFromNode(nodes.get(i));
if (stationId == null) {
continue;
}
- if (skipCurrentStation && currentStationId.equals(stationId)) {
+ if (Objects.equals(stationId, finalTargetStationId)) {
continue;
}
if (outOrderList.contains(stationId)) {
--
Gitblit v1.9.1