diff --git a/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java b/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java index 504251cd2..a58d03b2c 100644 --- a/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java +++ b/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java @@ -442,20 +442,23 @@ public class RunPlanDraftService implements IRunPlanDraftService { // 查询交路 // MapRoutingDataVO routingData = mapVO.findRoutingDataByCode(tripConfigVO.getRoutingCode()); RunPlanRoutingVO routingData = userRoutingMap.get(tripConfigVO.getRoutingCode()); - String endReentrySectionCode = userReentryData.get(routingData.getEndStationCode()); - String startReentrySectionCode = userReentryData.get(routingData.getStartStationCode()); + String endSectionCode = routingData.getEndSectionCode(); + String startSectionCode = routingData.getStartSectionCode(); + MapSectionNewVO endSection = mapVO.findSectionNew(endSectionCode); MapSectionNewVO endReentrySection = null; - if (Objects.nonNull(endReentrySectionCode)) { - endReentrySection = mapVO.findSectionNew(endReentrySectionCode); - } else { - throw BusinessExceptionAssertEnum.DATA_NOT_EXIST.exception("车站" + routingData.getEndStationCode() + "折返轨未设置"); + if(endSection.isStandTrack()) { + String endReentrySectionCode = userReentryData.get(routingData.getEndStationCode()); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(endReentrySectionCode,"车站" + routingData.getEndStationCode() + "折返轨未设置"); + endReentrySection = mapVO.findSectionNew(endReentrySectionCode); } + MapSectionNewVO startSection = mapVO.findSectionNew(startSectionCode); MapSectionNewVO startReentrySection = null; - if (Objects.nonNull(startReentrySectionCode)) { - startReentrySection = mapVO.findSectionNew(startReentrySectionCode); - } else { - throw BusinessExceptionAssertEnum.DATA_NOT_EXIST.exception("车站" + routingData.getStartStationCode() + "折返轨未设置"); + if(startSection.isStandTrack()) { + String startReentrySectionCode = userReentryData.get(routingData.getStartStationCode()); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(startReentrySectionCode,"车站" + routingData.getStartStationCode() + "折返轨未设置"); + startReentrySection = mapVO.findSectionNew(startReentrySectionCode); } + RunPlanTripVO tripVO = new RunPlanTripVO(tripConfigVO, routingData, startReentrySection, endReentrySection); if (mapVO.getConfigVO().getUpRight()) { if (routingData.getRight()) { @@ -692,19 +695,21 @@ public class RunPlanDraftService implements IRunPlanDraftService { // 查询交路 // MapRoutingDataVO routing = mapVO.findRoutingDataByCode(tripConfig.getRoutingCode()); RunPlanRoutingVO routingData = userRoutingMap.get(tripConfig.getRoutingCode()); - String endReentrySectionCode = userReentryData.get(routingData.getEndStationCode()); - String startReentrySectionCode = userReentryData.get(routingData.getStartStationCode()); + String endSectionCode = routingData.getEndSectionCode(); + String startSectionCode = routingData.getStartSectionCode(); + MapSectionNewVO endSection = mapVO.findSectionNew(endSectionCode); MapSectionNewVO endReentrySection = null; - if (Objects.nonNull(endReentrySectionCode)) { - endReentrySection = mapVO.findSectionNew(endReentrySectionCode); - } else { - throw BusinessExceptionAssertEnum.DATA_NOT_EXIST.exception("车站" + routingData.getEndStationCode() + "折返轨未设置"); + if(endSection.isStandTrack()) { + String endReentrySectionCode = userReentryData.get(routingData.getEndStationCode()); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(endReentrySectionCode,"车站" + routingData.getEndStationCode() + "折返轨未设置"); + endReentrySection = mapVO.findSectionNew(endReentrySectionCode); } + MapSectionNewVO startSection = mapVO.findSectionNew(startSectionCode); MapSectionNewVO startReentrySection = null; - if (Objects.nonNull(startReentrySectionCode)) { - startReentrySection = mapVO.findSectionNew(startReentrySectionCode); - } else { - throw BusinessExceptionAssertEnum.DATA_NOT_EXIST.exception("车站" + routingData.getStartStationCode() + "折返轨未设置"); + if(startSection.isStandTrack()) { + String startReentrySectionCode = userReentryData.get(routingData.getStartStationCode()); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(startReentrySectionCode,"车站" + routingData.getStartStationCode() + "折返轨未设置"); + startReentrySection = mapVO.findSectionNew(startReentrySectionCode); } tripVO = new RunPlanTripVO(tripConfig, routingData, startReentrySection, endReentrySection); // 构建类车到站数据