diff --git a/src/main/java/neatlogic/module/autoexec/api/job/action/CreateAutoexecCombopJobApi.java b/src/main/java/neatlogic/module/autoexec/api/job/action/CreateAutoexecCombopJobApi.java index c2046dbff16d5df7567d44a8bc7234ab87cfd5dd..b02cea1a74713d6f3c736b0bcdff17075821086a 100644 --- a/src/main/java/neatlogic/module/autoexec/api/job/action/CreateAutoexecCombopJobApi.java +++ b/src/main/java/neatlogic/module/autoexec/api/job/action/CreateAutoexecCombopJobApi.java @@ -23,6 +23,8 @@ import neatlogic.framework.autoexec.constvalue.CombopOperationType; import neatlogic.framework.autoexec.constvalue.JobSource; import neatlogic.framework.autoexec.constvalue.JobTriggerType; import neatlogic.framework.autoexec.dao.mapper.AutoexecCombopMapper; +import neatlogic.framework.autoexec.dto.combop.AutoexecCombopExecuteConfigVo; +import neatlogic.framework.autoexec.dto.combop.AutoexecCombopVersionConfigVo; import neatlogic.framework.autoexec.dto.combop.AutoexecCombopVersionVo; import neatlogic.framework.autoexec.dto.combop.AutoexecCombopVo; import neatlogic.framework.autoexec.dto.job.AutoexecJobVo; @@ -98,6 +100,13 @@ public class CreateAutoexecCombopJobApi extends PrivateApiComponentBase { if (autoexecCombopVersionVo == null) { throw new AutoexecCombopVersionNotFoundException(combopVersionId); } + AutoexecCombopVersionConfigVo versionVoConfig = autoexecCombopVersionVo.getConfig(); + if (versionVoConfig != null) { + AutoexecCombopExecuteConfigVo executeConfig = versionVoConfig.getExecuteConfig(); + if (executeConfig != null) { + jobVo.setPreCondition(executeConfig.getPreCondition()); + } + } jobVo.setCombopVersionId(combopVersionId); jobVo.setInvokeId(combopVersionId); jobVo.setRouteId(combopVersionId.toString()); @@ -107,8 +116,15 @@ public class CreateAutoexecCombopJobApi extends PrivateApiComponentBase { if (autoexecCombopVersionVo == null) { throw new AutoexecCombopActiveVersionNotFoundException(autoexecCombopVo.getName()); } + AutoexecCombopVersionConfigVo versionVoConfig = autoexecCombopVersionVo.getConfig(); + if (versionVoConfig != null) { + AutoexecCombopExecuteConfigVo executeConfig = versionVoConfig.getExecuteConfig(); + if (executeConfig != null) { + jobVo.setPreCondition(executeConfig.getPreCondition()); + } + } jobVo.setCombopVersionId(autoexecCombopVersionVo.getId()); - jobVo.setInvokeId(autoexecCombopVersionVo.getId());; + jobVo.setInvokeId(autoexecCombopVersionVo.getId()); jobVo.setRouteId(autoexecCombopVersionVo.getId().toString()); jobVo.setSource(JobSource.COMBOP.getValue()); } diff --git a/src/main/java/neatlogic/module/autoexec/process/dto/AutoexecJobBuilder.java b/src/main/java/neatlogic/module/autoexec/process/dto/AutoexecJobBuilder.java index d687aa43ae019d24af4362f119a7e61d8d79cf77..293671177411898370d3cf14458075d87bd782dd 100644 --- a/src/main/java/neatlogic/module/autoexec/process/dto/AutoexecJobBuilder.java +++ b/src/main/java/neatlogic/module/autoexec/process/dto/AutoexecJobBuilder.java @@ -37,6 +37,9 @@ public class AutoexecJobBuilder { @EntityField(name = "作业执行参数", type = ApiParamType.JSONOBJECT) private AutoexecCombopExecuteConfigVo executeConfig; + @EntityField(name = "前置执行目标配置", type = ApiParamType.JSONOBJECT) + private JSONObject preCondition; + @EntityField(name = "runner执行组", type = ApiParamType.JSONOBJECT) private ParamMappingVo runnerGroup; @@ -85,6 +88,14 @@ public class AutoexecJobBuilder { this.executeConfig = executeConfig; } + public JSONObject getPreCondition() { + return preCondition; + } + + public void setPreCondition(JSONObject preCondition) { + this.preCondition = preCondition; + } + public ParamMappingVo getRunnerGroup() { return runnerGroup; } @@ -152,6 +163,7 @@ public class AutoexecJobBuilder { jobVo.setRunnerGroupTag(runnerGroupTag); jobVo.setScenarioId(scenarioId); jobVo.setExecuteConfig(executeConfig); + jobVo.setPreCondition(preCondition); if (roundCount != null) { jobVo.setRoundCount(roundCount); } diff --git a/src/main/java/neatlogic/module/autoexec/service/AutoexecServiceServiceImpl.java b/src/main/java/neatlogic/module/autoexec/service/AutoexecServiceServiceImpl.java index 9dd7a5deed34f76fd7ad03e16079b25df18a36c9..21d16a97ab48f671fe9fb72f55e7450c552f800f 100644 --- a/src/main/java/neatlogic/module/autoexec/service/AutoexecServiceServiceImpl.java +++ b/src/main/java/neatlogic/module/autoexec/service/AutoexecServiceServiceImpl.java @@ -826,6 +826,7 @@ public class AutoexecServiceServiceImpl implements AutoexecServiceService { } } builder.setExecuteConfig(executeConfigVo); + builder.setPreCondition(config.getPreCondition()); AutoexecCombopVersionConfigVo versionConfigVo = autoexecCombopVersionVo.getConfig(); List lastRuntimeParamList = versionConfigVo.getRuntimeParamList(); JSONObject param = new JSONObject(); @@ -901,6 +902,9 @@ public class AutoexecServiceServiceImpl implements AutoexecServiceService { executeNodeConfig.setValue(executeConfig.getExecuteNodeConfig()); config.setExecuteNodeConfig(executeNodeConfig); } + if (config.getPreCondition() == null && executeConfig.getPreCondition() != null) { + config.setPreCondition(executeConfig.getPreCondition()); + } } else { config.setExecuteNodeConfig(null); }