diff --git a/src/main/java/club/joylink/rtss/services/runplan/RunPlanGenerator.java b/src/main/java/club/joylink/rtss/services/runplan/RunPlanGenerator.java index 36da9071a..c2b7449b5 100644 --- a/src/main/java/club/joylink/rtss/services/runplan/RunPlanGenerator.java +++ b/src/main/java/club/joylink/rtss/services/runplan/RunPlanGenerator.java @@ -425,23 +425,31 @@ public class RunPlanGenerator { } } + if(!inputData.hasOutAndInBound()){ + serviceTripList.getFirst().setIsOutbound(true); + serviceTripList.getLast().setIsInbound(true); + } if (inputData.hasOutAndInBound()) { //找最快回库交路 RunPlanRoutingVO inboundRouting; if (loop) { inboundRouting = inboundRoutings.stream().filter(inRouting -> - Objects.equals(inRouting.getStartStationCode(), otherLoop.getStartStationCode())/*&& Objects.equals(inRouting.getRight(), otherLoop.getRight())*/) + Objects.equals(inRouting.getStartSectionCode(), otherLoop.getStartSectionCode())/*&& Objects.equals(inRouting.getRight(), otherLoop.getRight())*/) .sorted(Comparator.comparingInt(o -> o.getParkSectionCodeList().size())) .findFirst().orElse(null); } else { inboundRouting = inboundRoutings.stream().filter(inRouting -> - Objects.equals(inRouting.getStartStationCode(), outRefLoop.getStartStationCode())/*&& Objects.equals(inRouting.getRight(), outRefLoop.getRight())*/) + Objects.equals(inRouting.getStartSectionCode(), outRefLoop.getStartSectionCode())/*&& Objects.equals(inRouting.getRight(), outRefLoop.getRight())*/) .sorted(Comparator.comparingInt(o -> o.getParkSectionCodeList().size())) .findFirst().orElse(null); } BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(Objects.isNull(inboundRouting), String.format("起始区段[%s]的入库交路不存在", loop ? mapVO.findSection(otherLoop.getStartSectionCode()).getName() : mapVO.findSection(outRefLoop.getStartSectionCode()).getName())); //构建回库计划 - inputData.setInboundRouting(inboundRouting); +// inputData.setInboundRouting(inboundRouting); + //判断回库是否从终点区段开始 + //如果不是 从上一次的车站 + + buildServiceTrip(inputData, mapVO, inboundRouting, runLevelMap, parkTimeMap, reentryData, serviceTripList, nextTripNumber); } return serviceTripList; diff --git a/src/main/java/club/joylink/rtss/vo/client/runplan/RunPlanTripVO.java b/src/main/java/club/joylink/rtss/vo/client/runplan/RunPlanTripVO.java index b2701a49b..5f0f00b76 100644 --- a/src/main/java/club/joylink/rtss/vo/client/runplan/RunPlanTripVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/runplan/RunPlanTripVO.java @@ -117,7 +117,7 @@ public class RunPlanTripVO { public RunPlanTripVO(RunPlanRoutingVO routingVO) { this.right = routingVO.getRight(); - this.destinationCode = routingVO.getDestinationCode(); + this.destinationCode = Objects.isNull(routingVO.getDestinationCode()) ? "" : routingVO.getDestinationCode(); this.startSectionCode = routingVO.getStartSectionCode(); this.endSectionCode = routingVO.getEndSectionCode(); this.timeList = new ArrayList<>(); diff --git a/src/main/java/club/joylink/rtss/vo/runplan/RunPlanInputData.java b/src/main/java/club/joylink/rtss/vo/runplan/RunPlanInputData.java index d1f01e2eb..38d02adbe 100644 --- a/src/main/java/club/joylink/rtss/vo/runplan/RunPlanInputData.java +++ b/src/main/java/club/joylink/rtss/vo/runplan/RunPlanInputData.java @@ -50,9 +50,9 @@ public class RunPlanInputData { private boolean outAndIn = false; - /**回库交路*/ - @JsonIgnore - private RunPlanRoutingVO inboundRouting; +// /**回库交路*/ +// @JsonIgnore +// private RunPlanRoutingVO inboundRouting; @JsonIgnore public boolean multiService() {