From 6d11859981c46cb91453e04bda2aeabe30e1cf2b Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 15 Nov 2022 13:54:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=B1=9E=E6=80=A7=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/services/training2/Training2DraftService.java | 3 +-- .../rtss/simulation/cbtc/training2/Operation2.java | 9 ++++++--- .../joylink/rtss/vo/client/training2/Operation2VO.java | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java b/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java index 246412277..4718daeca 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java @@ -154,6 +154,7 @@ public class Training2DraftService { // DraftTraining2WithBLOBs b = new DraftTraining2WithBLOBs(); b.setBgSceneJson(""); + b.setFinalScenesJson(""); b.setUpdateTime(LocalDateTime.now()); // this.trainingDao.updateByExampleSelective(b, example); @@ -388,8 +389,6 @@ public class Training2DraftService { } else { String scoringRuleJson = handleStepScoringRule(draftTraining2, step2VOList); updateObj.setScoringRuleJson(scoringRuleJson); - // 处理步骤跟操作ID - handleStepAndOperationId(getStartStepId(draftTraining2), step2VOList); updateObj.setStepJson(JsonUtils.writeValueAsString(step2VOList)); // 扮演者集合 List playerList = step2VOList.stream(). diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Operation2.java b/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Operation2.java index d7303e9a4..a208ffb6a 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Operation2.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Operation2.java @@ -13,7 +13,7 @@ import java.util.Map; */ @Getter public abstract class Operation2 { - private int id; + private Long id; @Setter private Expression triggerCondition; @@ -41,12 +41,12 @@ public abstract class Operation2 { Step2.StepStatus status; - Operation2(int id) { + Operation2(Long id) { this.id = id; this.status = Step2.StepStatus.PREPARE; } - public Operation2(int id, Expression triggerCondition, Expression completionCondition, Expression failureCondition) { + public Operation2(Long id, Expression triggerCondition, Expression completionCondition, Expression failureCondition) { this(id); this.triggerCondition = triggerCondition; this.completionCondition = completionCondition; @@ -160,6 +160,8 @@ public abstract class Operation2 { private Map params; + private Long commandId; + public ClientOperation2(Operation2VO.ClientOperation2VO vo, Simulation simulation) { super(vo.getId()); this.deviceCode = vo.getDeviceCode(); @@ -167,6 +169,7 @@ public abstract class Operation2 { this.domId = vo.getDomId(); this.operationType = vo.getOperationType(); this.params = vo.getParams(); + this.commandId = vo.getCommandId(); if (vo.getTriggerCondition() != null) { this.setTriggerCondition(vo.getTriggerCondition().convert2BO(simulation.getRepository())); } diff --git a/src/main/java/club/joylink/rtss/vo/client/training2/Operation2VO.java b/src/main/java/club/joylink/rtss/vo/client/training2/Operation2VO.java index 395246cc8..bbca31507 100644 --- a/src/main/java/club/joylink/rtss/vo/client/training2/Operation2VO.java +++ b/src/main/java/club/joylink/rtss/vo/client/training2/Operation2VO.java @@ -16,7 +16,7 @@ import java.util.Map; @Setter @NoArgsConstructor public abstract class Operation2VO { - private int id; + private long id; /** * 操作的触发条件 @@ -69,6 +69,8 @@ public abstract class Operation2VO { private Map params; + private Long commandId; + @Override public Operation2 convert2BO(Simulation simulation) { return new Operation2.ClientOperation2(this, simulation);