【增加红闪限制条件】
This commit is contained in:
parent
2bb21db602
commit
6c1c90bc81
@ -239,7 +239,7 @@ public class CtcStationRunPlanLogService {
|
||||
CtcStationRunPlanLog ctcStationRunPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
|
||||
if (!Objects.equals(ctcStationRunPlanLog.getDelete(), Boolean.TRUE)) {
|
||||
ctcStationRunPlanLog.setDelete(Boolean.TRUE);
|
||||
ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_DELETE_CHANGE);
|
||||
// ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_DELETE_CHANGE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -379,6 +379,8 @@ public class CtcStationRunPlanLogService {
|
||||
* @param runPlanCode 运行计划编码
|
||||
*/
|
||||
public void cancelTwinkle(Simulation simulation, String stationCode, String runPlanCode) {
|
||||
boolean isExist = simulation.getCtcRepository().getCtcEffectRepository().isExistStageRunPlan(stationCode, null);
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotTrue(isExist, "存在未签收的阶段计划");
|
||||
CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
|
||||
runPlanLog.setTwinkle(false);
|
||||
}
|
||||
|
@ -151,13 +151,27 @@ public class CtcEffectRepository {
|
||||
return null;
|
||||
}
|
||||
return this.stationStageRunPlanMap.values().stream()
|
||||
.filter(r -> {
|
||||
Integer oldVersion = this.getStageRunPlanVersionMap().get(r.getStationCode());
|
||||
return !CollectionUtils.isEmpty(r.getCtcRunPlanVOList()) && (oldVersion == null || oldVersion < r.getVersion().get());
|
||||
})
|
||||
.filter(r -> isExistStageRunPlan(r.getStationCode(), r))
|
||||
.map(CtcStageRunPlanRepository::generateStatus).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否存在阶段计划
|
||||
*
|
||||
* @param stationCode 车站编码
|
||||
* @param r 阶段计划
|
||||
* @return 是否存在
|
||||
*/
|
||||
public boolean isExistStageRunPlan(String stationCode, CtcStageRunPlanRepository r) {
|
||||
CtcStageRunPlanRepository repository = r == null ? this.stationStageRunPlanMap.get(stationCode) : r;
|
||||
if (repository != null) {
|
||||
Integer oldVersion = this.getStageRunPlanVersionMap().get(repository.getStationCode());
|
||||
return !CollectionUtils.isEmpty(repository.getCtcRunPlanVOList())
|
||||
&& (oldVersion == null || oldVersion < repository.getVersion().get());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将修改的计划发布至申请区
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user