From ddaf91647acdfacb5d3e7a06c128167d397ca8e5 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Fri, 2 Dec 2022 11:26:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E9=93=81=E4=BB=BF?= =?UTF-8?q?=E7=9C=9F=E5=88=9D=E5=A7=8B=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/simulation/cbtc/SimulationServiceImpl.java | 10 ++++------ .../cbtc/data/vr/VirtualRealityScreenDoor.java | 8 ++++++-- .../cbtc/work/MetroSimulationWorkServiceImpl.java | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) 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();