From cda1272d08dd18d27a0b54610fdc1d610458b360 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Mon, 29 May 2023 17:52:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8F=91=E5=B8=83=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8E=BB=E9=99=A4=E5=9C=B0=E5=9B=BEID?= =?UTF-8?q?=E3=80=91=E3=80=90=E5=AE=9E=E8=AE=AD=E5=8A=A0=E8=BD=BD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A8=A1=E5=BC=8F=E5=8F=82=E6=95=B0=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/SimulationTrainingV2Controller.java | 4 ++-- .../rtss/services/training2/Training2PublishService.java | 1 + .../rtss/services/training2/Training2Service.java | 9 ++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) 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);