Junjie
1 天以前 852664df1caf38831793b341edcada9dd7b6c22a
src/main/java/com/zy/core/thread/impl/v5/StationV5RunBlockReroutePlanner.java
@@ -35,6 +35,13 @@
        RunBlockRerouteState rerouteState = loadRunBlockRerouteState(taskNo, blockStationId);
        rerouteState.setTaskNo(taskNo);
        rerouteState.setBlockStationId(blockStationId);
        if (!hasSelectableCandidateCommand(candidateCommands)) {
            return new PlanResult(
                    null,
                    rerouteState.getPlanCount() == null ? 0 : rerouteState.getPlanCount(),
                    copyRoutePathList(rerouteState.getIssuedRoutePathList())
            );
        }
        rerouteState.setPlanCount((rerouteState.getPlanCount() == null ? 0 : rerouteState.getPlanCount()) + 1);
        int currentPlanCount = rerouteState.getPlanCount() == null ? 0 : rerouteState.getPlanCount();
        boolean resetForPlanCountLimit = rerouteState.getPlanCount() > PLANNER_RESET_PLAN_COUNT_THRESHOLD;
@@ -318,6 +325,21 @@
        return builder.toString();
    }
    private boolean hasSelectableCandidateCommand(List<StationCommand> candidateCommands) {
        if (candidateCommands == null || candidateCommands.isEmpty()) {
            return false;
        }
        for (StationCommand candidateCommand : candidateCommands) {
            if (candidateCommand == null || candidateCommand.getNavigatePath() == null || candidateCommand.getNavigatePath().isEmpty()) {
                continue;
            }
            if (!Cools.isEmpty(buildPathSignature(candidateCommand.getNavigatePath()))) {
                return true;
            }
        }
        return false;
    }
    private int safeInt(Integer value) {
        return value == null ? 0 : value;
    }