diff --git a/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java b/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java index 29b9526d3..33973e4c2 100644 --- a/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java +++ b/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java @@ -799,7 +799,7 @@ public class RunPlanDraftService implements IRunPlanDraftService { if(Objects.isNull(trips.get(trips.size() - 1).getIsInbound()) || !trips.get(trips.size() - 1).getIsInbound()){ errorList.add(String.format("服务号[%s]最后一班车次[%s]不是回库", s, trips.get(trips.size() - 1).getTripNumber())); } - LocalTime overTime = trips.get(trips.size() - 1).getEndTime(); + LocalTime overTime = trips.get(trips.size() - 1).getEndTime().plusHours(OFFSET_TIME_HOURS); //服务最后一班车次时间 <2:00 if (overTime.isAfter(LocalTime.of(2, 0)) && overTime.isBefore(LocalTime.of(4, 0))) { errorList.add(String.format("服务号[%s]最后一班车次结束时间[%s]太晚,应不晚于次日02:00", s, overTime)); @@ -888,6 +888,10 @@ public class RunPlanDraftService implements IRunPlanDraftService { continue; } Float distance = stationSpacingMap.get(tripTime.getSectionCode() + "-" + nextTripTime.getSectionCode()); + MapSectionNewVO startSection = map.findSection(tripTime.getSectionCode()); + if (startSection.isReentryTrack() && !startSection.isStandTrack()){ + continue; + } if (Objects.isNull(distance)) { errorList.add(String.format("服务号[%s]车次号[%s]从车站[%s]至车站[%s]缺少站间距离数据", s, trip.getTripNumber(), map.findStation(tripTime.getStationCode()).getName(), map.findStation(nextTripTime.getStationCode()).getName())); continue; @@ -983,8 +987,8 @@ public class RunPlanDraftService implements IRunPlanDraftService { cur.getServiceNumber(), cur.getTripNumber(), map.findStation(cur.getStationCode()).getName())); return; } - if (ChronoUnit.SECONDS.between(pre.getDepartureTime(), cur.getArrivalTime()) < 60) { - errorList.add(String.format("相邻车次[%s-%s] 与 车次[%s-%s]行车至车站[%s]时运行间隔太小不安全,应不小于1分钟", + if (ChronoUnit.SECONDS.between(pre.getDepartureTime(), cur.getArrivalTime()) < 45) { + errorList.add(String.format("相邻车次[%s-%s] 与 车次[%s-%s]行车至车站[%s]时运行间隔太小不安全,应不小于45秒", pre.getServiceNumber(), pre.getTripNumber(), cur.getServiceNumber(), cur.getTripNumber(),map.findStation(cur.getStationCode()).getName())); return; diff --git a/src/main/java/club/joylink/rtss/services/runplan/importReal/NingBoLine3RunPlanNew.java b/src/main/java/club/joylink/rtss/services/runplan/importReal/NingBoLine3RunPlanNew.java index b70c360f1..e66ad6c87 100644 --- a/src/main/java/club/joylink/rtss/services/runplan/importReal/NingBoLine3RunPlanNew.java +++ b/src/main/java/club/joylink/rtss/services/runplan/importReal/NingBoLine3RunPlanNew.java @@ -10,6 +10,8 @@ import club.joylink.rtss.vo.client.runplan.RunPlanTripVO; import lombok.extern.slf4j.Slf4j; import org.springframework.util.StringUtils; +import java.time.LocalTime; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -30,11 +32,30 @@ public class NingBoLine3RunPlanNew implements IRunPlanStrategyNew { public void importDataCheckAndPreHandle(List runPlanImportList, List stationList, String upDirection) { Map stationMap = stationList.stream().collect( Collectors.toMap(MapStationNewVO::getRunPlanName, Function.identity())); + //增加36203回库到奉化22:00 + RunPlanImport newTrip = new RunPlanImport(); + newTrip.setCode("36401"); + List newArrivalList = new ArrayList<>(); + newTrip.setArrivalList(newArrivalList); + RunPlanArrivalTime tripTime = new RunPlanArrivalTime(); + tripTime.setStationName("金海路"); + tripTime.setArriveTime(LocalTime.of(5,5,43)); + tripTime.setDepartureTime(LocalTime.of(21,59,30)); + RunPlanArrivalTime tripTime2 = new RunPlanArrivalTime(); + tripTime2.setStationName("奉化停车场"); + tripTime2.setArriveTime(LocalTime.of(22,0)); + tripTime2.setDepartureTime(LocalTime.of(22,0)); + newArrivalList.add(tripTime); + newArrivalList.add(tripTime2); + runPlanImportList.add(newTrip); runPlanImportList.forEach(runPlanImport -> { this.analyzeAndConvertCode(runPlanImport, upDirection); List arrivalList = runPlanImport.getArrivalList(); + if(runPlanImport.getCode().equals("36301")){ + arrivalList.remove(0); + } handleStationAndTime(stationMap, arrivalList); - if(Arrays.asList("36102", "36203","36301").contains(runPlanImport.getCode())){ + if(Arrays.asList("36102", "36203","36401","36301").contains(runPlanImport.getCode())){ runPlanImport.setBackup(true); } }); @@ -120,6 +141,9 @@ public class NingBoLine3RunPlanNew implements IRunPlanStrategyNew { case "体育馆": tripVO.setStartSectionCode("T442");//T4107 break; + case "樱花公园": + tripVO.setStartSectionCode("T442");//T4107 + break; } //Y316双休日 @@ -183,6 +207,9 @@ public class NingBoLine3RunPlanNew implements IRunPlanStrategyNew { // case "体育馆": // tripVO.setStartSectionCode("T442");//T4107 // break; +// case "樱花公园": +// tripVO.setStartSectionCode("T442");//T4107 +// break; // } } @@ -207,15 +234,19 @@ public class NingBoLine3RunPlanNew implements IRunPlanStrategyNew { //通用 if("奉化停车场".equals(stationVO.getRunPlanName())){ - if(runPlanImport.isBackup() && runPlanImport.getCode().equals("36203")){ + if(runPlanImport.isBackup() && (runPlanImport.getCode().equals("36203") ||runPlanImport.getCode().equals("36401"))){ timeVO.setSectionCode("T60"); //T2101 }else{ timeVO.setSectionCode("T62"); //T2102 } return; } + if("金海路".equals(stationVO.getRunPlanName()) && runPlanImport.getCode().equals("36401")){ + timeVO.setSectionCode("T4"); //T2101 + return; + } -// // Y316工作日 + // Y316工作日 // if("高塘桥".equals(stationVO.getRunPlanName())){ // if(Arrays.asList("36203","30603","30803").contains(runPlanImport.getCode())){ // timeVO.setSectionCode("T273");//T3015 diff --git a/src/main/java/club/joylink/rtss/vo/client/runplan/RunPlanImport.java b/src/main/java/club/joylink/rtss/vo/client/runplan/RunPlanImport.java index f337f07a2..f2abbd319 100644 --- a/src/main/java/club/joylink/rtss/vo/client/runplan/RunPlanImport.java +++ b/src/main/java/club/joylink/rtss/vo/client/runplan/RunPlanImport.java @@ -2,6 +2,7 @@ package club.joylink.rtss.vo.client.runplan; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; import lombok.Getter; import lombok.Setter;