【修改实训操作属性】

This commit is contained in:
weizhihong 2022-11-15 13:54:27 +08:00
parent fc950dbd57
commit 6d11859981
3 changed files with 10 additions and 6 deletions

View File

@ -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<String> playerList = step2VOList.stream().

View File

@ -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<String, Object> 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()));
}

View File

@ -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<String, Object> params;
private Long commandId;
@Override
public Operation2 convert2BO(Simulation simulation) {
return new Operation2.ClientOperation2(this, simulation);