diff --git a/src/main/java/club/joylink/rtss/controller/simulation/SimulationTrainingV2Controller.java b/src/main/java/club/joylink/rtss/controller/simulation/SimulationTrainingV2Controller.java index e54d3e08a..d868f842d 100644 --- a/src/main/java/club/joylink/rtss/controller/simulation/SimulationTrainingV2Controller.java +++ b/src/main/java/club/joylink/rtss/controller/simulation/SimulationTrainingV2Controller.java @@ -116,7 +116,7 @@ public class SimulationTrainingV2Controller { * @param user 操作人 */ @PostMapping("/{group}/prepare/start") - public void prepareStart(@PathVariable String group, @RequestAttribute AccountVO user) { - training2Service.prepareStart(group, user); + public void prepareStart(@PathVariable String group, @RequestAttribute AccountVO user, ScriptBO.Mode mode) { + training2Service.prepareStart(group, user, mode); } } diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java index 1173c001a..6f1f2fbb1 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java @@ -472,6 +472,7 @@ public class Training2PublishService { List training2WithBLOBsList = publishedDao.selectByExampleWithBLOBs(example); Map> mapTrainingMap = training2WithBLOBsList.stream().peek(t -> { t.setId(null); + t.setMapId(null); t.setUpdateTime(null); t.setCreateTime(null); }).collect(Collectors.groupingBy(PublishedTraining2WithBLOBs::getMapId)); diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java index 24512741d..347e5e8c8 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java @@ -563,11 +563,14 @@ public class Training2Service { * @param group 仿真号 * @param user 操作人 */ - public void prepareStart(String group, AccountVO user) { + public void prepareStart(String group, AccountVO user, ScriptBO.Mode mode) { Simulation simulation = groupSimulationCache.getSimulationByGroup(group); BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(simulation.getTraining2() != null, "未加载实训"); - SocketMessageVO message = SocketMessageFactory.build( - WebSocketMessageType.Simulation_Training_Prepare_Start, simulation.getId(), simulation.getTraining2().getId()); + Map messageMap = new HashMap<>(); + messageMap.put("id", simulation.getTraining2().getId()); + messageMap.put("mode", mode); + SocketMessageVO> message = SocketMessageFactory.build( + WebSocketMessageType.Simulation_Training_Prepare_Start, simulation.getId(), messageMap); Set userIdSet = simulation.getSimulationUserIds().stream() .filter(id -> !Objects.equals(id, user.getId().toString())).collect(Collectors.toSet()); stompMessageService.sendToUser(userIdSet, message);