车务管理终端功能代码调整

This commit is contained in:
tiger_zhou 2022-08-25 16:24:01 +08:00
parent 9d1a8c2fa5
commit d541f85aee

View File

@ -21,6 +21,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalTime;
import java.util.*; import java.util.*;
@Component @Component
@ -276,14 +277,26 @@ public class CtcManageService {
BusinessExceptionAssertEnum.DATA_ERROR.assertNotTrue(Strings.isNullOrEmpty(rt.getPrefixTrain()), String.format("批量添加车次前缀不能为空")); 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((Objects.isNull(rt.getStartTipNum()) || Objects.isNull(rt.getEndTipNum())), String.format("批量添加车次号开始或结束不能为空"));
BusinessExceptionAssertEnum.DATA_ERROR.assertNotTrue(rt.getEndTipNum() < rt.getStartTipNum(), String.format("批量添加车次号结束不能小于车次号开始")); BusinessExceptionAssertEnum.DATA_ERROR.assertNotTrue(rt.getEndTipNum() < rt.getStartTipNum(), String.format("批量添加车次号结束不能小于车次号开始"));
int min = 0;
for(var start = rt.getStartTipNum() ; start <= rt.getEndTipNum();start++){ for(var start = rt.getStartTipNum() ; start <= rt.getEndTipNum();start++){
RegularTrainLineVO newRt = rt.clone(); RegularTrainLineVO newRt = rt.clone();
String tipNum = rt.getPrefixTrain().concat(start.toString()); String tipNum = rt.getPrefixTrain().concat(start.toString());
newRt.setArriveTipNum(tipNum); 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); this.editRegularTrain(simulation,stationCode,newRt,true);
}
} }
}
/** /**
* 编辑区的列车经路列表 * 编辑区的列车经路列表