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 855b2354e..851e301cc 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 @@ -999,6 +999,11 @@ public class Operation { */ CTC_STATION_SIGN_RUN_PLAN, + /** + * 车站发送计划 + */ + CTC_STATION_SEND_OUT_RUN_PLAN, + /** * 车站向中心发送申请 */ @@ -1014,6 +1019,11 @@ public class Operation { */ CTC_MODIFY_SECTION, + /** + * 修改方向 + */ + CTC_MODIFY_DIRECTION, + /** * 修改实际到达时间 */ 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 dea7064fc..aadfe1f24 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 @@ -44,12 +44,30 @@ public class CtcStationRunPlanOperateHandler { * @param runPlanCode 运行计划 * @param arriveSection 到达股道 * @param departSection 出发股道 + * @param force 是否强制 */ @OperateHandlerMapping(type = Operation.Type.CTC_MODIFY_SECTION) - public void modifyRunPlanSection(Simulation simulation, String stationCode, String runPlanCode, String arriveSection, String departSection, int force) { + public void modifyRunPlanSection(Simulation simulation, String stationCode, String runPlanCode + , String arriveSection, String departSection, int force) { ctcStationRunPlanLogService.modifyRunPlanSection(simulation, stationCode, runPlanCode, arriveSection, departSection, force); } + /** + * 修改方向口 + * + * @param simulation 仿真对象 + * @param stationCode 车站编码 + * @param runPlanCode 运行计划 + * @param arriveDirection 到达方向 + * @param departDirection 出发方向 + * @param force 是否强制 + */ + @OperateHandlerMapping(type = Operation.Type.CTC_MODIFY_DIRECTION) + public void modifyRunPlanDirection(Simulation simulation, String stationCode, String runPlanCode + , String arriveDirection, String departDirection, int force) { + ctcStationRunPlanLogService.modifyRunPlanDirection(simulation, stationCode, runPlanCode, arriveDirection, departDirection, force); + } + /** * 人工上报行车日志的到点时间 * @@ -123,7 +141,6 @@ public class CtcStationRunPlanOperateHandler { ctcService.agreeDepartureNotice(simulation, stationCode, runPlanCode); } - /** * 签收阶段计划 * @@ -150,6 +167,17 @@ public class CtcStationRunPlanOperateHandler { ctcStationRunPlanLogService.applySection(simulation, stationCode, runPlanCode, sectionCode, model); } + /** + * 发送计划 + * + * @param simulation 仿真 + * @param stationCode 车站 + */ + @OperateHandlerMapping(type = Operation.Type.CTC_STATION_SEND_OUT_RUN_PLAN) + public void doSendOutRunPlan(Simulation simulation, String stationCode) { + ctcStationRunPlanLogService.doSendOutRunPlan(simulation, stationCode); + } + /** * 取消行车日志红闪 * diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/vo/CtcRunPlanParam.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/vo/CtcRunPlanParam.java index d22537065..fb7220920 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/vo/CtcRunPlanParam.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/vo/CtcRunPlanParam.java @@ -583,10 +583,8 @@ public class CtcRunPlanParam implements Cloneable { * @return 是否存在 */ public boolean arriveIsExist() { - return this.arrivePlanTime != null || !StringUtils.isEmpty(this.arriveTripNumber) - || !StringUtils.isEmpty(this.arriveSectionCode) - || !StringUtils.isEmpty(this.arriveDirectionCode) - || !StringUtils.isEmpty(this.arriveStationCode); + return this.arrivePlanTime != null && !StringUtils.isEmpty(this.arriveTripNumber) + && !StringUtils.isEmpty(this.arriveDirectionCode); } /** @@ -595,10 +593,8 @@ public class CtcRunPlanParam implements Cloneable { * @return 是否存在 */ public boolean departIsExist() { - return this.departPlanTime != null || !StringUtils.isEmpty(this.departTripNumber) - || !StringUtils.isEmpty(this.departSectionCode) - || !StringUtils.isEmpty(this.departDirectionCode) - || !StringUtils.isEmpty(this.departStationCode); + return this.departPlanTime != null && !StringUtils.isEmpty(this.departTripNumber) + && !StringUtils.isEmpty(this.departDirectionCode); } /** diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcRunPlanErrorMsgService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcRunPlanErrorMsgService.java index 1bbab77d7..eb6b8a100 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcRunPlanErrorMsgService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcRunPlanErrorMsgService.java @@ -154,8 +154,8 @@ public class CtcRunPlanErrorMsgService { } } // 接车是否存在 - if (runPlanParam.arriveIsExist() && !StringUtils.isEmpty(runPlanParam.getArriveStationCode())) { - TrackSection trackSection = effectRepository.queryTrackSection(stationCode, runPlanParam.getArriveStationCode()); + if (runPlanParam.arriveIsExist() && !StringUtils.isEmpty(runPlanParam.getArriveSectionCode())) { + TrackSection trackSection = effectRepository.queryTrackSection(stationCode, runPlanParam.getArriveSectionCode()); if (doTransfiniteCheck.apply(transfinite, trackSection)) { BusinessExceptionAssertEnum.OPERATION_FAIL.exception(String.format("运行计划超限不符合【接车股道:%s】超限" , runPlanParam.getArriveStationCode())); 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 cfb6446d0..1596374b3 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 @@ -21,6 +21,7 @@ import java.time.LocalDateTime; import java.time.LocalTime; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -132,19 +133,70 @@ public class CtcStationRunPlanLogService { * @param arriveSection 到达股道 * @param departSection 出发股道 */ - public void modifyRunPlanSection(Simulation simulation, String stationCode, String runPlanCode, String arriveSection, String departSection, int force) { + public void modifyRunPlanSection(Simulation simulation, String stationCode, String runPlanCode + , String arriveSection, String departSection, int force) { + if (force == 0) { + CtcRunPlanParam p = new CtcRunPlanParam(); + p.setRunPlanCode(runPlanCode); + p.setStationCode(stationCode); + p.setArriveSectionCode(arriveSection); + p.setDepartSectionCode(departSection); + // 股道与计划不一致检查 + ctcRunPlanErrorMsgService.sectionInconsistentCheck.valid(simulation, stationCode, p); + } CtcStationRunPlanLog ctcStationRunPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode); if (ctcStationRunPlanLog.getArriveRunPlan() != null && !StringUtils.isEmpty(arriveSection)) { Section section = simulation.getRepository().getByCode(arriveSection, Section.class); if (!Objects.equals(section, ctcStationRunPlanLog.getArriveRunPlan().getTrackSection())) { ctcStationRunPlanLog.getArriveRunPlan().setTrackSection(section); + ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE); } } if (ctcStationRunPlanLog.getDepartRunPlan() != null && !StringUtils.isEmpty(departSection)) { Section section = simulation.getRepository().getByCode(departSection, Section.class); if (!Objects.equals(section, ctcStationRunPlanLog.getDepartRunPlan().getTrackSection())) { ctcStationRunPlanLog.getDepartRunPlan().setTrackSection(section); + ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE); + } + } + } + + /** + * 修改方向口 + * + * @param simulation 仿真对象 + * @param stationCode 车站编码 + * @param runPlanCode 运行计划 + * @param arriveDirection 到达方向 + * @param departDirection 出发方向 + * @param force 是否强制 + */ + public void modifyRunPlanDirection(Simulation simulation, String stationCode, String runPlanCode + , String arriveDirection, String departDirection, int force) { + if (force == 0) { + CtcRunPlanParam p = new CtcRunPlanParam(); + p.setRunPlanCode(runPlanCode); + p.setStationCode(stationCode); + p.setArriveDirectionCode(arriveDirection); + p.setDepartDirectionCode(departDirection); + // 股道与计划不一致检查 + ctcRunPlanErrorMsgService.directionInconsistentCheck.valid(simulation, stationCode, p); + } + CtcStationRunPlanLog ctcStationRunPlanLog = + simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode); + if (ctcStationRunPlanLog.getArriveRunPlan() != null && !StringUtils.isEmpty(arriveDirection)) { + StationDirection stationDirection = simulation.getRepository().getByCode(arriveDirection, StationDirection.class); + if (!Objects.equals(stationDirection, ctcStationRunPlanLog.getArriveRunPlan().getStationDirection())) { + ctcStationRunPlanLog.getArriveRunPlan().setStationDirection(stationDirection); + ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE); + } + } + if (ctcStationRunPlanLog.getDepartRunPlan() != null && !StringUtils.isEmpty(departDirection)) { + StationDirection stationDirection = simulation.getRepository().getByCode(departDirection, StationDirection.class); + if (!Objects.equals(stationDirection, ctcStationRunPlanLog.getDepartRunPlan().getStationDirection())) { + ctcStationRunPlanLog.getDepartRunPlan().setStationDirection(stationDirection); + ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE); } } } @@ -187,6 +239,7 @@ public class CtcStationRunPlanLogService { CtcStationRunPlanLog ctcStationRunPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode); if (!Objects.equals(ctcStationRunPlanLog.getDelete(), Boolean.TRUE)) { ctcStationRunPlanLog.setDelete(Boolean.TRUE); + ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_DELETE_CHANGE); } } @@ -221,39 +274,43 @@ public class CtcStationRunPlanLogService { if (CollectionUtils.isEmpty(ctcRunPlanVOList)) { return; } - List changeList = new LinkedList<>(); - List createList = new LinkedList<>(); ctcRunPlanVOList.forEach(ctcRunPlanVO -> { + CtcRunPlanParam modifyParam = ctcRunPlanVO.getRunPlan(); CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository() .getRunPlanByRunPlanCodeAndStationCode(stationCode, ctcRunPlanVO.getRunPlanCode()); boolean change = false; if (runPlanLog != null) { - runPlanLog.setBaseAttribute(ctcRunPlanVO.getRunPlan()); - // 到达 - if (ctcRunPlanVO.getRunPlan().arriveIsExist()) { // 不存在到达信息则直接浮空 - change = modifyRunPlanItemInfo(simulation, runPlanLog.getArriveRunPlan(), ctcRunPlanVO.getRunPlan(), true); - } else { - change = runPlanLog.getArriveRunPlan() != null; - runPlanLog.setArriveRunPlan(null); + boolean isFinish = runPlanLog.arrivePlanTimeCheck(modifyParam.getArrivePlanTime()) + && runPlanLog.departPlanTimeCheck(modifyParam.getDepartPlanTime()); + if (!isFinish) { // 已完成该车次的接发车作业,又收到该接发车时间范围内的阶段计划,不取消红闪 + runPlanLog.setTwinkle(true); + } else { // 行车计划未完成 + runPlanLog.setBaseAttribute(modifyParam); + // 到达 + if (modifyParam.arriveIsExist()) { // 不存在到达信息则直接浮空 + change = modifyRunPlanItemInfo(simulation, runPlanLog.getArriveRunPlan(), modifyParam, true); + } else { + change = runPlanLog.getArriveRunPlan() != null; + runPlanLog.setArriveRunPlan(null); + } + // 出发 + if (modifyParam.departIsExist()) { + change = change || modifyRunPlanItemInfo(simulation, runPlanLog.getDepartRunPlan(), modifyParam, false); + } else { + change = change || runPlanLog.getDepartRunPlan() != null; + runPlanLog.setDepartRunPlan(null); + } + if (change) { + runPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE); + } + runPlanLog.setTwinkle(false); // 签收后,红闪消失 } - // 出发 - if (ctcRunPlanVO.getRunPlan().departIsExist()) { - change = change || modifyRunPlanItemInfo(simulation, runPlanLog.getDepartRunPlan(), ctcRunPlanVO.getRunPlan(), false); - } else { - change = change || runPlanLog.getDepartRunPlan() != null; - runPlanLog.setDepartRunPlan(null); - } - if (change) { - changeList.add(runPlanLog); - } - runPlanLog.setTwinkle(false); // 签收后,红闪消失 } else { - runPlanLog = CtcStationRunPlanLog.createRunPlanLog(simulation, stationCode, ctcRunPlanVO.getRunPlan()); + runPlanLog = CtcStationRunPlanLog.createRunPlanLog(simulation, stationCode, modifyParam); + runPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_ADD_CHANGE); simulation.getCtcRepository().addRunPlanToSimulationMap(runPlanLog); - createList.add(runPlanLog); } }); - runPlanChange(simulation, changeList, createList); } /** @@ -282,6 +339,24 @@ public class CtcStationRunPlanLogService { } } + /** + * 【发送计划】至【占线板】 + * + * @param simulation 仿真 + * @param stationCode 车站编码 + */ + public void doSendOutRunPlan(Simulation simulation, String stationCode) { + Map ctcRunPlanMap = simulation.getCtcRepository().getSimulationRunPlanMap().get(stationCode); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(ctcRunPlanMap); + List changeList = ctcRunPlanMap.values().stream() + .filter(r -> CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE.equals(r.getChangeType())) + .collect(Collectors.toList()); + List createList = ctcRunPlanMap.values().stream() + .filter(r -> CtcStationRunPlanLog.ChangeType.STATUS_ADD_CHANGE.equals(r.getChangeType())) + .collect(Collectors.toList()); + runPlanChange(simulation, changeList, createList); + } + /** * 拉取车站最新运行计划 * @@ -450,6 +525,7 @@ public class CtcStationRunPlanLogService { StationDirection stationDirection = simulation.getRepository().getByCode(directionCode, StationDirection.class); if (!Objects.equals(stationDirection, runPlanItem.getStationDirection())) { runPlanItem.setStationDirection(stationDirection); + change = true; } } } @@ -464,7 +540,6 @@ public class CtcStationRunPlanLogService { */ private void runPlanChange(Simulation simulation, List changeList, List createList) { if (!CollectionUtils.isEmpty(changeList)) { // 编辑过轨道的行车记录 - changeList.stream().filter(r -> r.getArriveRunPlan() != null || r.getDepartRunPlan() != null) .forEach(r -> { if (r.getArriveRunPlan() != null && r.getArriveRunPlan().getTrackSection() != null) { @@ -473,6 +548,7 @@ public class CtcStationRunPlanLogService { if (r.getDepartRunPlan() != null && r.getDepartRunPlan().getTrackSection() != null) { ctcService.runPlanItemUpdate(simulation, r.getStation(), r.getDepartRunPlan(), true); } + r.clearChange(); // 签收完,清除变化类型 }); } @@ -485,6 +561,7 @@ public class CtcStationRunPlanLogService { if (r.getDepartRunPlan() != null && r.getDepartRunPlan().getTrackSection() != null) { ctcService.runPlanItemCreate(simulation, r.getStation(), r.getDepartRunPlan(), true); } + r.clearChange(); // 签收完,清除变化类型 }); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcZoneService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcZoneService.java index 814dea676..fca491a62 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcZoneService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/runplan/CtcZoneService.java @@ -34,6 +34,9 @@ public class CtcZoneService { public CtcRunPlanParam saveRunPlan(Simulation simulation, CtcRunPlanParam planParam) { CtcZoneRepository railwayRepository = simulation.getCtcRepository().getCtcZoneRepository(); BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(railwayRepository); + // 参数信息是否正确 + boolean isNotEmpty = planParam.arriveIsExist() || planParam.departIsExist(); + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotTrue(!isNotEmpty, "缺少必填项"); if (StringUtils.isEmpty(planParam.getRunPlanCode())) { // 初始化运行计划编码、车次信息 // 确定车次信息 String tripNumber = planParam.generateTripNumber(); 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 f9fa72433..1b301912a 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 @@ -7,7 +7,10 @@ import club.joylink.rtss.simulation.cbtc.CTC.data.vo.TrackViewVO; import club.joylink.rtss.simulation.cbtc.CTC.service.CTCService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; -import club.joylink.rtss.simulation.cbtc.data.map.*; +import club.joylink.rtss.simulation.cbtc.data.map.Route; +import club.joylink.rtss.simulation.cbtc.data.map.Section; +import club.joylink.rtss.simulation.cbtc.data.map.Signal; +import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain; @@ -51,13 +54,13 @@ public class CTCLogicLoop { sendRunPlanRemoveMessage(simulation); // 下发计划 sendZoneRunPlanSend(simulation); + // 发送计划按钮是否闪烁 + sendRunPlanConfirmActiveMessage(simulation); } public void sendAllMessage(Simulation simulation, String userId) { sendAllTrackViewMessage(simulation, userId); sendAllRouteSequenceMessage(simulation, userId); - // 下发计划,用户初登陆时需要接收消息 - //sendZoneRunPlanSend(simulation); } private void trackViewUpdate(Simulation simulation) { @@ -73,7 +76,7 @@ public class CTCLogicLoop { line.startDelayDelete(); } } else { - remain -= LOGIC_RATE; + remain -= LOGIC_RATE; if (remain <= 0) { deleteTripNumbers.add(line.getTripNumber()); } else { @@ -359,6 +362,23 @@ public class CTCLogicLoop { } } + /** + * 运行计划发送计划 + */ + public void sendRunPlanConfirmActiveMessage(Simulation simulation) { + Map changeMap = new HashMap<>(); + simulation.getCtcRepository().getSimulationRunPlanMap().forEach((k, v) -> { + boolean isChange = v.values().stream().anyMatch(CtcStationRunPlanLog::isChange); + if (isChange) { + changeMap.put(k, Boolean.TRUE); + } + }); + if (!changeMap.isEmpty()) { + sendCtcMessage(simulation.getId(), changeMap, WebSocketMessageType.SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND + , simulation.getSimulationUserIds()); + } + } + /** * 发送CTC运行计划消息 * 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 eb23470aa..34ce71084 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 @@ -91,7 +91,6 @@ public class CtcRepository { * 运行日志消息状态 */ private final Map runPlanStatusVOMap = new ConcurrentHashMap<>(); - /******************************************* 以上为车站终端数据:车站为单位 *******************************************/ /** 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 367a50aaa..dbdd295ca 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 @@ -130,6 +130,11 @@ public class CtcStationRunPlanLog { */ private boolean twinkle; + /** + * 变化类型 + */ + private ChangeType changeType; + public CtcStationRunPlanLog(CtcRunPlanParam paramInfo) { this.planParam = paramInfo; this.code = paramInfo.getRunPlanCode(); @@ -251,6 +256,71 @@ public class CtcStationRunPlanLog { arriveRunPlan.setAdjacentMessageTime(""); } + /** + * 设置变化类型 + * + * @param type 变化类型 + */ + public void setChange(ChangeType type) { + this.changeType = type; + } + + /** + * 是否存在变化 + * + * @return 是否存在变化 + */ + public boolean isChange() { + return this.changeType != null; + } + + /** + * 清空变化状态 + */ + public void clearChange() { + this.changeType = null; + } + + /** + * 接车完成 + * + * @return 接车是否完成 + */ + public boolean arriveFinish() { + return this.arriveRunPlan != null && !StringUtils.isEmpty(this.arriveRunPlan.getActualTime()); + } + + public boolean arrivePlanTimeCheck(LocalDateTime planTime) { + if (this.arriveFinish() && planTime != null) { // 列车已到达 + // 在原计划之后,不合理 + return this.arriveRunPlan.getPlanTime().isBefore(planTime); + } + return true; + } + + /** + * 发车完成 + * + * @return 发车是否完成 + */ + public boolean departFinish() { + return this.departRunPlan != null && !StringUtils.isEmpty(this.departRunPlan.getActualTime()); + } + + public boolean departPlanTimeCheck(LocalDateTime planTime) { + if (this.departFinish() && planTime != null) { // 列车已发车 + return this.departRunPlan.getPlanTime().isAfter(planTime); + } + return true; + } + + /** + * 流程是否完成 + */ + public boolean isFinish() { + return this.arriveFinish() && this.departFinish(); + } + @Setter @Getter public static class RunPlanItem { @@ -348,6 +418,7 @@ public class CtcStationRunPlanLog { */ private String adjacentMessageTime; + public RunPlanItem(CtcRunPlanParam paramInfo) { this.paramInfo = paramInfo; this.actualTime = ""; @@ -596,4 +667,22 @@ public class CtcStationRunPlanLog { this.optionName = optionName; } } + + /** + * 行车日志变化类型 + */ + public enum ChangeType { + /** + * 状态变化,增加 + */ + STATUS_ADD_CHANGE, + /** + * 状态变化,删除 + */ + STATUS_DELETE_CHANGE, + /** + * 状态变化,变更 + */ + STATUS_MODIFY_CHANGE, + } } diff --git a/src/main/java/club/joylink/rtss/vo/client/WebSocketMessageType.java b/src/main/java/club/joylink/rtss/vo/client/WebSocketMessageType.java index ca8e45227..c787c6ee9 100644 --- a/src/main/java/club/joylink/rtss/vo/client/WebSocketMessageType.java +++ b/src/main/java/club/joylink/rtss/vo/client/WebSocketMessageType.java @@ -369,10 +369,15 @@ public enum WebSocketMessageType { SIMULATION_CTC_RUN_PLAN_CHANGE, /** - * 仿真 + * 仿真CTC运行计划发生删除 */ SIMULATION_CTC_RUN_PLAN_REMOVE, + /** + * 仿真CTC运行计划【发送计划】按钮闪烁标识 + */ + SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND, + /** * 调度命令 */ diff --git a/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java b/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java index 1aa6d26e7..1e0f38549 100644 --- a/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java +++ b/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java @@ -111,6 +111,7 @@ public class SocketMessageFactory { case SIMULATION_CTC_RUN_PLAN_INIT: case SIMULATION_CTC_RUN_PLAN_CHANGE: case SIMULATION_CTC_RUN_PLAN_REMOVE: + case SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND: case SIMULATION_RAIL_CTC_DISPATCH_COMMAND: case Simulation_RailCtcStatus: { topicList.add(SimulationSubscribeTopic.Ctc.buildDestination(group));