diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationServiceImpl.java index c2bcf0b61..1566383ba 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationServiceImpl.java @@ -56,10 +56,12 @@ public class SimulationServiceImpl implements SimulationService { @Override public String createSimulation(long mapId, Long mapFunctionId, SimulationWorkParamVO workParamVO, @NonNull LoginUserInfoVO loginUserInfoVO) { + //获取仿真工作服务 SimulationWorkService initService = simulationWorkServiceManager.getWorkService(workParamVO.getType()); + //创建仿真 String simulationId = SimulationIdGenerator.generateGroup(loginUserInfoVO.getAccountVO().getId(), mapId); Simulation simulation = initService.create(mapId, workParamVO, loginUserInfoVO, simulationId); - simulation.setMapFunctionId(mapFunctionId); // 保存功能ID + simulation.setMapFunctionId(mapFunctionId); LoginUserInfoVO loginUserInfo = simulation.getBuildParams().getLoginUserInfo(); if (Objects.nonNull(loginUserInfo)) { simulation.setCreatorId(loginUserInfo.getAccountVO().getIdStr()); @@ -67,13 +69,9 @@ public class SimulationServiceImpl implements SimulationService { simulation.setProjectVO(loginUserInfo.getProjectInfo()); } // 删除旧仿真,保存新仿真 - club.joylink.rtss.simulation.Simulation oldSimulation = simulationManager.queryByCreatorId(simulation.getCreatorId()); - if (oldSimulation != null) { - groupSimulationService.clearSimulation(oldSimulation.getId()); - } simulation.setMessageSender(this.defaultMessageSender); // 设置默认的消息发布器 simulation.loadModule(); // 加载通用模块 - simulationManager.destroy(simulation.getId()); + groupSimulationService.clearSimulation(simulation.getId()); simulationManager.saveNew(simulation); initService.loadData(simulation); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityScreenDoor.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityScreenDoor.java index 6a8b7d0db..e65d1d659 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityScreenDoor.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityScreenDoor.java @@ -89,7 +89,11 @@ public class VirtualRealityScreenDoor extends ControllableVrDevice itemMap = workParamVO.getItemMap();