diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/CtcZoneOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/CtcZoneOperateHandler.java index 91a87a3a6..0c5dc20b7 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/CtcZoneOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/CtcZoneOperateHandler.java @@ -72,7 +72,8 @@ public class CtcZoneOperateHandler { */ @OperateHandlerMapping(type = Operation.Type.CTC_ZONE_SAVE_PLAN_TIME) public CtcRunPlanParam savePlanTime(Simulation simulation, String stationCode, String runPlanCode, String planTime, StationDirection.ReceiveAndDeliverModel model) { - return ctcZoneService.savePlanTime(simulation, stationCode, runPlanCode, LocalDateTime.parse(planTime), model); + LocalDateTime t = LocalDateTime.parse(planTime.replace(" ", "T")); + return ctcZoneService.savePlanTime(simulation, stationCode, runPlanCode, t, model); } /** diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/CTCLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/CTCLogicLoop.java index 43510ebc4..550aa7fbf 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/CTCLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/CTCLogicLoop.java @@ -373,7 +373,8 @@ public class CTCLogicLoop { changeMap.put(k, Boolean.TRUE); } }); - if (!Objects.equals(simulation.getCtcRepository().isRunPlanSendOut(), changeMap.isEmpty())) { + // 为空时 + if (!Objects.equals(simulation.getCtcRepository().getRunPlanSendOut(), changeMap.isEmpty()) || !changeMap.isEmpty()) { simulation.getCtcRepository().setRunPlanSendOut(changeMap.isEmpty()); sendCtcMessage(simulation.getId(), changeMap, WebSocketMessageType.SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND , simulation.getSimulationUserIds()); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java index a8168885f..dc873c716 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java @@ -95,7 +95,7 @@ public class CtcRepository { /** * 是否需要发送计划消息 */ - private boolean runPlanSendOut; + private Boolean runPlanSendOut; /******************************************* 以上为车站终端数据:车站为单位 *******************************************/ /** @@ -126,6 +126,7 @@ public class CtcRepository { this.ctcZoneRepository.reset(); this.ctcEffectRepository.reset(); this.ctcManageRepository.reset(); + this.runPlanSendOut = null; // this.runPlanStatusVOMap.clear(); this.allRunPlanList.clear(); this.simulationRunPlanMap.clear(); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/command/CommandBO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/command/CommandBO.java index aba4cee01..21c9a2b82 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/command/CommandBO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/command/CommandBO.java @@ -577,7 +577,16 @@ public class CommandBO { List steps = command.getStepByType(Step.StepType.DRIVE); Step driveStep = steps.get(0); if (train.isStopAtThePosition(driveStep.getTargetPosition())) { //如果列车已经停到目标位置 - command.getTargetMember().setCommand(null); + boolean isRight = train.isRight(); // 列车运行方向 + Section section = train.getHeadPosition().getSection(); // 列车车头所在区段 + Section targetSection = getTargetSection(isRight, section); + if (Objects.equals(section, targetSection)) { + command.getTargetMember().setCommand(null); + } else { + SectionPosition targetPosition = new SectionPosition(targetSection, targetSection.getStopPointByDirection(isRight)); + driveStep.setTargetPosition(targetPosition); + return driveStep; + } } else { return driveStep; }