【剧本反序列化BUG】

This commit is contained in:
weizhihong 2022-07-25 15:24:06 +08:00
parent ee5be65ad5
commit 75f5c2b592
2 changed files with 20 additions and 11 deletions

View File

@ -205,10 +205,15 @@ public class CtcStationRunPlanLog {
this.transfinite = paramInfo.getTransfinite();
}
this.runPlanTaskItemMap = new HashMap<>(RunPlanTask.values().length); // 运行计划任务
RunPlanTask.getOptionKeyList().forEach(key -> this.runPlanTaskItemMap.put(key, new RunPlanTaskItem(RunPlanTask.NO)));
RunPlanTask.getOptionKeyList().stream().filter(k -> !RunPlanTask.NO.equals(k))
.forEach(key -> this.runPlanTaskItemMap.put(key, new RunPlanTaskItem(RunPlanTask.NO)));
paramInfo.getRunPlanTaskMap().forEach((k, v) -> {
if (v != null && v > 0) {
this.runPlanTaskItemMap.get(k.getOptionKey()).setType(k);
if (v != null && v > 0 && !RunPlanTask.NO.equals(k)) {
if (this.runPlanTaskItemMap.containsKey(k.getOptionKey())) {
this.runPlanTaskItemMap.get(k.getOptionKey()).setType(k);
} else {
this.runPlanTaskItemMap.put(k.getOptionKey(), new RunPlanTaskItem(k));
}
}
});
// 删除状态
@ -648,7 +653,7 @@ public class CtcStationRunPlanLog {
if (paramInfo.arriveAndDepartElectrical()) { // 存在指定电力设置则获取指定
Boolean electrical = arrive ? paramInfo.getArriveElectrical() : paramInfo.getDepartElectrical();
runPlanItem.setElectrical(electrical);
} else {
} else if (paramInfo.getElectrical() != null) {
runPlanItem.setElectrical(paramInfo.getElectrical());
}
// 超限等级

View File

@ -4,8 +4,7 @@ import club.joylink.rtss.simulation.cbtc.ATS.operation.vo.CtcRunPlanParam;
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcRepository;
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcStationRunPlanLog;
import club.joylink.rtss.simulation.cbtc.Simulation;
import lombok.Getter;
import lombok.Setter;
import lombok.*;
import java.time.LocalDateTime;
import java.util.Map;
@ -98,8 +97,12 @@ public class StorageCtcRunPlanLog {
if (sign != null) {
ctcStationRunPlanLog.setSign(sign);
}
this.departItemOtherInfo.convertToObj(ctcStationRunPlanLog.getDepartRunPlan());
this.arriveItemOtherInfo.convertToObj(ctcStationRunPlanLog.getArriveRunPlan());
if (this.departItemOtherInfo != null) {
this.departItemOtherInfo.convertToObj(ctcStationRunPlanLog.getDepartRunPlan());
}
if (this.arriveItemOtherInfo != null) {
this.arriveItemOtherInfo.convertToObj(ctcStationRunPlanLog.getArriveRunPlan());
}
}
private void setDepartAndArrive(CtcRunPlanParam ctcRunPlanParam, CtcStationRunPlanLog.RunPlanItem runPlanItem, boolean arrive) {
@ -166,9 +169,10 @@ public class StorageCtcRunPlanLog {
}
@Getter
@Setter
private class ItemOtherInfo {
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class ItemOtherInfo {
/**
* 实际时间
*/