Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-zhouyin

This commit is contained in:
tiger_zhou 2023-03-31 14:50:46 +08:00
commit f6dd8e7a42

View File

@ -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);
}