【再次加载实训没有背景BUG、判断完成条件BUG】

This commit is contained in:
weizhihong 2022-08-31 11:03:20 +08:00
parent 4ce9d4b885
commit ea3667a80d
2 changed files with 3 additions and 8 deletions

View File

@ -193,7 +193,6 @@ public class Training2Service {
simulationLoadTraining(group, draftTraining2, loginUserInfoVO); simulationLoadTraining(group, draftTraining2, loginUserInfoVO);
} }
/** /**
* 开启实训 * 开启实训
*/ */
@ -209,7 +208,7 @@ public class Training2Service {
if (training2 == null) { if (training2 == null) {
throw new SimulationException(SimulationExceptionType.Invalid_Operation, "实训数据不存在"); throw new SimulationException(SimulationExceptionType.Invalid_Operation, "实训数据不存在");
} }
if (training2.isNeedReloadScenes()) { if (training2.isNeedReloadScenes() && !StringUtils.isEmpty(training2.getBgSceneJson())) {
simulation.pause(); // 先暂停 simulation.pause(); // 先暂停
groupSimulationService.loadScenes(simulation.getId(), training2.getBgSceneJson()); groupSimulationService.loadScenes(simulation.getId(), training2.getBgSceneJson());
} }
@ -496,10 +495,6 @@ public class Training2Service {
* 检验实训数据是否合规 * 检验实训数据是否合规
*/ */
private Consumer<DraftTraining2WithBLOBs> trainingDataValid = (training) -> { private Consumer<DraftTraining2WithBLOBs> trainingDataValid = (training) -> {
if (!StringUtils.hasText(training.getBgSceneJson())) {
throw new SimulationException(SimulationExceptionType.Invalid_Operation
, String.format("实训{id:[%s]}没有背景", training.getId()));
}
if (!StringUtils.hasText(training.getPlayerIdJson())) { if (!StringUtils.hasText(training.getPlayerIdJson())) {
throw new SimulationException(SimulationExceptionType.Invalid_Operation throw new SimulationException(SimulationExceptionType.Invalid_Operation
, String.format("实训{id:[%s]}没有参训角色", training.getId())); , String.format("实训{id:[%s]}没有参训角色", training.getId()));

View File

@ -239,14 +239,14 @@ public class Step2 {
* 是否失败 * 是否失败
*/ */
public static boolean isFail(StepStatus status) { 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) { public static boolean isRunning(StepStatus status) {
return status != null && status.type.equals(RUNNING); return status != null && status.equals(RUNNING);
} }
} }