diff --git a/src/main/java/club/joylink/rtss/services/mapSystem/RtsMapSystemServiceImpl.java b/src/main/java/club/joylink/rtss/services/mapSystem/RtsMapSystemServiceImpl.java index f7e01330a..c42cd9b71 100644 --- a/src/main/java/club/joylink/rtss/services/mapSystem/RtsMapSystemServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/mapSystem/RtsMapSystemServiceImpl.java @@ -169,7 +169,9 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无行调成员,未生成%s", msgPrefix, name)); return null; } - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(true, false, false, false); + SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder() + .singleMember(true) + .build(); return buildCreateVO(mapId, name, name, simType, dispatcherOptional.get().getId(), domConfig); }; //ATS现地工作站 @@ -183,7 +185,9 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无行值成员,未生成%s", msgPrefix, name)); return null; } - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(true, false, false, false); + SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder() + .singleMember(true) + .build(); return buildCreateVO(mapId, name, name, simType, stationSupervisorOptional.get().getId(), domConfig); }; //司机模拟驾驶系统 @@ -200,7 +204,9 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无司机角色,未生成%s", msgPrefix, name)); return null; } - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(true, false, false, false); + SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder() + .singleMember(true) + .build(); return buildCreateVO(mapId, name, name, simType, memberOptional.get().getId(), domConfig); }; //ATS行调实训系统 @@ -214,7 +220,9 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无行调成员,未生成%s", msgPrefix, name)); return null; } - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(false, false, true, false); + SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder() + .hasTraining(true) + .build(); return buildCreateVO(mapId, name, name, simType, dispatcherOptional.get().getId(), domConfig); }; //ATS现地实训系统 @@ -228,7 +236,9 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无行值成员,未生成%s", msgPrefix, name)); return null; } - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(false, false, true, false); + SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder() + .hasTraining(true) + .build(); return buildCreateVO(mapId, name, name, simType, stationSupervisorOptional.get().getId(), domConfig); }; //ATS行调考试系统 @@ -242,7 +252,9 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无行调成员,未生成%s", msgPrefix, name)); return null; } - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(false, false, false, true); + SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder() + .hasExam(true) + .build(); return buildCreateVO(mapId, name, name, simType, dispatcherOptional.get().getId(), domConfig); }; //ATS现地实训系统 @@ -256,7 +268,9 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无行值成员,未生成%s", msgPrefix, name)); return null; } - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(false, false, false, true); + SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder() + .hasExam(true) + .build(); return buildCreateVO(mapId, name, name, simType, stationSupervisorOptional.get().getId(), domConfig); }; //综合演练 @@ -270,7 +284,7 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无行调成员,未设置%s默认扮演成员", msgPrefix, name)); } String memberId = dispatcherOptional.map(MapMemberVO::getId).orElse(null); - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(false, false, false, false); + SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(); return buildCreateVO(mapId, name, name, simType, memberId, domConfig); }; @@ -316,7 +330,9 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无行调成员,未生成%s", msgPrefix, name)); return null; } - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(true, false, false, false); + SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder() + .singleMember(true) + .build(); return buildCreateVO(mapId, name, name, simType, dispatcherOptional.get().getId(), domConfig); }; //车站 @@ -330,7 +346,9 @@ public class RtsMapSystemServiceImpl implements RtsMapSystemService { msgList.add(String.format("%s无行值成员,未生成%s", msgPrefix, name)); return null; } - SimulationWorkParamVO.DomConfigVO domConfig = new SimulationWorkParamVO.DomConfigVO(true, false, false, false); + SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder() + .singleMember(true) + .build(); return buildCreateVO(mapId, name, name, simType, stationSupervisorOptional.get().getId(), domConfig); }; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/vo/SimulationWorkParamVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/vo/SimulationWorkParamVO.java index 888b52b5b..580ce448a 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/vo/SimulationWorkParamVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/vo/SimulationWorkParamVO.java @@ -71,6 +71,7 @@ public class SimulationWorkParamVO { @Setter @NoArgsConstructor @AllArgsConstructor + @Builder public static class DomConfigVO { private boolean singleMember; diff --git a/src/test/java/club/joylink/rtss/services/mapSystem/RtsMapSystemServiceImplTest.java b/src/test/java/club/joylink/rtss/services/mapSystem/RtsMapSystemServiceImplTest.java index 721b027c9..a0eab06c4 100644 --- a/src/test/java/club/joylink/rtss/services/mapSystem/RtsMapSystemServiceImplTest.java +++ b/src/test/java/club/joylink/rtss/services/mapSystem/RtsMapSystemServiceImplTest.java @@ -59,7 +59,7 @@ class RtsMapSystemServiceImplTest { createVO.setParamVO(paramVO); paramVO.setType(simType); paramVO.setMemberId(memberVO.getId()); - paramVO.setDomConfig(new SimulationWorkParamVO.DomConfigVO(true, false, false, false)); + paramVO.setDomConfig(SimulationWorkParamVO.DomConfigVO.builder().singleMember(true).build()); rtsMapSystemService.create(createVO, 42L); RtsMapSystemQueryVO queryVO = new RtsMapSystemQueryVO();