From 479744aa9d9e468626583620a85d9039f7c1ea5f Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 23 三月 2026 22:51:52 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/utils/StationOperateProcessUtils.java | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 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..4cccd79 100644
--- a/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
+++ b/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -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