From ea3667a80dff175e514608e0fa06a417110bec6a Mon Sep 17 00:00:00 2001 From: weizhihong Date: Wed, 31 Aug 2022 11:03:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=86=8D=E6=AC=A1=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=B2=A1=E6=9C=89=E8=83=8C=E6=99=AFBUG?= =?UTF-8?q?=E3=80=81=E5=88=A4=E6=96=AD=E5=AE=8C=E6=88=90=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?BUG=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/services/training2/Training2Service.java | 7 +------ .../club/joylink/rtss/simulation/cbtc/training2/Step2.java | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) 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 b0dfb9e71..dfa057d1b 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java @@ -193,7 +193,6 @@ public class Training2Service { simulationLoadTraining(group, draftTraining2, loginUserInfoVO); } - /** * 开启实训 */ @@ -209,7 +208,7 @@ public class Training2Service { if (training2 == null) { throw new SimulationException(SimulationExceptionType.Invalid_Operation, "实训数据不存在"); } - if (training2.isNeedReloadScenes()) { + if (training2.isNeedReloadScenes() && !StringUtils.isEmpty(training2.getBgSceneJson())) { simulation.pause(); // 先暂停 groupSimulationService.loadScenes(simulation.getId(), training2.getBgSceneJson()); } @@ -496,10 +495,6 @@ public class Training2Service { * 检验实训数据是否合规 */ private Consumer trainingDataValid = (training) -> { - if (!StringUtils.hasText(training.getBgSceneJson())) { - throw new SimulationException(SimulationExceptionType.Invalid_Operation - , String.format("实训{id:[%s]}没有背景", training.getId())); - } if (!StringUtils.hasText(training.getPlayerIdJson())) { throw new SimulationException(SimulationExceptionType.Invalid_Operation , String.format("实训{id:[%s]}没有参训角色", training.getId())); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Step2.java b/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Step2.java index 1f7177803..d46d01a2a 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Step2.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Step2.java @@ -239,14 +239,14 @@ public class Step2 { * 是否失败 */ public static boolean isFail(StepStatus status) { - return status != null && status.type.equals(FAIL); + return status != null && status.equals(FAIL); } /** * 是在运行状态 */ public static boolean isRunning(StepStatus status) { - return status != null && status.type.equals(RUNNING); + return status != null && status.equals(RUNNING); } }