diff --git a/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopDetailGetApi.java b/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopDetailGetApi.java index 1a102bac28b8f31b681865af4a2aa4fd86ab80ed..ad343acd220cd6cdaf6ffc1e4160a29f242656b6 100644 --- a/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopDetailGetApi.java +++ b/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopDetailGetApi.java @@ -121,6 +121,7 @@ public class AutoexecCombopDetailGetApi extends PrivateApiComponentBase { autoexecCombopVo.setNeedExecuteUser(autoexecCombopVersionVo.getNeedExecuteUser()); autoexecCombopVo.setNeedProtocol(autoexecCombopVersionVo.getNeedProtocol()); autoexecCombopVo.setNeedRoundCount(autoexecCombopVersionVo.getNeedRoundCount()); + autoexecCombopVo.setNeedRunnerGroup(autoexecCombopVersionVo.getNeedRunnerGroup()); AutoexecCombopConfigVo config = autoexecCombopVo.getConfig(); config.setExecuteConfig(versionConfig.getExecuteConfig()); config.setCombopGroupList(versionConfig.getCombopGroupList()); diff --git a/src/main/java/neatlogic/module/autoexec/service/AutoexecCombopServiceImpl.java b/src/main/java/neatlogic/module/autoexec/service/AutoexecCombopServiceImpl.java index 1c79f54812f5115ee8469c5b180d0dfa861d92fc..bb64dfa3e2221dc758a998eb64476853c21fc265 100644 --- a/src/main/java/neatlogic/module/autoexec/service/AutoexecCombopServiceImpl.java +++ b/src/main/java/neatlogic/module/autoexec/service/AutoexecCombopServiceImpl.java @@ -884,23 +884,19 @@ public class AutoexecCombopServiceImpl implements AutoexecCombopService, IAutoex @Override public void needExecuteConfig(AutoexecCombopVersionVo autoexecCombopVersionVo, AutoexecCombopPhaseVo autoexecCombopPhaseVo, AutoexecCombopGroupVo autoexecCombopGroupVo) { String execMode = autoexecCombopPhaseVo.getExecMode(); - if (ExecMode.RUNNER.getValue().equals(execMode)) { + if (ExecMode.RUNNER.getValue().equals(execMode) || ExecMode.SQL.getValue().equals(execMode)) { if (autoexecCombopVersionVo.getAllPhasesAreRunnerOrSqlExecMode() == null) { autoexecCombopVersionVo.setAllPhasesAreRunnerOrSqlExecMode(true); } - return; - } - if (ExecMode.SQL.getValue().equals(execMode)) { - if (autoexecCombopVersionVo.getAllPhasesAreRunnerOrSqlExecMode() == null) { - autoexecCombopVersionVo.setAllPhasesAreRunnerOrSqlExecMode(true); - } - return; + } else { + autoexecCombopVersionVo.setAllPhasesAreRunnerOrSqlExecMode(false); } - autoexecCombopVersionVo.setAllPhasesAreRunnerOrSqlExecMode(false); + boolean needExecuteUser = autoexecCombopVersionVo.getNeedExecuteUser(); boolean needProtocol = autoexecCombopVersionVo.getNeedProtocol(); boolean needExecuteNode = autoexecCombopVersionVo.getNeedExecuteNode(); boolean needRoundCount = autoexecCombopVersionVo.getNeedRoundCount(); + boolean needRunnerGroup = autoexecCombopVersionVo.getNeedRunnerGroup(); AutoexecCombopExecuteConfigVo executeConfigVo = null; if (Objects.equals(AutoexecJobGroupPolicy.GRAYSCALE.getName(), autoexecCombopGroupVo.getPolicy())) { AutoexecCombopGroupConfigVo autoexecCombopGroupConfigVo = autoexecCombopGroupVo.getConfig(); @@ -914,37 +910,48 @@ public class AutoexecCombopServiceImpl implements AutoexecCombopService, IAutoex needProtocol = true; needExecuteNode = true; needRoundCount = true; + needRunnerGroup = true; } else { - if (!needProtocol) { - Long protocolId = executeConfigVo.getProtocolId(); - if (protocolId == null) { - needProtocol = true; + if (Objects.equals(execMode, ExecMode.TARGET.getValue()) || Objects.equals(execMode, ExecMode.RUNNER_TARGET.getValue())) { + if (!needProtocol) { + Long protocolId = executeConfigVo.getProtocolId(); + if (protocolId == null) { + needProtocol = true; + } } - } - if (!needExecuteUser) { - ParamMappingVo executeUser = executeConfigVo.getExecuteUser(); - if (executeUser == null || StringUtils.isBlank((String) executeUser.getValue())) { - needExecuteUser = true; + if (!needExecuteUser) { + ParamMappingVo executeUser = executeConfigVo.getExecuteUser(); + if (executeUser == null || StringUtils.isBlank((String) executeUser.getValue())) { + needExecuteUser = true; + } } - } - if (!needExecuteNode) { - AutoexecCombopExecuteNodeConfigVo executeNodeConfigVo = executeConfigVo.getExecuteNodeConfig(); - if (executeNodeConfigVo == null) { - needExecuteNode = true; - } else { - List paramList = executeNodeConfigVo.getParamList(); - List selectNodeList = executeNodeConfigVo.getSelectNodeList(); - List inputNodeList = executeNodeConfigVo.getInputNodeList(); - List preOutputList = executeNodeConfigVo.getPreOutputList(); - JSONObject filter = executeNodeConfigVo.getFilter(); - if (CollectionUtils.isEmpty(paramList) && CollectionUtils.isEmpty(selectNodeList) && CollectionUtils.isEmpty(inputNodeList) && CollectionUtils.isEmpty(preOutputList) && MapUtils.isEmpty(filter)) { + if (!needExecuteNode) { + AutoexecCombopExecuteNodeConfigVo executeNodeConfigVo = executeConfigVo.getExecuteNodeConfig(); + if (executeNodeConfigVo == null) { needExecuteNode = true; + } else { + List paramList = executeNodeConfigVo.getParamList(); + List selectNodeList = executeNodeConfigVo.getSelectNodeList(); + List inputNodeList = executeNodeConfigVo.getInputNodeList(); + List preOutputList = executeNodeConfigVo.getPreOutputList(); + JSONObject filter = executeNodeConfigVo.getFilter(); + if (CollectionUtils.isEmpty(paramList) && CollectionUtils.isEmpty(selectNodeList) && CollectionUtils.isEmpty(inputNodeList) && CollectionUtils.isEmpty(preOutputList) && MapUtils.isEmpty(filter)) { + needExecuteNode = true; + } + } + } + if (!needRoundCount) { + if (executeConfigVo.getRoundCount() == null) { + needRoundCount = true; } } } - if (!needRoundCount) { - if (executeConfigVo.getRoundCount() == null) { - needRoundCount = true; + if (Objects.equals(execMode, ExecMode.RUNNER.getValue())) { + if (!needRunnerGroup) { + ParamMappingVo runnerGroup = executeConfigVo.getRunnerGroup(); + if (runnerGroup == null || runnerGroup.getValue() == null) { + needRunnerGroup = true; + } } } } @@ -952,6 +959,7 @@ public class AutoexecCombopServiceImpl implements AutoexecCombopService, IAutoex autoexecCombopVersionVo.setNeedExecuteNode(needExecuteNode); autoexecCombopVersionVo.setNeedProtocol(needProtocol); autoexecCombopVersionVo.setNeedRoundCount(needRoundCount); + autoexecCombopVersionVo.setNeedRunnerGroup(needRunnerGroup); } @Override