【修改阶段计划列表实体结构】

This commit is contained in:
weizhihong 2022-06-28 08:41:19 +08:00
parent de3435cfd9
commit 1fd327136f
3 changed files with 32 additions and 33 deletions

View File

@ -387,122 +387,121 @@ public class CtcRunPlanParam implements Cloneable {
* @return 修改过的字段
*/
public CtcRunPlanParam compareAndChange(CtcRunPlanParam origin, CtcRunPlanParam modify) {
this.setRunPlanCode(modify.getRunPlanCode());
boolean change = false;
if (!Objects.equals(origin.getStationCode(), modify.getStationCode())) {
this.stationCode = modify.getStationCode();
this.stationCode = origin.getStationCode();
change = true;
}
if (!Objects.equals(origin.getTripNumber(), modify.getTripNumber())) {
this.tripNumber = modify.getTripNumber();
this.tripNumber = origin.getTripNumber();
change = true;
}
if (!Objects.equals(origin.getGroupNumber(), modify.getGroupNumber())) {
this.groupNumber = modify.getGroupNumber();
this.groupNumber = origin.getGroupNumber();
change = true;
}
if (!Objects.equals(origin.getTrackSectionCode(), modify.getTrackSectionCode())) {
this.trackSectionCode = modify.getTrackSectionCode();
this.trackSectionCode = origin.getTrackSectionCode();
change = true;
}
if (!Objects.equals(origin.getArriveSectionCode(), modify.getArriveSectionCode())) {
this.arriveSectionCode = modify.getArriveSectionCode();
this.arriveSectionCode = origin.getArriveSectionCode();
change = true;
}
if (!Objects.equals(origin.getDepartSectionCode(), modify.getDepartSectionCode())) {
this.departSectionCode = modify.getDepartSectionCode();
this.departSectionCode = origin.getDepartSectionCode();
change = true;
}
if (!Objects.equals(origin.getArriveTime(), modify.getArriveTime())) {
this.arriveTime = modify.getArriveTime();
this.arriveTime = origin.getArriveTime();
change = true;
}
if (!Objects.equals(origin.getDepartTime(), modify.getDepartTime())) {
this.departTime = modify.getDepartTime();
this.departTime = origin.getDepartTime();
change = true;
}
if (!Objects.equals(origin.getArriveTripNumber(), modify.getArriveTripNumber())) {
this.arriveTripNumber = modify.getArriveTripNumber();
this.arriveTripNumber = origin.getArriveTripNumber();
change = true;
}
if (!Objects.equals(origin.getDepartTripNumber(), modify.getDepartTripNumber())) {
this.departTripNumber = modify.getDepartTripNumber();
this.departTripNumber = origin.getDepartTripNumber();
change = true;
}
if (!Objects.equals(origin.getArriveStationCode(), modify.getArriveStationCode())) {
this.arriveStationCode = modify.getArriveStationCode();
this.arriveStationCode = origin.getArriveStationCode();
change = true;
}
if (!Objects.equals(origin.getDepartStationCode(), modify.getDepartStationCode())) {
this.departStationCode = modify.getDepartStationCode();
this.departStationCode = origin.getDepartStationCode();
change = true;
}
if (!Objects.equals(origin.getArriveDirectionCode(), modify.getArriveDirectionCode())) {
this.arriveDirectionCode = modify.getArriveDirectionCode();
this.arriveDirectionCode = origin.getArriveDirectionCode();
change = true;
}
if (!Objects.equals(origin.getDepartDirectionCode(), modify.getDepartDirectionCode())) {
this.departDirectionCode = modify.getDepartDirectionCode();
this.departDirectionCode = origin.getDepartDirectionCode();
change = true;
}
// 到达计划时间
if (!Objects.equals(origin.getArrivePlanTime(), modify.getArrivePlanTime())) {
this.arrivePlanTime = modify.getArrivePlanTime();
this.arrivePlanTime = origin.getArrivePlanTime();
change = true;
}
// 出发计划时间
if (!Objects.equals(origin.getDepartPlanTime(), modify.getDepartPlanTime())) {
this.departPlanTime = modify.getDepartPlanTime();
this.departPlanTime = origin.getDepartPlanTime();
change = true;
}
// 始发
if (!Objects.equals(origin.getStartRunPlan(), modify.getStartRunPlan())) {
this.startRunPlan = modify.getStartRunPlan();
this.startRunPlan = origin.getStartRunPlan();
change = true;
}
// 终到
if (!Objects.equals(origin.getEndRunPlan(), modify.getEndRunPlan())) {
this.endRunPlan = modify.getEndRunPlan();
this.endRunPlan = origin.getEndRunPlan();
change = true;
}
// 电力计划
if (!Objects.equals(origin.getElectrical(), modify.getElectrical())) {
this.electrical = modify.getElectrical();
this.electrical = origin.getElectrical();
change = true;
}
// 办理客运
if (!Objects.equals(origin.getPassenger(), modify.getPassenger())) {
this.passenger = modify.getPassenger();
this.passenger = origin.getPassenger();
change = true;
}
// 重点列车
if (!Objects.equals(origin.getKeyTrains(), modify.getKeyTrains())) {
this.keyTrains = modify.getKeyTrains();
this.keyTrains = origin.getKeyTrains();
change = true;
}
// 是否军用
if (!Objects.equals(origin.getMilitary(), modify.getMilitary())) {
this.military = modify.getMilitary();
this.military = origin.getMilitary();
change = true;
}
// 运行股道与基本径路不一致
if (!Objects.equals(origin.getTrackDiscordant(), modify.getTrackDiscordant())) {
this.trackDiscordant = modify.getTrackDiscordant();
this.trackDiscordant = origin.getTrackDiscordant();
change = true;
}
// 出入口与基本径路不一致
if (!Objects.equals(origin.getEntryOutDiscordant(), modify.getEntryOutDiscordant())) {
this.entryOutDiscordant = modify.getTrackDiscordant();
this.entryOutDiscordant = origin.getTrackDiscordant();
change = true;
}
// 超限等级
if (!Objects.equals(origin.getTransfinite(), modify.getTransfinite())) {
this.transfinite = modify.getTransfinite();
this.transfinite = origin.getTransfinite();
change = true;
}
// 状态
if (!Objects.equals(origin.getStatus(), modify.getStatus())) {
this.status = modify.getStatus();
this.status = origin.getStatus();
change = true;
}
return change ? this : null;

View File

@ -197,13 +197,13 @@ public class CtcStationRunPlanLogService {
CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository()
.getRunPlanByRunPlanCodeAndStationCode(stationCode, ctcRunPlanVO.getRunPlanCode());
if (runPlanLog != null) {
runPlanLog.setBaseAttribute(ctcRunPlanVO.getOriginRunPlan());
runPlanLog.setBaseAttribute(ctcRunPlanVO.getRunPlan());
// 到达
modifyRunPlanItemInfo(simulation, runPlanLog.getArriveRunPlan(), ctcRunPlanVO.getOriginRunPlan(), true);
modifyRunPlanItemInfo(simulation, runPlanLog.getArriveRunPlan(), ctcRunPlanVO.getRunPlan(), true);
// 出发
modifyRunPlanItemInfo(simulation, runPlanLog.getDepartRunPlan(), ctcRunPlanVO.getOriginRunPlan(), false);
modifyRunPlanItemInfo(simulation, runPlanLog.getDepartRunPlan(), ctcRunPlanVO.getRunPlan(), false);
} else {
runPlanLog = createRunPlanLog(simulation, stationCode, ctcRunPlanVO.getOriginRunPlan());
runPlanLog = createRunPlanLog(simulation, stationCode, ctcRunPlanVO.getRunPlan());
simulation.getCtcRepository().addRunPlanToSimulationMap(runPlanLog);
}
});

View File

@ -23,7 +23,7 @@ public class CtcRunPlanVO {
/**
* 当前运行计划
*/
private CtcRunPlanParam originRunPlan;
private CtcRunPlanParam runPlan;
/**
* 修改过的字段信息
@ -34,7 +34,7 @@ public class CtcRunPlanVO {
this.stationCode = runPlanParam.getStationCode();
this.runPlanCode = runPlanParam.getRunPlanCode();
// 修改前的运行计划
this.originRunPlan = runPlanParam.clone();
this.runPlan = runPlanParam.clone();
}
/**