消除报错
This commit is contained in:
parent
22a85e3293
commit
c2239a1a68
@ -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<CtcStationRunPlanLog> 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;
|
||||
}
|
||||
|
||||
|
@ -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<List<BusyBoard>> buildRailCtcMessage(String simulationId, List<BusyBoard> list) {
|
||||
return build(WebSocketMessageType.Simulation_RailCtcStatus, simulationId, list);
|
||||
}
|
||||
|
||||
/**
|
||||
* CTC 列车运行计划初始化消息
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user