From 1654b0a8c149f86d38f3202cb88c655ad0a25384 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 01 四月 2026 10:33:25 +0800
Subject: [PATCH] #出库任务路径计算增加cache
---
src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java b/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
index dcd7ae6..a08a715 100644
--- a/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
@@ -31,6 +31,8 @@
import com.zy.core.network.ZyStationConnectDriver;
import com.zy.core.network.entity.ZyStationStatusEntity;
import com.zy.core.thread.impl.v5.StationMoveSegmentExecutor;
+import com.zy.core.thread.support.RecentStationArrivalTracker;
+import com.zy.core.thread.support.StationErrLogSupport;
import com.zy.core.utils.DeviceLogRedisKeyBuilder;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
@@ -57,10 +59,12 @@
private boolean initStatus = false;
private long deviceDataLogTime = System.currentTimeMillis();
private ExecutorService executor = Executors.newFixedThreadPool(9999);
+ private final RecentStationArrivalTracker recentArrivalTracker;
public ZyStationV4Thread(DeviceConfig deviceConfig, RedisUtil redisUtil) {
this.deviceConfig = deviceConfig;
this.redisUtil = redisUtil;
+ this.recentArrivalTracker = new RecentStationArrivalTracker(redisUtil);
this.segmentExecutor = new StationMoveSegmentExecutor(deviceConfig, redisUtil, this::sendCommand);
}
@@ -157,6 +161,7 @@
stationProtocol.setWeight(statusEntity.getWeight());
stationProtocol.setTaskWriteIdx(statusEntity.getTaskWriteIdx());
stationProtocol.setTaskBufferItems(statusEntity.getTaskBufferItems());
+ recentArrivalTracker.observe(statusEntity.getStationId(), statusEntity.getTaskNo(), statusEntity.isLoading());
}
if (!Cools.isEmpty(stationProtocol.getSystemWarning())) {
@@ -170,6 +175,7 @@
}
OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛", DateUtils.convert(new Date()), deviceConfig.getDeviceNo()));
+ StationErrLogSupport.sync(deviceConfig, redisUtil, statusList);
if (System.currentTimeMillis() - deviceDataLogTime > deviceLogCollectTime) {
DeviceDataLog deviceDataLog = new DeviceDataLog();
@@ -217,6 +223,11 @@
}
@Override
+ public boolean hasRecentArrival(Integer stationId, Integer taskNo) {
+ return recentArrivalTracker.hasRecentArrival(stationId, taskNo);
+ }
+
+ @Override
public StationCommand getCommand(StationCommandType commandType, Integer taskNo, Integer stationId, Integer targetStationId, Integer palletSize) {
return getCommand(commandType, taskNo, stationId, targetStationId, palletSize, null);
}
--
Gitblit v1.9.1