diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index f40aa42a7..855b2354e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -918,6 +918,20 @@ public class Operation { */ CTC_CANCEL_TWINKLE, + /** + * 行车日志取消到达 + */ + CTC_LOG_CANCEL_ARRIVE, + + /** + * 行车日志取消出发 + */ + CTC_LOG_CANCEL_DEPARTURE, + + /** + * 行车日志取消闭塞 + */ + CTC_LOG_CANCEL_BLOCK, /**************调度台******************/ /** * 调度台保存运行计划 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/CtcStationRunPlanOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/CtcStationRunPlanOperateHandler.java index 8a77e3b10..dea7064fc 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/CtcStationRunPlanOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/CtcStationRunPlanOperateHandler.java @@ -162,4 +162,39 @@ public class CtcStationRunPlanOperateHandler { ctcStationRunPlanLogService.cancelTwinkle(simulation, stationCode, runPlanCode); } + /** + * 取消到达 + * + * @param simulation 仿真 + * @param stationCode 车站 + * @param runPlanCode 运行计划 + */ + @OperateHandlerMapping(type = Operation.Type.CTC_LOG_CANCEL_ARRIVE) + public void cancelArrive(Simulation simulation, String stationCode, String runPlanCode) { + ctcStationRunPlanLogService.cancelArrive(simulation, stationCode, runPlanCode); + } + + /** + * 取消出发 + * + * @param simulation 仿真 + * @param stationCode 车站 + * @param runPlanCode 运行计划 + */ + @OperateHandlerMapping(type = Operation.Type.CTC_LOG_CANCEL_DEPARTURE) + public void cancelDepart(Simulation simulation, String stationCode, String runPlanCode) { + ctcStationRunPlanLogService.cancelDepart(simulation, stationCode, runPlanCode); + } + + /** + * 取消闭塞 + * + * @param simulation 仿真 + * @param stationCode 车站 + * @param runPlanCode 运行计划 + */ + @OperateHandlerMapping(type = Operation.Type.CTC_LOG_CANCEL_BLOCK) + public void cancelBlock(Simulation simulation, String stationCode, String runPlanCode) { + ctcStationRunPlanLogService.cancelBlock(simulation, stationCode, runPlanCode); + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcStationRunPlanLogService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcStationRunPlanLogService.java index 59c40a10c..cfb6446d0 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcStationRunPlanLogService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcStationRunPlanLogService.java @@ -305,6 +305,44 @@ public class CtcStationRunPlanLogService { runPlanLog.setTwinkle(false); } + /** + * 取消到达 + * + * @param simulation 仿真 + * @param stationCode 车站编码 + * @param runPlanCode 运行计划编码 + */ + public void cancelArrive(Simulation simulation, String stationCode, String runPlanCode) { + CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode); + runPlanLog.cancelArrive(); + } + + /** + * 取消出发 + * + * @param simulation 仿真 + * @param stationCode 车站编码 + * @param runPlanCode 运行计划编码 + */ + public void cancelDepart(Simulation simulation, String stationCode, String runPlanCode) { + CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode); + runPlanLog.cancelDeparture(); + } + + /** + * 取消闭塞 + * + * @param simulation 仿真 + * @param stationCode 车站编码 + * @param runPlanCode 运行计划编码 + */ + public void cancelBlock(Simulation simulation, String stationCode, String runPlanCode) { + CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode); + CtcStationRunPlanLog nextPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(runPlanLog.getNextStation().getCode(), runPlanCode); + runPlanLog.cancelDepartBlock(); + nextPlanLog.cancelArriveBlock(); + } + /** * 修改原始数据,并返回修改属性的对象 * diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcStationRunPlanLog.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcStationRunPlanLog.java index b429c2b15..71ade2172 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcStationRunPlanLog.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcStationRunPlanLog.java @@ -184,7 +184,7 @@ public class CtcStationRunPlanLog { public void cancelArrive() { BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(arriveRunPlan); - arriveRunPlan.setActualTime(""); + arriveRunPlan.setActualTime(arriveRunPlan.getPlanTimeStr()); } public void finishDeparture(LocalTime time) { @@ -194,7 +194,7 @@ public class CtcStationRunPlanLog { public void cancelDeparture() { BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(departRunPlan); - departRunPlan.setActualTime(""); + departRunPlan.setActualTime(departRunPlan.getPlanTimeStr()); } /** @@ -233,6 +233,22 @@ public class CtcStationRunPlanLog { arriveRunPlan.setAdjacentMessage(RunPlanItem.WAIT); } + /** + * 发车取消闭塞 + */ + public void cancelDepartBlock() { + BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(departRunPlan); + departRunPlan.setAdjacentMessage(RunPlanItem.NO); + } + + /** + * 接车取消闭塞 + */ + public void cancelArriveBlock() { + BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(arriveRunPlan); + arriveRunPlan.setAdjacentMessage(RunPlanItem.NO); + } + @Setter @Getter public static class RunPlanItem { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/CTCService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/CTCService.java index ae3e291a9..6a5630f0e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/CTCService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/CTCService.java @@ -59,6 +59,8 @@ public class CTCService { public void finishReceivingNotice(Simulation simulation, String stationCode, String tripNumber) { CtcStationRunPlanLog plan = getCtcStationRunPlan(simulation, stationCode, tripNumber); plan.finishReceivingNotice(); + String systemTime = simulation.getCorrectSystemTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:dd")); + plan.getArriveRunPlan().setAdjacentMessageTime(systemTime); } /** @@ -74,6 +76,8 @@ public class CTCService { public void finishDepartureNotice(Simulation simulation, String stationCode, String tripNumber) { CtcStationRunPlanLog plan = getCtcStationRunPlan(simulation, stationCode, tripNumber); plan.finishDepartureNotice(); + String systemTime = simulation.getCorrectSystemTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:dd")); + plan.getDepartRunPlan().setAdjacentMessageTime(systemTime); } public void cancelDepartureNotice(Simulation simulation, String stationCode, String tripNumber) {