【更新计划以及空指针判断】
This commit is contained in:
parent
fc4524efb6
commit
2d2c3d27b0
@ -203,13 +203,13 @@ public class CtcStationRunPlanLogService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 将变更运行计划刷新至行车日志
|
||||
* 将变更运行计划刷新至行车日志,这里需要加锁避免重复处理
|
||||
*
|
||||
* @param simulation 仿真
|
||||
* @param stationCode 车站编码
|
||||
* @param ctcRunPlanVOList 变更的运行计划列表
|
||||
*/
|
||||
public void doUpdateRunPlanLog(Simulation simulation, String stationCode, List<CtcRunPlanVO> ctcRunPlanVOList) {
|
||||
public synchronized void doUpdateRunPlanLog(Simulation simulation, String stationCode, List<CtcRunPlanVO> ctcRunPlanVOList) {
|
||||
if (CollectionUtils.isEmpty(ctcRunPlanVOList)) {
|
||||
return;
|
||||
}
|
||||
|
@ -168,15 +168,18 @@ public class CtcZoneService {
|
||||
.findFirst().orElse(null);
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(ctcZone);
|
||||
CtcEffectRepository effectRepository = simulation.getCtcRepository().getCtcEffectRepository();
|
||||
Set<String> stationCodeSet = new HashSet<>();
|
||||
ctcZone.getStationList().forEach(station -> {
|
||||
stationCodeSet.add(station.getCode());
|
||||
CtcManageRepository.StationRunPlanRepository runPlanRepository = zoneRepository.getStationRunPlanMap().get(station.getCode());
|
||||
if (runPlanRepository != null) {
|
||||
effectRepository.releaseRunPlanByStationCode(runPlanRepository, simulation.getCorrectSystemTime());
|
||||
}
|
||||
});
|
||||
updateStageRunPlan(simulation, stationCodeSet);
|
||||
if (ctcZone.getStationList() != null) {
|
||||
Set<String> stationCodeSet = new HashSet<>();
|
||||
ctcZone.getStationList().forEach(station -> {
|
||||
stationCodeSet.add(station.getCode());
|
||||
CtcManageRepository.StationRunPlanRepository runPlanRepository
|
||||
= zoneRepository.getStationRunPlanMap().get(station.getCode());
|
||||
if (runPlanRepository != null) {
|
||||
effectRepository.releaseRunPlanByStationCode(runPlanRepository, simulation.getCorrectSystemTime());
|
||||
}
|
||||
});
|
||||
updateStageRunPlan(simulation, stationCodeSet);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user