From a8a0450093493de13f6a1e9cc7b970f5dd55b08a Mon Sep 17 00:00:00 2001 From: DU Date: Wed, 16 Dec 2020 18:29:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E5=88=B6=E8=AE=A1?= =?UTF-8?q?=E5=88=92bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/services/RunPlanDraftService.java | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) 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); // 构建类车到站数据