From b82784f5d1ecbc2301386b0ea7a983c5aaef75ff Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Sat, 9 Mar 2024 00:56:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-I?= =?UTF-8?q?TSM-=E6=B5=81=E7=A8=8B=E7=AE=A1=E7=90=86-=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E8=8A=82=E7=82=B9=E5=A2=9E=E5=8A=A0=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E3=80=81=E5=A2=9E=E5=8A=A0=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1107309646807040]后端-ITSM-流程管理-自动化节点增加场景参数、增加特殊字符判断 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1107309646807040 --- .../AutoexecCombopProcessConfigInitApi.java | 45 +++++++++---- .../component/AutoexecProcessComponent.java | 65 +++++++++++++++++-- .../AutoexecProcessUtilHandler.java | 19 ++++++ 3 files changed, 113 insertions(+), 16 deletions(-) diff --git a/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopProcessConfigInitApi.java b/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopProcessConfigInitApi.java index 47c129d9..ebd85148 100644 --- a/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopProcessConfigInitApi.java +++ b/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopProcessConfigInitApi.java @@ -16,10 +16,13 @@ limitations under the License. package neatlogic.module.autoexec.api.combop; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import neatlogic.framework.auth.core.AuthAction; import neatlogic.framework.autoexec.auth.AUTOEXEC_BASE; import neatlogic.framework.autoexec.constvalue.CombopNodeSpecify; import neatlogic.framework.autoexec.constvalue.ParamMappingMode; +import neatlogic.framework.autoexec.dao.mapper.AutoexecCombopMapper; import neatlogic.framework.autoexec.dto.AutoexecParamVo; import neatlogic.framework.autoexec.dto.combop.*; import neatlogic.framework.autoexec.exception.AutoexecCombopActiveVersionNotFoundException; @@ -30,17 +33,17 @@ import neatlogic.framework.common.dto.ValueTextVo; import neatlogic.framework.restful.annotation.*; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; -import neatlogic.framework.autoexec.dao.mapper.AutoexecCombopMapper; import neatlogic.module.autoexec.dao.mapper.AutoexecCombopVersionMapper; import neatlogic.module.autoexec.service.AutoexecCombopService; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author linbq @@ -167,6 +170,32 @@ public class AutoexecCombopProcessConfigInitApi extends PrivateApiComponentBase } } } + List phaseList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(phaseNameList)) { + for (String phaseName : phaseNameList) { + phaseList.add(new ValueTextVo(phaseName, phaseName)); + } + } + resultObj.put("phaseList", phaseList); + + List combopScenarioList = versionConfig.getScenarioList(); + if (CollectionUtils.isNotEmpty(combopScenarioList)) { + List scenarioList = new ArrayList<>(); + for (AutoexecCombopScenarioVo combopScenarioVo : combopScenarioList) { + scenarioList.add(new ValueTextVo(combopScenarioVo.getScenarioId(), combopScenarioVo.getScenarioName())); + } + resultObj.put("scenarioList", scenarioList); + JSONArray scenarioParamList = new JSONArray(); + JSONObject scenarioParam = new JSONObject(); + scenarioParam.put("key", "scenarioId"); + scenarioParam.put("name", "场景"); + scenarioParam.put("isRequired", 1); + scenarioParam.put("mappingMode", ""); + scenarioParam.put("value", ""); + scenarioParamList.add(scenarioParam); + resultObj.put("scenarioParamList", scenarioParamList); + } + autoexecCombopService.needExecuteConfig(autoexecCombopVersionVo); List existedExportParamValueList = new ArrayList<>(); JSONArray exportParamList = new JSONArray(); @@ -315,13 +344,7 @@ public class AutoexecCombopProcessConfigInitApi extends PrivateApiComponentBase } } resultObj.put("executeParamList", executeParamList); - List phaseList = new ArrayList<>(); - if (CollectionUtils.isNotEmpty(phaseNameList)) { - for (String phaseName : phaseNameList) { - phaseList.add(new ValueTextVo(phaseName, phaseName)); - } - } - resultObj.put("phaseList", phaseList); + return resultObj; } } diff --git a/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java b/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java index d1266130..d085993b 100644 --- a/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java +++ b/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java @@ -36,16 +36,22 @@ import neatlogic.framework.form.dto.AttributeDataVo; import neatlogic.framework.form.dto.FormAttributeVo; import neatlogic.framework.form.dto.FormVersionVo; import neatlogic.framework.form.service.IFormCrossoverService; +import neatlogic.framework.notify.core.INotifyParamHandler; +import neatlogic.framework.notify.core.NotifyParamHandlerFactory; import neatlogic.framework.process.constvalue.*; import neatlogic.framework.process.crossover.IProcessTaskCrossoverService; import neatlogic.framework.process.dao.mapper.ProcessTaskStepDataMapper; import neatlogic.framework.process.dto.*; import neatlogic.framework.process.exception.processtask.ProcessTaskException; import neatlogic.framework.process.exception.processtask.ProcessTaskNoPermissionException; +import neatlogic.framework.process.notify.constvalue.ProcessTaskNotifyParam; +import neatlogic.framework.process.notify.constvalue.ProcessTaskStepNotifyParam; +import neatlogic.framework.process.notify.constvalue.ProcessTaskStepNotifyTriggerType; import neatlogic.framework.process.stephandler.core.IProcessStepHandler; import neatlogic.framework.process.stephandler.core.ProcessStepHandlerBase; import neatlogic.framework.process.stephandler.core.ProcessStepHandlerFactory; import neatlogic.framework.process.stephandler.core.ProcessStepThread; +import neatlogic.framework.util.FreemarkerUtil; import neatlogic.module.autoexec.constvalue.FailPolicy; import neatlogic.module.autoexec.service.AutoexecJobActionService; import org.apache.commons.collections4.CollectionUtils; @@ -315,7 +321,7 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { // 作业参数赋值列表 JSONArray runtimeParamList = autoexecConfig.getJSONArray("runtimeParamList"); if (CollectionUtils.isNotEmpty(runtimeParamList)) { - JSONObject param = getParam(runtimeParamList, formAttributeMap, processTaskFormAttributeDataMap); + JSONObject param = getParam(currentProcessTaskStepVo, runtimeParamList, formAttributeMap, processTaskFormAttributeDataMap); jobVo.setParam(param); } // 目标参数赋值列表 @@ -390,7 +396,7 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { // 作业参数赋值列表 JSONArray runtimeParamList = autoexecConfig.getJSONArray("runtimeParamList"); if (CollectionUtils.isNotEmpty(runtimeParamList)) { - JSONObject param = getParam(runtimeParamList, tbodyObj, formAttributeMap, processTaskFormAttributeDataMap); + JSONObject param = getParam(currentProcessTaskStepVo, runtimeParamList, tbodyObj, formAttributeMap, processTaskFormAttributeDataMap); jobVo.setParam(param); } String jobNamePrefixValue = getJobNamePrefixValue(jobNamePrefixKey, jobVo.getExecuteConfig(), jobVo.getParam()); @@ -566,12 +572,14 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { } private JSONObject getParam( + ProcessTaskStepVo currentProcessTaskStepVo, JSONArray runtimeParamList, Map formAttributeMap, Map processTaskFormAttributeDataMap) { - return getParam(runtimeParamList, null, formAttributeMap, processTaskFormAttributeDataMap); + return getParam(currentProcessTaskStepVo, runtimeParamList, null, formAttributeMap, processTaskFormAttributeDataMap); } private JSONObject getParam( + ProcessTaskStepVo currentProcessTaskStepVo, JSONArray runtimeParamList, JSONObject tbodyObj, Map formAttributeMap, @@ -584,6 +592,7 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { formTextAttributeList.add(neatlogic.framework.form.constvalue.FormHandler.FORMTEXT.getHandler()); formTextAttributeList.add(neatlogic.framework.form.constvalue.FormHandler.FORMTEXTAREA.getHandler()); + List needFreemarkerReplaceKeyList = new ArrayList<>(); JSONObject param = new JSONObject(); for (int i = 0; i < runtimeParamList.size(); i++) { JSONObject runtimeParamObj = runtimeParamList.getJSONObject(i); @@ -598,6 +607,7 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { if (value == null) { continue; } + String type = runtimeParamObj.getString("type"); String mappingMode = runtimeParamObj.getString("mappingMode"); if (Objects.equals(mappingMode, "formTableComponent")) { String column = runtimeParamObj.getString("column"); @@ -610,14 +620,14 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { JSONArray filterList = runtimeParamObj.getJSONArray("filterList"); JSONArray tbodyList = getTbodyList(attributeDataVo, filterList); List list = parseFormTableComponentMappingValue(formAttributeVo, tbodyList, column); - String type = runtimeParamObj.getString("type"); +// String type = runtimeParamObj.getString("type"); param.put(key, convertDateType(type, list)); } } else if (Objects.equals(mappingMode, "formCommonComponent")) { ProcessTaskFormAttributeDataVo attributeDataVo = processTaskFormAttributeDataMap.get(value); if (attributeDataVo != null) { if (formTextAttributeList.contains(attributeDataVo.getHandler())) { - String type = runtimeParamObj.getString("type"); +// String type = runtimeParamObj.getString("type"); param.put(key, convertDateType(type, (String) attributeDataVo.getDataObj())); } else if (formSelectAttributeList.contains(attributeDataVo.getHandler())) { IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class); @@ -630,6 +640,51 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { } else if (Objects.equals(mappingMode, "constant")) { param.put(key, value); } + + if (Objects.equals(type, ParamType.TEXT.getValue()) || Objects.equals(type, ParamType.TEXTAREA.getValue())) { + Object obj = param.get(key); + if (obj != null) { + String str = obj.toString(); + if (str.contains("${DATA.stepId}") || str.contains("${DATA.stepWorker}") || str.contains("${DATA.serialNumber}")) { + needFreemarkerReplaceKeyList.add(key); + } + } + } + } + // 通过freemarker语法替换参数${DATA.stepId}、${DATA.stepWorker}、${DATA.serialNumber} + if (CollectionUtils.isNotEmpty(needFreemarkerReplaceKeyList)) { + for (String key : needFreemarkerReplaceKeyList) { + JSONObject paramObj = new JSONObject(); + { + INotifyParamHandler notifyParamHandler = NotifyParamHandlerFactory.getHandler(ProcessTaskStepNotifyParam.STEPWORKER.getValue()); + if (notifyParamHandler != null) { + Object stepWorker = notifyParamHandler.getText(currentProcessTaskStepVo, ProcessTaskStepNotifyTriggerType.SUCCEED); + paramObj.put(ProcessTaskStepNotifyParam.STEPWORKER.getValue(), stepWorker); + } + } + { + INotifyParamHandler notifyParamHandler = NotifyParamHandlerFactory.getHandler(ProcessTaskStepNotifyParam.STEPID.getValue()); + if (notifyParamHandler != null) { + Object stepId = notifyParamHandler.getText(currentProcessTaskStepVo, ProcessTaskStepNotifyTriggerType.SUCCEED); + paramObj.put(ProcessTaskStepNotifyParam.STEPID.getValue(), stepId); + } + } + { + INotifyParamHandler notifyParamHandler = NotifyParamHandlerFactory.getHandler(ProcessTaskNotifyParam.SERIALNUMBER.getValue()); + if (notifyParamHandler != null) { + Object serialnumber = notifyParamHandler.getText(currentProcessTaskStepVo, null); + paramObj.put(ProcessTaskNotifyParam.SERIALNUMBER.getValue(), serialnumber); + } + } + Object obj = param.get(key); + if (obj == null) { + continue; + } + String str = obj.toString(); + if (str.contains("${DATA.stepId}") || str.contains("${DATA.stepWorker}") || str.contains("${DATA.serialNumber}")) { + param.put(key, FreemarkerUtil.transform(paramObj, str)); + } + } } return param; } diff --git a/src/main/java/neatlogic/module/autoexec/stephandler/utilhandler/AutoexecProcessUtilHandler.java b/src/main/java/neatlogic/module/autoexec/stephandler/utilhandler/AutoexecProcessUtilHandler.java index 49b7aae0..5eeb089f 100644 --- a/src/main/java/neatlogic/module/autoexec/stephandler/utilhandler/AutoexecProcessUtilHandler.java +++ b/src/main/java/neatlogic/module/autoexec/stephandler/utilhandler/AutoexecProcessUtilHandler.java @@ -386,6 +386,25 @@ public class AutoexecProcessUtilHandler extends ProcessStepInternalHandlerBase { } configObj.put("batchJobDataSource", batchJobDataSourceObj); } + JSONArray scenarioParamList = config.getJSONArray("scenarioParamList"); + if (scenarioParamList != null) { + JSONArray scenarioParamArray = new JSONArray(); + for (int j = 0; j < scenarioParamList.size(); j++) { + JSONObject scenarioParamObj = scenarioParamList.getJSONObject(j); + if (MapUtils.isNotEmpty(scenarioParamObj)) { + JSONObject scenarioParam = new JSONObject(); + scenarioParam.put("key", scenarioParamObj.getString("key")); + scenarioParam.put("name", scenarioParamObj.getString("name")); + scenarioParam.put("mappingMode", scenarioParamObj.getString("mappingMode")); + scenarioParam.put("value", scenarioParamObj.get("value")); + scenarioParam.put("column", scenarioParamObj.getString("column")); + scenarioParam.put("filterList", scenarioParamObj.getJSONArray("filterList")); + scenarioParam.put("isRequired", scenarioParamObj.getInteger("isRequired")); + scenarioParamArray.add(scenarioParam); + } + } + configObj.put("scenarioParamList", scenarioParamArray); + } // 作业参数赋值列表 JSONArray runtimeParamList = config.getJSONArray("runtimeParamList"); if (runtimeParamList != null) { -- Gitee From a9aacdd2ac75ed9ba75938651d2f00f4da391289 Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Tue, 12 Mar 2024 15:22:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-I?= =?UTF-8?q?TSM-=E6=B5=81=E7=A8=8B=E7=AE=A1=E7=90=86-=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E8=8A=82=E7=82=B9=E5=A2=9E=E5=8A=A0=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E3=80=81=E5=A2=9E=E5=8A=A0=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1107309646807040]后端-ITSM-流程管理-自动化节点增加场景参数、增加特殊字符判断 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1107309646807040 --- .../component/AutoexecProcessComponent.java | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java b/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java index d085993b..8724d29c 100644 --- a/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java +++ b/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java @@ -28,6 +28,7 @@ import neatlogic.framework.autoexec.dto.combop.ParamMappingVo; import neatlogic.framework.autoexec.dto.job.AutoexecJobEnvVo; import neatlogic.framework.autoexec.dto.job.AutoexecJobVo; import neatlogic.framework.autoexec.dto.node.AutoexecNodeVo; +import neatlogic.framework.autoexec.dto.scenario.AutoexecScenarioVo; import neatlogic.framework.cmdb.enums.FormHandler; import neatlogic.framework.common.constvalue.Expression; import neatlogic.framework.common.constvalue.SystemUser; @@ -53,6 +54,7 @@ import neatlogic.framework.process.stephandler.core.ProcessStepHandlerFactory; import neatlogic.framework.process.stephandler.core.ProcessStepThread; import neatlogic.framework.util.FreemarkerUtil; import neatlogic.module.autoexec.constvalue.FailPolicy; +import neatlogic.module.autoexec.dao.mapper.AutoexecScenarioMapper; import neatlogic.module.autoexec.service.AutoexecJobActionService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; @@ -82,6 +84,9 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { @Resource private ProcessTaskStepDataMapper processTaskStepDataMapper; + @Resource + private AutoexecScenarioMapper autoexecScenarioMapper; + @Override public String getHandler() { return AutoexecProcessStepHandlerType.AUTOEXEC.getHandler(); @@ -318,6 +323,12 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { // 作业名称 String jobName = autoexecConfig.getString("jobName"); String jobNamePrefixKey = autoexecConfig.getString("jobNamePrefix"); + // 场景 + JSONArray scenarioParamList = autoexecConfig.getJSONArray("scenarioParamList"); + if (CollectionUtils.isNotEmpty(scenarioParamList)) { + Long scenarioId = getScenarioId(scenarioParamList.getJSONObject(0), null, formAttributeMap, processTaskFormAttributeDataMap); + jobVo.setScenarioId(scenarioId); + } // 作业参数赋值列表 JSONArray runtimeParamList = autoexecConfig.getJSONArray("runtimeParamList"); if (CollectionUtils.isNotEmpty(runtimeParamList)) { @@ -387,6 +398,12 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { jobVo.setIsFirstFire(1); jobVo.setAssignExecUser(SystemUser.SYSTEM.getUserUuid()); JSONObject tbodyObj = tbodyList.getJSONObject(index); + // 场景 + JSONArray scenarioParamList = autoexecConfig.getJSONArray("scenarioParamList"); + if (CollectionUtils.isNotEmpty(scenarioParamList)) { + Long scenarioId = getScenarioId(scenarioParamList.getJSONObject(0), tbodyObj, formAttributeMap, processTaskFormAttributeDataMap); + jobVo.setScenarioId(scenarioId); + } // 目标参数赋值列表 JSONArray executeParamList = autoexecConfig.getJSONArray("executeParamList"); if (CollectionUtils.isNotEmpty(executeParamList)) { @@ -406,6 +423,97 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { return resultList; } + /** + * 获取场景ID + * @param scenarioParamObj + * @param tbodyObj + * @param formAttributeMap + * @param processTaskFormAttributeDataMap + * @return + */ + private Long getScenarioId(JSONObject scenarioParamObj, + JSONObject tbodyObj, + Map formAttributeMap, + Map processTaskFormAttributeDataMap) { + String key = scenarioParamObj.getString("key"); + if (StringUtils.isBlank(key)) { + return null; + } + Object value = scenarioParamObj.get("value"); + if (value == null) { + return null; + } + Object scenario = null; + String type = scenarioParamObj.getString("type"); + String mappingMode = scenarioParamObj.getString("mappingMode"); + if (Objects.equals(mappingMode, "formTableComponent")) { + String column = scenarioParamObj.getString("column"); + if (tbodyObj != null) { + String columnValue = tbodyObj.getString(column); + scenario = columnValue; + } else { + FormAttributeVo formAttributeVo = formAttributeMap.get(value); + ProcessTaskFormAttributeDataVo attributeDataVo = processTaskFormAttributeDataMap.get(value); + JSONArray filterList = scenarioParamObj.getJSONArray("filterList"); + JSONArray tbodyList = getTbodyList(attributeDataVo, filterList); + List list = parseFormTableComponentMappingValue(formAttributeVo, tbodyList, column); + scenario = convertDateType(type, list); + } + } else if (Objects.equals(mappingMode, "formCommonComponent")) { + ProcessTaskFormAttributeDataVo attributeDataVo = processTaskFormAttributeDataMap.get(value); + if (attributeDataVo != null) { + List formSelectAttributeList = new ArrayList<>(); + formSelectAttributeList.add(neatlogic.framework.form.constvalue.FormHandler.FORMSELECT.getHandler()); + formSelectAttributeList.add(neatlogic.framework.form.constvalue.FormHandler.FORMCHECKBOX.getHandler()); + formSelectAttributeList.add(neatlogic.framework.form.constvalue.FormHandler.FORMRADIO.getHandler()); + List formTextAttributeList = new ArrayList<>(); + formTextAttributeList.add(neatlogic.framework.form.constvalue.FormHandler.FORMTEXT.getHandler()); + formTextAttributeList.add(neatlogic.framework.form.constvalue.FormHandler.FORMTEXTAREA.getHandler()); + if (formTextAttributeList.contains(attributeDataVo.getHandler())) { + scenario = convertDateType(type, (String) attributeDataVo.getDataObj()); + } else if (formSelectAttributeList.contains(attributeDataVo.getHandler())) { + IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class); + Object valueObject = formCrossoverService.getFormSelectAttributeValueByOriginalValue(attributeDataVo.getDataObj()); + scenario = valueObject; + } else { + scenario = attributeDataVo.getDataObj(); + } + } + } else if (Objects.equals(mappingMode, "constant")) { + scenario = value; + } + if (scenario != null) { + if (scenario instanceof List) { + List scenarioList = (List) scenario; + if (CollectionUtils.isNotEmpty(scenarioList)) { + scenario = scenarioList.get(0); + } + } + if (scenario instanceof String) { + String scenarioName = (String) scenario; + AutoexecScenarioVo scenarioVo = autoexecScenarioMapper.getScenarioByName(scenarioName); + if (scenarioVo != null) { + return scenarioVo.getId(); + } else { + try { + Long scenarioId = Long.valueOf(scenarioName); + if (autoexecScenarioMapper.checkScenarioIsExistsById(scenarioId) > 0) { + return scenarioId; + } + } catch (NumberFormatException ignored) { + + } + } + } else if (scenario instanceof Long) { + Long scenarioId = (Long) scenario; + if (autoexecScenarioMapper.checkScenarioIsExistsById(scenarioId) > 0) { + return scenarioId; + } + } + } + return null; + } + /** * 根据设置找到作业名称前缀值 * @param jobNamePrefixKey 作业名称前缀key -- Gitee From f62ba7103e1f83a738b802df23bd7d3735366131 Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Tue, 12 Mar 2024 16:25:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-I?= =?UTF-8?q?TSM-=E6=B5=81=E7=A8=8B=E7=AE=A1=E7=90=86-=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E8=8A=82=E7=82=B9=E5=A2=9E=E5=8A=A0=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E3=80=81=E5=A2=9E=E5=8A=A0=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1107309646807040]后端-ITSM-流程管理-自动化节点增加场景参数、增加特殊字符判断 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1107309646807040 --- .../stephandler/component/AutoexecProcessComponent.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java b/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java index 8724d29c..77cc66d8 100644 --- a/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java +++ b/src/main/java/neatlogic/module/autoexec/stephandler/component/AutoexecProcessComponent.java @@ -728,14 +728,12 @@ public class AutoexecProcessComponent extends ProcessStepHandlerBase { JSONArray filterList = runtimeParamObj.getJSONArray("filterList"); JSONArray tbodyList = getTbodyList(attributeDataVo, filterList); List list = parseFormTableComponentMappingValue(formAttributeVo, tbodyList, column); -// String type = runtimeParamObj.getString("type"); param.put(key, convertDateType(type, list)); } } else if (Objects.equals(mappingMode, "formCommonComponent")) { ProcessTaskFormAttributeDataVo attributeDataVo = processTaskFormAttributeDataMap.get(value); if (attributeDataVo != null) { if (formTextAttributeList.contains(attributeDataVo.getHandler())) { -// String type = runtimeParamObj.getString("type"); param.put(key, convertDateType(type, (String) attributeDataVo.getDataObj())); } else if (formSelectAttributeList.contains(attributeDataVo.getHandler())) { IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class); -- Gitee