diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/runplan/CtcManageService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/runplan/CtcManageService.java index 6178ff767..38b4c3c01 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/runplan/CtcManageService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/runplan/CtcManageService.java @@ -21,6 +21,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import javax.annotation.Resource; +import java.time.LocalTime; import java.util.*; @Component @@ -276,15 +277,27 @@ public class CtcManageService { BusinessExceptionAssertEnum.DATA_ERROR.assertNotTrue(Strings.isNullOrEmpty(rt.getPrefixTrain()), String.format("批量添加车次前缀不能为空")); BusinessExceptionAssertEnum.DATA_ERROR.assertNotTrue((Objects.isNull(rt.getStartTipNum()) || Objects.isNull(rt.getEndTipNum())), String.format("批量添加车次号开始或结束不能为空")); BusinessExceptionAssertEnum.DATA_ERROR.assertNotTrue(rt.getEndTipNum() < rt.getStartTipNum(), String.format("批量添加车次号结束不能小于车次号开始")); + int min = 0; for(var start = rt.getStartTipNum() ; start <= rt.getEndTipNum();start++){ RegularTrainLineVO newRt = rt.clone(); String tipNum = rt.getPrefixTrain().concat(start.toString()); newRt.setArriveTipNum(tipNum); + newRt.setLeaveTipNum(tipNum); + //批量处理默认到达离开时间 + if(min > 0){ + //除了第一次剩下的到达时间晚3分钟; + min += 3 * 60; + } + newRt.setArriveTime(LocalTime.ofSecondOfDay(min)); + //离开时间加5分钟 + min += 5 * 60; + newRt.setLeaveTime(LocalTime.ofSecondOfDay(min)); this.editRegularTrain(simulation,stationCode,newRt,true); - } + } + /** * 编辑区的列车经路列表 * @param simulation