From 9d47efa2eea0e19a3ca7683409b5020c0b907ef9 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Mon, 4 Jul 2022 16:47:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8F=91=E9=A2=84=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E3=80=91=20=E3=80=90=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=88=B0=E8=BE=BE=E3=80=81=E5=87=BA=E5=8F=91=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E5=AE=9E=E9=99=85=E6=97=B6=E9=97=B4=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E8=AE=A1=E5=88=92=E6=97=B6=E9=97=B4=E3=80=91=20?= =?UTF-8?q?=E3=80=90=E5=8F=96=E6=B6=88=E9=97=AD=E5=A1=9E=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/operation/Operation.java | 14 +++++++ .../CtcStationRunPlanOperateHandler.java | 35 +++++++++++++++++ .../runplan/CtcStationRunPlanLogService.java | 38 +++++++++++++++++++ .../cbtc/CTC/data/CtcStationRunPlanLog.java | 20 +++++++++- .../cbtc/CTC/service/CTCService.java | 4 ++ 5 files changed, 109 insertions(+), 2 deletions(-) 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) {