diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationServiceImpl.java index 998b9629b..44643337f 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationServiceImpl.java @@ -776,15 +776,24 @@ public class GroupSimulationServiceImpl implements GroupSimulationService { // .assertTrue(simulation.isJointSimulation()); // 是否已经获取权限 SimulationUser existSimulationUser = simulation.querySimulationUserById(user.getId().toString()); - BusinessExceptionAssertEnum.SIMULATION_PERMISSION_ALREADY_GET - .assertNull(existSimulationUser); + // 用户联机的时候用户直接关闭浏览器,二次联机的时候无法进入的问题 begin +// BusinessExceptionAssertEnum.SIMULATION_PERMISSION_ALREADY_GET.assertNull(existSimulationUser); // 检查是否还有权限可以使用 - // 获取权限,成为仿真用户 - SimulationUser simulationUser = new SimulationUser(simulation, user); - simulation.addSimulationUser(simulationUser); - SimulationUserEnterEvent userEnterEvent = new SimulationUserEnterEvent(this, simulation, simulationUser); - this.applicationContext.publishEvent(userEnterEvent); +// SimulationUser simulationUser = new SimulationUser(simulation, user); +// simulation.addSimulationUser(simulationUser); +// SimulationUserEnterEvent userEnterEvent = new SimulationUserEnterEvent(this, simulation, simulationUser); +// this.applicationContext.publishEvent(userEnterEvent); + SimulationUserEnterEvent userEnterEvent; + if(Objects.isNull(existSimulationUser)){ + SimulationUser simulationUser = new SimulationUser(simulation, user); + simulation.addSimulationUser(simulationUser); + userEnterEvent = new SimulationUserEnterEvent(this, simulation, simulationUser); + }else{ + userEnterEvent = new SimulationUserEnterEvent(this, simulation, existSimulationUser); + } + this.applicationContext.publishEvent(userEnterEvent); + // 用户联机的时候用户直接关闭浏览器,二次联机的时候无法进入的问题 end return SimulationVO.buildBasicInfo(simulation); }