From c44c7027aa6038c9de302c080367d84cfcb46a75 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 23 三月 2026 22:59:07 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/utils/StationOperateProcessUtils.java | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java b/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
index dced1e1..a6f36f0 100644
--- a/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
+++ b/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -40,7 +40,7 @@
private static final int LOOP_LOAD_RESERVE_EXPIRE_SECONDS = 120;
private static final int OUT_ORDER_DISPATCH_LIMIT_SECONDS = 2;
private static final int STATION_IDLE_RECOVER_SECONDS = 10;
- private static final int STATION_IDLE_RECOVER_LIMIT_SECONDS = 10;
+ private static final int STATION_IDLE_RECOVER_LIMIT_SECONDS = 30;
private static final int STATION_IDLE_TRACK_EXPIRE_SECONDS = 60 * 60;
private static final long STATION_MOVE_RESET_WAIT_MS = 1000L;
private static final String IDLE_RECOVER_CLEARED_MEMO = "idleRecoverRerouteCleared";
@@ -1313,12 +1313,15 @@
if (lock != null) {
return;
}
- int taskBufferCommandCount = countTaskBufferCommands(stationProtocol.getTaskBufferItems());
- if (taskBufferCommandCount > 0) {
- News.info("杈撻�佺珯鐐逛换鍔″仠鐣欒秴鏃讹紝浣嗙紦瀛樺尯浠嶆湁鍛戒护锛屽凡璺宠繃閲嶇畻銆傜珯鐐瑰彿={}锛屽伐浣滃彿={}锛岀紦瀛樺懡浠ゆ暟={}",
+ int currentTaskBufferCommandCount = countCurrentTaskBufferCommands(
+ stationProtocol.getTaskBufferItems(),
+ stationProtocol.getTaskNo()
+ );
+ if (currentTaskBufferCommandCount > 0) {
+ News.info("杈撻�佺珯鐐逛换鍔″仠鐣欒秴鏃讹紝浣嗙紦瀛樺尯浠嶅瓨鍦ㄥ綋鍓嶄换鍔″懡浠わ紝宸茶烦杩囬噸绠椼�傜珯鐐瑰彿={}锛屽伐浣滃彿={}锛屽綋鍓嶄换鍔″懡浠ゆ暟={}",
stationProtocol.getStationId(),
stationProtocol.getTaskNo(),
- taskBufferCommandCount);
+ currentTaskBufferCommandCount);
return;
}
@@ -1384,18 +1387,16 @@
redisUtil.del(key);
}
- private int countTaskBufferCommands(List<StationTaskBufferItem> taskBufferItems) {
- if (taskBufferItems == null || taskBufferItems.isEmpty()) {
+ private int countCurrentTaskBufferCommands(List<StationTaskBufferItem> taskBufferItems, Integer currentTaskNo) {
+ if (taskBufferItems == null || taskBufferItems.isEmpty() || currentTaskNo == null || currentTaskNo <= 0) {
return 0;
}
int count = 0;
for (StationTaskBufferItem item : taskBufferItems) {
- if (item == null) {
+ if (item == null || item.getTaskNo() == null) {
continue;
}
- Integer taskNo = item.getTaskNo();
- Integer targetStaNo = item.getTargetStaNo();
- if ((taskNo != null && taskNo != 0) || (targetStaNo != null && targetStaNo != 0)) {
+ if (currentTaskNo.equals(item.getTaskNo())) {
count++;
}
}
--
Gitblit v1.9.1