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 fcacf576e..18d287580 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 @@ -2,13 +2,8 @@ package club.joylink.rtss.simulation.cbtc.CTC.data; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import lombok.Getter; -import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.ConcurrentHashMap; +import java.util.*; @Getter public class CtcRepository { @@ -50,13 +45,10 @@ public class CtcRepository { } public CtcStationRunPlanLog getRunPlan(String stationCode, String tripNumber) { - List plans = this.getCtcStationRunPlanLogMap().get(stationCode); - CtcStationRunPlanLog plan = null; - if (!CollectionUtils.isEmpty(plans)) { - plan = plans.stream().filter(runPlan -> Objects.equals(runPlan.getTripNumber(), tripNumber)) - .limit(1).findAny().orElse(null); - } - BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(plan, String.format("车站[%s]的车次[%s]计划不存在", stationCode, tripNumber)); + CtcStationRunPlanLog plan = ctcStationRunPlanLogList.stream() + .filter(p -> Objects.equals(p.getStation().getCode(), stationCode) && Objects.equals(p.getTripNumber(), tripNumber)) + .limit(1).findAny().orElse(null); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(plan); return plan; } 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 f269f637b..42b54e62d 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 @@ -1,7 +1,6 @@ package club.joylink.rtss.vo.client.factory; import club.joylink.rtss.constants.BusinessConsts.WebSocketSubscribeTopic; -import club.joylink.rtss.simulation.cbtc.CTC.data.BusyBoard; import club.joylink.rtss.simulation.cbtc.CTC.data.CtcStationRunPlanLog; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.communication.vo.TrainPosition; @@ -392,10 +391,6 @@ public class SocketMessageFactory { return build(WebSocketMessageType.Simulation_Trip_Plan_Change, simulationId, eChartsDataVO); } - public static SocketMessageVO> buildRailCtcMessage(String simulationId, List list) { - return build(WebSocketMessageType.Simulation_RailCtcStatus, simulationId, list); - } - /** * CTC 列车运行计划初始化消息 */