Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
joylink_zhangsai 2022-07-25 18:09:08 +08:00
commit 15d7ebd7f1
9 changed files with 111 additions and 56 deletions

View File

@ -4,8 +4,7 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.cbtc.ATS.operation.vo.CtcRunPlanParam; import club.joylink.rtss.simulation.cbtc.ATS.operation.vo.CtcRunPlanParam;
import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcRunPlanVO; import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcRunPlanVO;
import club.joylink.rtss.simulation.cbtc.data.map.StationDirection; import club.joylink.rtss.simulation.cbtc.data.map.StationDirection;
import lombok.Getter; import lombok.*;
import lombok.Setter;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -281,9 +280,10 @@ public class CtcEffectRepository {
/** /**
* 阶段计划数据 * 阶段计划数据
*/ */
@Getter @Data
@Setter @NoArgsConstructor
public class CtcStageRunPlanRepository { @AllArgsConstructor
public static class CtcStageRunPlanRepository {
/** /**
* 车站编码 * 车站编码
*/ */
@ -292,7 +292,7 @@ public class CtcEffectRepository {
/** /**
* 当前数据版本 * 当前数据版本
*/ */
private AtomicInteger version; private AtomicInteger version = new AtomicInteger(0);
/** /**
* 最近变更时间 * 最近变更时间
@ -353,9 +353,10 @@ public class CtcEffectRepository {
return new CtcStageRunPlanVO(this); return new CtcStageRunPlanVO(this);
} }
@Getter @Data
@Setter @NoArgsConstructor
public class CtcStageRunPlanVO { @AllArgsConstructor
public static class CtcStageRunPlanVO {
private String stationCode; private String stationCode;
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ -385,7 +386,7 @@ public class CtcEffectRepository {
/** /**
* 当前数据版本 * 当前数据版本
*/ */
protected AtomicInteger version; protected AtomicInteger version = new AtomicInteger(0);
/** /**
* 最近变更时间 * 最近变更时间
@ -418,8 +419,7 @@ public class CtcEffectRepository {
/** /**
* 车站股道数据 * 车站股道数据
*/ */
@Setter @Data
@Getter
public static class StationTrackSectionRepository extends AbstractWorkspaceRepository<TrackSection> { public static class StationTrackSectionRepository extends AbstractWorkspaceRepository<TrackSection> {
/** /**
* 保存 * 保存
@ -446,8 +446,7 @@ public class CtcEffectRepository {
/** /**
* 车站出入口 * 车站出入口
*/ */
@Setter @Data
@Getter
public static class StationDoorRepository extends AbstractWorkspaceRepository<StationDirection> { public static class StationDoorRepository extends AbstractWorkspaceRepository<StationDirection> {
private final Map<String, StationDirection> trackSectionMap = new ConcurrentHashMap<>(); private final Map<String, StationDirection> trackSectionMap = new ConcurrentHashMap<>();
@ -465,10 +464,8 @@ public class CtcEffectRepository {
/** /**
* 固定进路信息 * 固定进路信息
*/ */
@Setter @Data
@Getter
public static class StationRunPlanRepository extends AbstractWorkspaceRepository<CtcRunPlanParam> { public static class StationRunPlanRepository extends AbstractWorkspaceRepository<CtcRunPlanParam> {
/** /**
* 保存运行计划 * 保存运行计划
* *
@ -498,10 +495,6 @@ public class CtcEffectRepository {
return this.dataMap.containsKey(code); return this.dataMap.containsKey(code);
} }
public StationRunPlanRepository() {
this.version = new AtomicInteger(0);
}
public List<CtcRunPlanParam> getAllRunPlanParam() { public List<CtcRunPlanParam> getAllRunPlanParam() {
return this.dataMap.values().stream().collect(Collectors.toList()); return this.dataMap.values().stream().collect(Collectors.toList());
} }

View File

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

View File

@ -2,8 +2,9 @@ package club.joylink.rtss.simulation.cbtc.CTC.data.vo;
import club.joylink.rtss.simulation.cbtc.ATS.operation.vo.CtcRunPlanParam; import club.joylink.rtss.simulation.cbtc.ATS.operation.vo.CtcRunPlanParam;
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcStationRunPlanLog; import club.joylink.rtss.simulation.cbtc.CTC.data.CtcStationRunPlanLog;
import lombok.Getter; import lombok.AllArgsConstructor;
import lombok.Setter; import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -11,8 +12,9 @@ import java.time.LocalDateTime;
/** /**
* 阶段对比 * 阶段对比
*/ */
@Setter @Data
@Getter @NoArgsConstructor
@AllArgsConstructor
public class CtcRunPlanVO { public class CtcRunPlanVO {
/** /**
* 车站编码 * 车站编码
@ -90,8 +92,9 @@ public class CtcRunPlanVO {
return new CtcRunPlanStatusVO(this); return new CtcRunPlanStatusVO(this);
} }
@Setter @Data
@Getter @NoArgsConstructor
@AllArgsConstructor
public static class CtcRunPlanStatusVO { public static class CtcRunPlanStatusVO {
/** /**
* 车站编码 * 车站编码

View File

@ -69,6 +69,8 @@ public class StorageSimulation {
simulation.setPlanRunning(this.planRunning); simulation.setPlanRunning(this.planRunning);
simulation.setPlanLoaded(planLoaded); simulation.setPlanLoaded(planLoaded);
repository.recover2Simulation(simulation, simulation.getRepository()); repository.recover2Simulation(simulation, simulation.getRepository());
ctcDataRepository.recover2Simulation(simulation, simulation.getCtcRepository()); if (ctcDataRepository != null) {
ctcDataRepository.recover2Simulation(simulation, simulation.getCtcRepository());
}
} }
} }

View File

@ -1,16 +1,18 @@
package club.joylink.rtss.simulation.cbtc.data.storage.plan; package club.joylink.rtss.simulation.cbtc.data.storage.plan;
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcEffectRepository; import club.joylink.rtss.simulation.cbtc.CTC.data.CtcEffectRepository;
import lombok.Getter; import lombok.AllArgsConstructor;
import lombok.Setter; import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map; import java.util.Map;
/** /**
* CTC生效区数据 * CTC生效区数据
*/ */
@Setter @Data
@Getter @NoArgsConstructor
@AllArgsConstructor
public class StorageCtcEffectData { public class StorageCtcEffectData {
/** /**

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

View File

@ -42,6 +42,8 @@ public class StorageCtcZoneData {
* @return * @return
*/ */
public void convert(CtcZoneRepository repository) { public void convert(CtcZoneRepository repository) {
stationRunPlanMap.forEach((k, v) -> repository.getStationRunPlanMap().put(k, v)); if (stationRunPlanMap != null) {
stationRunPlanMap.forEach((k, v) -> repository.getStationRunPlanMap().put(k, v));
}
} }
} }

View File

@ -52,6 +52,12 @@ public class MemberManager {
if (simulation.getRepository().getConfig().isRailway()) { if (simulation.getRepository().getConfig().isRailway()) {
// this.addRole(simulation, SimulationMember.Type.RAIL_CTC, null, station); // this.addRole(simulation, SimulationMember.Type.RAIL_CTC, null, station);
this.addRole(simulation, SimulationMember.Type.STATION_ASSISTANT, null, station); this.addRole(simulation, SimulationMember.Type.STATION_ASSISTANT, null, station);
this.addRole(simulation, SimulationMember.Type.STATION_MASTER, null, station);
this.addRole(simulation, SimulationMember.Type.STATION_SIGNALER, null, station);
this.addRole(simulation, SimulationMember.Type.STATION_PASSENGER, null, station);
this.addRole(simulation, SimulationMember.Type.STATION_SWITCH_MAN, null, station);
this.addRole(simulation, SimulationMember.Type.STATION_FACILITATOR, null, station);
this.addRole(simulation, SimulationMember.Type.STATION_WORKER, null, station);
} }
} }
// 司机 // 司机

View File

@ -113,32 +113,70 @@ public class SimulationMember extends club.joylink.rtss.simulation.SimulationMem
* 仿真成员岗位 * 仿真成员岗位
*/ */
public enum Type { public enum Type {
/** 中心调度员 */ /**
* 中心调度员
*/
DISPATCHER, DISPATCHER,
/** 工电调度 */ /**
* 工电调度
*/
ELECTRIC_DISPATCHER, ELECTRIC_DISPATCHER,
/** 车辆段调度 */ /**
* 车辆段调度
*/
DEPOT_DISPATCHER, DEPOT_DISPATCHER,
/** 车站值班员 */ /**
* 车站值班员
*/
STATION_SUPERVISOR, STATION_SUPERVISOR,
/** 司机 */ /**
* 司机
*/
DRIVER, DRIVER,
/** 通号 */ /**
* 通号
*/
MAINTAINER, MAINTAINER,
/** 车辆段信号楼 */ /**
* 车辆段信号楼
*/
DEPOT_SIGNAL_BUILDING, DEPOT_SIGNAL_BUILDING,
/** 停车场信号楼 */ /**
* 停车场信号楼
*/
PARKING_LOT_SIGNAL_BUILDING, PARKING_LOT_SIGNAL_BUILDING,
/** 上级部门 */ /**
* 上级部门
*/
PARENT_DEPARTMENT, PARENT_DEPARTMENT,
/** 派班员 */ /**
* 派班员
*/
SCHEDULING, SCHEDULING,
/** /**
* 大铁CTC * 大铁CTC
*/ */
RAIL_CTC, RAIL_CTC,
/** 车站助理 */ /**
STATION_ASSISTANT * 车站助理
*/
STATION_ASSISTANT,
/*** 车站站长 */
STATION_MASTER,
/**
* 车站信号员
*/
STATION_SIGNALER,
/**
* 车站客运员
*/
STATION_PASSENGER,
/*** 车站扳道员 */
STATION_SWITCH_MAN,
/*** 车站引导员 */
STATION_FACILITATOR,
/*** 车站工务工*/
STATION_WORKER,
} }
public enum Gender { public enum Gender {