Junjie
2026-04-13 75cc46160a689ee0de4318787f0be827ea19ff4d
#站点运行优化
2个文件已修改
23 ■■■■ 已修改文件
src/main/java/com/zy/core/utils/station/StationDispatchRuntimeStateSupport.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/utils/station/StationRerouteProcessor.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/utils/station/StationDispatchRuntimeStateSupport.java
@@ -137,11 +137,19 @@
        return tryAcquireLock(RedisKeyType.STATION_OUT_ORDER_DISPATCH_LIMIT_.key + wrkNo + "_" + stationId, seconds);
    }
    public boolean tryAcquireRunBlockDirectReassignLock(Integer wrkNo, Integer stationId, int seconds) {
    public boolean hasRunBlockDirectReassignLimit(Integer wrkNo, Integer stationId) {
        if (wrkNo == null || wrkNo <= 0 || stationId == null) {
            return true;
            return false;
        }
        return tryAcquireLock(RedisKeyType.STATION_RUN_BLOCK_DIRECT_REASSIGN_LIMIT_.key + wrkNo + "_" + stationId, seconds);
        return redisUtil != null
                && redisUtil.get(RedisKeyType.STATION_RUN_BLOCK_DIRECT_REASSIGN_LIMIT_.key + wrkNo + "_" + stationId) != null;
    }
    public void recordRunBlockDirectReassignLimit(Integer wrkNo, Integer stationId, int seconds) {
        if (wrkNo == null || wrkNo <= 0 || stationId == null || redisUtil == null || seconds <= 0) {
            return;
        }
        redisUtil.set(RedisKeyType.STATION_RUN_BLOCK_DIRECT_REASSIGN_LIMIT_.key + wrkNo + "_" + stationId, "lock", seconds);
    }
    public void signalSegmentReset(Integer taskNo, long waitMs) {
src/main/java/com/zy/core/utils/station/StationRerouteProcessor.java
@@ -458,10 +458,9 @@
                    stationProtocol.getTaskNo(),
                    currentTaskBufferCommandCount);
        }
        if (!stationDispatchRuntimeStateSupport.tryAcquireRunBlockDirectReassignLock(
        if (stationDispatchRuntimeStateSupport.hasRunBlockDirectReassignLimit(
                wrkMast.getWrkNo(),
                stationProtocol.getStationId(),
                RUN_BLOCK_DIRECT_REASSIGN_LIMIT_SECONDS)) {
                stationProtocol.getStationId())) {
            News.info("输送站点运行堵塞重分配已跳过,15分钟内不允许重复申请。站点号={},工作号={}",
                    stationProtocol.getStationId(),
                    wrkMast.getWrkNo());
@@ -543,6 +542,10 @@
        if (!wrkMastService.updateById(wrkMast)) {
            return;
        }
        stationDispatchRuntimeStateSupport.recordRunBlockDirectReassignLimit(
                wrkMast.getWrkNo(),
                stationProtocol.getStationId(),
                RUN_BLOCK_DIRECT_REASSIGN_LIMIT_SECONDS);
        stationDispatchRuntimeStateSupport.signalSegmentReset(wrkMast.getWrkNo(), STATION_MOVE_RESET_WAIT_MS);
        boolean offered = offerDevpCommandWithDedup(basDevp.getDevpNo(), command, "checkStationRunBlock_direct");
        if (!offered) {