From 1e89d318aac7cf1dd03fb3720cffcd0c3e5a5bbd Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 26 Dec 2024 16:22:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20IT=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?-=E6=B5=81=E7=A8=8B=E5=9B=BE=E4=BF=9D=E5=AD=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1320124261302272]IT服务-流程图保存逻辑优化 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1320124261302272 --- ...ecCombop2ProcessStepDependencyHandler.java | 143 ++++++++++-------- .../makeup/CreateJobConfigMakeupHandler.java | 63 ++++++++ .../CreateJobProcessUtilHandler.java | 2 +- 3 files changed, 143 insertions(+), 65 deletions(-) create mode 100644 src/main/java/neatlogic/module/autoexec/process/stephandler/makeup/CreateJobConfigMakeupHandler.java diff --git a/src/main/java/neatlogic/module/autoexec/dependency/AutoexecCombop2ProcessStepDependencyHandler.java b/src/main/java/neatlogic/module/autoexec/dependency/AutoexecCombop2ProcessStepDependencyHandler.java index 799e38cf..878b1225 100644 --- a/src/main/java/neatlogic/module/autoexec/dependency/AutoexecCombop2ProcessStepDependencyHandler.java +++ b/src/main/java/neatlogic/module/autoexec/dependency/AutoexecCombop2ProcessStepDependencyHandler.java @@ -15,80 +15,95 @@ along with this program. If not, see .*/ package neatlogic.module.autoexec.dependency; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.asynchronization.threadlocal.TenantContext; import neatlogic.framework.autoexec.constvalue.AutoexecFromType; +import neatlogic.framework.crossover.CrossoverServiceFactory; import neatlogic.framework.dependency.core.DefaultDependencyHandlerBase; import neatlogic.framework.dependency.core.IFromType; import neatlogic.framework.dependency.dto.DependencyInfoVo; import neatlogic.framework.dependency.dto.DependencyVo; +import neatlogic.framework.process.crossover.IProcessCrossoverMapper; +import neatlogic.framework.process.dto.ProcessVo; +import neatlogic.module.autoexec.process.dto.CreateJobConfigConfigVo; +import neatlogic.module.autoexec.process.dto.CreateJobConfigVo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Component; -//@Component +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@Component public class AutoexecCombop2ProcessStepDependencyHandler extends DefaultDependencyHandlerBase { @Override protected DependencyInfoVo parse(DependencyVo dependencyVo) { -// JSONObject config = dependencyVo.getConfig(); -// if (MapUtils.isEmpty(config)) { -// return null; -// } -// String stepUuid = dependencyVo.getTo(); -// String processUuid = config.getString("processUuid"); -// IProcessCrossoverMapper processCrossoverMapper = CrossoverServiceFactory.getApi(IProcessCrossoverMapper.class); -// ProcessVo processVo = processCrossoverMapper.getProcessBaseInfoByUuid(processUuid); -// if (processVo == null) { -// return null; -// } -// JSONObject processConfig = processVo.getConfig(); -// if (MapUtils.isEmpty(processConfig)) { -// return null; -// } -// JSONObject processObj = processConfig.getJSONObject("process"); -// if (MapUtils.isEmpty(processObj)) { -// return null; -// } -// JSONArray stepList = processObj.getJSONArray("stepList"); -// if (CollectionUtils.isEmpty(stepList)) { -// return null; -// } -// for (int i = 0; i < stepList.size(); i++) { -// JSONObject stepObj = stepList.getJSONObject(i); -// if (MapUtils.isEmpty(stepObj)) { -// continue; -// } -// String uuid = stepObj.getString("uuid"); -// if (!Objects.equals(uuid, stepUuid)) { -// continue; -// } -// JSONObject stepConfig = stepObj.getJSONObject("stepConfig"); -// if (MapUtils.isEmpty(stepConfig)) { -// return null; -// } -// JSONObject createJobConfig = stepConfig.getJSONObject("createJobConfig"); -// if (MapUtils.isEmpty(createJobConfig)) { -// return null; -// } -// boolean flag = false; -// CreateJobConfigVo createJobConfigVo = createJobConfig.toJavaObject(CreateJobConfigVo.class); -// List configList = createJobConfigVo.getConfigList(); -// if (CollectionUtils.isNotEmpty(configList)) { -// for (CreateJobConfigConfigVo createJobConfigConfigVo : configList) { -// if (createJobConfigConfigVo.getCombopId() != null && Objects.equals(createJobConfigConfigVo.getCombopId().toString(), dependencyVo.getFrom())) { -// flag = true; -// break; -// } -// } -// } -// if (!flag) { -// return null; -// } -// JSONObject dependencyInfoConfig = new JSONObject(); -// dependencyInfoConfig.put("processUuid", processUuid); -// dependencyInfoConfig.put("stepUuid", stepUuid); -// List pathList = new ArrayList<>(); -// pathList.add("流程管理"); -// pathList.add(processVo.getName()); -// String urlFormat = "/" + TenantContext.get().getTenantUuid() + "/process.html#/flow-edit?uuid=${DATA.processUuid}&stepUuid=${DATA.stepUuid}"; -// return new DependencyInfoVo(stepUuid, dependencyInfoConfig, stepObj.getString("name"), pathList, urlFormat, this.getGroupName()); -// } + JSONObject config = dependencyVo.getConfig(); + if (MapUtils.isEmpty(config)) { + return null; + } + String stepUuid = dependencyVo.getTo(); + String processUuid = config.getString("processUuid"); + IProcessCrossoverMapper processCrossoverMapper = CrossoverServiceFactory.getApi(IProcessCrossoverMapper.class); + ProcessVo processVo = processCrossoverMapper.getProcessBaseInfoByUuid(processUuid); + if (processVo == null) { + return null; + } + JSONObject processConfig = processVo.getConfig(); + if (MapUtils.isEmpty(processConfig)) { + return null; + } + JSONObject processObj = processConfig.getJSONObject("process"); + if (MapUtils.isEmpty(processObj)) { + return null; + } + JSONArray stepList = processObj.getJSONArray("stepList"); + if (CollectionUtils.isEmpty(stepList)) { + return null; + } + for (int i = 0; i < stepList.size(); i++) { + JSONObject stepObj = stepList.getJSONObject(i); + if (MapUtils.isEmpty(stepObj)) { + continue; + } + String uuid = stepObj.getString("uuid"); + if (!Objects.equals(uuid, stepUuid)) { + continue; + } + JSONObject stepConfig = stepObj.getJSONObject("stepConfig"); + if (MapUtils.isEmpty(stepConfig)) { + return null; + } + JSONObject createJobConfig = stepConfig.getJSONObject("createJobConfig"); + if (MapUtils.isEmpty(createJobConfig)) { + return null; + } + boolean flag = false; + CreateJobConfigVo createJobConfigVo = createJobConfig.toJavaObject(CreateJobConfigVo.class); + List configList = createJobConfigVo.getConfigList(); + if (CollectionUtils.isNotEmpty(configList)) { + for (CreateJobConfigConfigVo createJobConfigConfigVo : configList) { + if (createJobConfigConfigVo.getCombopId() != null && Objects.equals(createJobConfigConfigVo.getCombopId().toString(), dependencyVo.getFrom())) { + flag = true; + break; + } + } + } + if (!flag) { + return null; + } + JSONObject dependencyInfoConfig = new JSONObject(); + dependencyInfoConfig.put("processUuid", processUuid); + dependencyInfoConfig.put("stepUuid", stepUuid); + List pathList = new ArrayList<>(); + pathList.add("流程管理"); + pathList.add(processVo.getName()); + String urlFormat = "/" + TenantContext.get().getTenantUuid() + "/process.html#/flow-edit?uuid=${DATA.processUuid}&stepUuid=${DATA.stepUuid}"; + return new DependencyInfoVo(stepUuid, dependencyInfoConfig, stepObj.getString("name"), pathList, urlFormat, this.getGroupName()); + } return null; } diff --git a/src/main/java/neatlogic/module/autoexec/process/stephandler/makeup/CreateJobConfigMakeupHandler.java b/src/main/java/neatlogic/module/autoexec/process/stephandler/makeup/CreateJobConfigMakeupHandler.java new file mode 100644 index 00000000..830df9e4 --- /dev/null +++ b/src/main/java/neatlogic/module/autoexec/process/stephandler/makeup/CreateJobConfigMakeupHandler.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package neatlogic.module.autoexec.process.stephandler.makeup; + +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.dependency.core.DependencyManager; +import neatlogic.framework.process.dto.ProcessStepVo; +import neatlogic.framework.process.stephandler.core.IProcessStepInternalHandler; +import neatlogic.framework.process.stephandler.core.IProcessStepMakeupHandler; +import neatlogic.module.autoexec.dependency.AutoexecCombop2ProcessStepDependencyHandler; +import neatlogic.module.autoexec.process.dto.CreateJobConfigConfigVo; +import neatlogic.module.autoexec.process.dto.CreateJobConfigVo; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +@Service +public class CreateJobConfigMakeupHandler implements IProcessStepMakeupHandler { + @Override + public String getName() { + return "createJobConfig"; + } + + @Override + public void makeup(IProcessStepInternalHandler processStepInternalHandler, ProcessStepVo processStepVo, JSONObject stepConfigObj, String action) { + CreateJobConfigVo createJobConfigVo = stepConfigObj.getObject("createJobConfig", CreateJobConfigVo.class); + if (createJobConfigVo != null) { + List configList = createJobConfigVo.getConfigList(); + if (CollectionUtils.isNotEmpty(configList)) { + if (Objects.equals(action, "save")) { + for (CreateJobConfigConfigVo createJobConfigConfigVo : configList) { + if (createJobConfigConfigVo.getCombopId() != null) { + JSONObject config = new JSONObject(); + config.put("processUuid", processStepVo.getProcessUuid()); + config.put("stepUuid", processStepVo.getUuid()); + config.put("stepName", processStepVo.getName()); + DependencyManager.insert(AutoexecCombop2ProcessStepDependencyHandler.class, createJobConfigConfigVo.getCombopId(), processStepVo.getUuid(), config); + } + } + } else if (Objects.equals(action, "delete")) { + DependencyManager.delete(AutoexecCombop2ProcessStepDependencyHandler.class, processStepVo.getUuid()); + } + } + } + } +} diff --git a/src/main/java/neatlogic/module/autoexec/process/stephandler/utilhandler/CreateJobProcessUtilHandler.java b/src/main/java/neatlogic/module/autoexec/process/stephandler/utilhandler/CreateJobProcessUtilHandler.java index 452a3be0..ce12a344 100644 --- a/src/main/java/neatlogic/module/autoexec/process/stephandler/utilhandler/CreateJobProcessUtilHandler.java +++ b/src/main/java/neatlogic/module/autoexec/process/stephandler/utilhandler/CreateJobProcessUtilHandler.java @@ -25,12 +25,12 @@ import neatlogic.framework.autoexec.dto.job.AutoexecJobPhaseVo; import neatlogic.framework.autoexec.dto.job.AutoexecJobVo; import neatlogic.framework.crossover.CrossoverServiceFactory; import neatlogic.framework.notify.core.INotifyPolicyHandler; -import neatlogic.framework.process.operationauth.core.IOperationType; import neatlogic.framework.process.constvalue.ProcessTaskOperationType; import neatlogic.framework.process.constvalue.ProcessTaskStepOperationType; import neatlogic.framework.process.crossover.IProcessTaskStepDataCrossoverMapper; import neatlogic.framework.process.dto.ProcessTaskStepDataVo; import neatlogic.framework.process.dto.ProcessTaskStepVo; +import neatlogic.framework.process.operationauth.core.IOperationType; import neatlogic.framework.process.stephandler.core.ProcessStepInternalHandlerBase; import neatlogic.module.autoexec.notify.handler.AutoexecNotifyPolicyHandler; import neatlogic.module.autoexec.process.constvalue.CreateJobProcessStepHandlerType; -- Gitee From bd0c287f65b69b4af7937a474795e2a73f292473 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 26 Dec 2024 20:56:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20IT=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?-=E6=B5=81=E7=A8=8B=E5=9B=BE=E4=BF=9D=E5=AD=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1320124261302272]IT服务-流程图保存逻辑优化 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1320124261302272 --- .../AutoexecProcessUtilHandler.java | 797 +++++++++--------- 1 file changed, 395 insertions(+), 402 deletions(-) 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 5e3f7a1e..da936674 100644 --- a/src/main/java/neatlogic/module/autoexec/stephandler/utilhandler/AutoexecProcessUtilHandler.java +++ b/src/main/java/neatlogic/module/autoexec/stephandler/utilhandler/AutoexecProcessUtilHandler.java @@ -22,26 +22,19 @@ import neatlogic.framework.autoexec.dao.mapper.AutoexecJobMapper; import neatlogic.framework.autoexec.dto.job.AutoexecJobPhaseVo; import neatlogic.framework.autoexec.dto.job.AutoexecJobVo; import neatlogic.framework.crossover.CrossoverServiceFactory; -import neatlogic.framework.notify.crossover.INotifyServiceCrossoverService; -import neatlogic.framework.notify.dto.InvokeNotifyPolicyConfigVo; import neatlogic.framework.process.constvalue.AutoexecProcessStepHandlerType; -import neatlogic.framework.process.operationauth.core.IOperationType; -import neatlogic.framework.process.constvalue.ProcessTaskOperationType; -import neatlogic.framework.process.constvalue.ProcessTaskStepOperationType; import neatlogic.framework.process.crossover.IProcessTaskStepDataCrossoverMapper; import neatlogic.framework.process.dto.ProcessTaskStepDataVo; import neatlogic.framework.process.dto.ProcessTaskStepVo; -import neatlogic.framework.process.dto.processconfig.ActionConfigVo; import neatlogic.framework.process.stephandler.core.ProcessStepInternalHandlerBase; -import neatlogic.framework.process.util.ProcessConfigUtil; -import neatlogic.framework.util.SnowflakeUtil; -import neatlogic.module.autoexec.notify.handler.AutoexecNotifyPolicyHandler; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; -import org.apache.commons.lang3.StringUtils; 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 @@ -122,395 +115,395 @@ public class AutoexecProcessUtilHandler extends ProcessStepInternalHandlerBase { } - @Override - public JSONObject makeupConfig(JSONObject configObj) { - if (configObj == null) { - configObj = new JSONObject(); - } - JSONObject resultObj = new JSONObject(); - - /* 授权 **/ - IOperationType[] stepActions = { - ProcessTaskStepOperationType.STEP_VIEW, - ProcessTaskStepOperationType.STEP_TRANSFER - }; - JSONArray authorityList = configObj.getJSONArray("authorityList"); - JSONArray authorityArray = ProcessConfigUtil.regulateAuthorityList(authorityList, stepActions); - resultObj.put("authorityList", authorityArray); - - /* 按钮映射 **/ - IOperationType[] stepButtons = { - ProcessTaskStepOperationType.STEP_COMPLETE, - ProcessTaskStepOperationType.STEP_BACK, - ProcessTaskOperationType.PROCESSTASK_TRANSFER, - ProcessTaskStepOperationType.STEP_ACCEPT - }; - JSONArray customButtonList = configObj.getJSONArray("customButtonList"); - JSONArray customButtonArray = ProcessConfigUtil.regulateCustomButtonList(customButtonList, stepButtons); - resultObj.put("customButtonList", customButtonArray); - /* 状态映射列表 **/ - JSONArray customStatusList = configObj.getJSONArray("customStatusList"); - JSONArray customStatusArray = ProcessConfigUtil.regulateCustomStatusList(customStatusList); - resultObj.put("customStatusList", customStatusArray); - - /* 可替换文本列表 **/ - resultObj.put("replaceableTextList", ProcessConfigUtil.regulateReplaceableTextList(configObj.getJSONArray("replaceableTextList"))); - return resultObj; - } - - @Override - public JSONObject regulateProcessStepConfig(JSONObject configObj) { - if (configObj == null) { - configObj = new JSONObject(); - } - JSONObject resultObj = new JSONObject(); - - /* 授权 **/ - IOperationType[] stepActions = { - ProcessTaskStepOperationType.STEP_VIEW, - ProcessTaskStepOperationType.STEP_TRANSFER - }; - JSONArray authorityList = null; - Integer enableAuthority = configObj.getInteger("enableAuthority"); - if (Objects.equals(enableAuthority, 1)) { - authorityList = configObj.getJSONArray("authorityList"); - } else { - enableAuthority = 0; - } - resultObj.put("enableAuthority", enableAuthority); - JSONArray authorityArray = ProcessConfigUtil.regulateAuthorityList(authorityList, stepActions); - resultObj.put("authorityList", authorityArray); - - /* 通知 **/ - JSONObject notifyPolicyConfig = configObj.getJSONObject("notifyPolicyConfig"); - INotifyServiceCrossoverService notifyServiceCrossoverService = CrossoverServiceFactory.getApi(INotifyServiceCrossoverService.class); - InvokeNotifyPolicyConfigVo invokeNotifyPolicyConfigVo = notifyServiceCrossoverService.regulateNotifyPolicyConfig(notifyPolicyConfig, AutoexecNotifyPolicyHandler.class); - resultObj.put("notifyPolicyConfig", invokeNotifyPolicyConfigVo); - - /** 动作 **/ - JSONObject actionConfig = configObj.getJSONObject("actionConfig"); - ActionConfigVo actionConfigVo = JSONObject.toJavaObject(actionConfig, ActionConfigVo.class); - if (actionConfigVo == null) { - actionConfigVo = new ActionConfigVo(); - } - actionConfigVo.setHandler(AutoexecNotifyPolicyHandler.class.getName()); - resultObj.put("actionConfig", actionConfigVo); - - /* 按钮映射列表 **/ - IOperationType[] stepButtons = { - ProcessTaskStepOperationType.STEP_COMPLETE, - ProcessTaskStepOperationType.STEP_BACK, - ProcessTaskOperationType.PROCESSTASK_TRANSFER, - ProcessTaskStepOperationType.STEP_ACCEPT - }; - JSONArray customButtonList = configObj.getJSONArray("customButtonList"); - JSONArray customButtonArray = ProcessConfigUtil.regulateCustomButtonList(customButtonList, stepButtons); - resultObj.put("customButtonList", customButtonArray); - /* 状态映射列表 **/ - JSONArray customStatusList = configObj.getJSONArray("customStatusList"); - JSONArray customStatusArray = ProcessConfigUtil.regulateCustomStatusList(customStatusList); - resultObj.put("customStatusList", customStatusArray); - - /* 可替换文本列表 **/ - resultObj.put("replaceableTextList", ProcessConfigUtil.regulateReplaceableTextList(configObj.getJSONArray("replaceableTextList"))); - - /* 自动化配置 **/ - JSONObject autoexecConfig = configObj.getJSONObject("autoexecConfig"); - JSONObject autoexecObj = regulateAutoexecConfig(autoexecConfig); - resultObj.put("autoexecConfig", autoexecObj); - - /** 分配处理人 **/ - JSONObject workerPolicyConfig = configObj.getJSONObject("workerPolicyConfig"); - JSONObject workerPolicyObj = ProcessConfigUtil.regulateWorkerPolicyConfig(workerPolicyConfig); - resultObj.put("workerPolicyConfig", workerPolicyObj); - - JSONArray tagList = configObj.getJSONArray("tagList"); - if (tagList == null) { - tagList = new JSONArray(); - } - resultObj.put("tagList", tagList); - /** 表单场景 **/ - String formSceneUuid = configObj.getString("formSceneUuid"); - String formSceneName = configObj.getString("formSceneName"); - resultObj.put("formSceneUuid", formSceneUuid == null ? "" : formSceneUuid); - resultObj.put("formSceneName", formSceneName == null ? "" : formSceneName); - return resultObj; - } - - private JSONObject regulateAutoexecConfig(JSONObject autoexecConfig) { - JSONObject autoexecObj = new JSONObject(); - if (autoexecConfig == null) { - autoexecConfig = new JSONObject(); - } - // 失败策略 - String failPolicy = autoexecConfig.getString("failPolicy"); - if (failPolicy == null) { - failPolicy = StringUtils.EMPTY; - } - autoexecObj.put("failPolicy", failPolicy); - // 回退步骤新建作业 - Integer rerunStepToCreateNewJob = autoexecConfig.getInteger("rerunStepToCreateNewJob"); - if (rerunStepToCreateNewJob == null) { - rerunStepToCreateNewJob = 0; - } - autoexecObj.put("rerunStepToCreateNewJob", rerunStepToCreateNewJob); - JSONArray configArray = new JSONArray(); - JSONArray configList = autoexecConfig.getJSONArray("configList"); - if (CollectionUtils.isNotEmpty(configList)) { - for (int i = 0; i < configList.size(); i++) { - JSONObject config = configList.getJSONObject(i); - if (MapUtils.isEmpty(config)) { - continue; - } - String createJobPolicy = config.getString("createJobPolicy"); - if (createJobPolicy == null) { - continue; - } - JSONObject configObj = new JSONObject(); - configObj.put("createJobPolicy", createJobPolicy); - Long id = config.getLong("id"); - if (id == null) { - id = SnowflakeUtil.uniqueLong(); - } - configObj.put("id", id); - String formTag = config.getString("formTag"); - if (StringUtils.isBlank(formTag)) { - formTag = StringUtils.EMPTY; - } - configObj.put("formTag", formTag); - Long autoexecCombopId = config.getLong("autoexecCombopId"); - if (autoexecCombopId != null) { - configObj.put("autoexecCombopId", autoexecCombopId); - } - String jobName = config.getString("jobName"); - if (jobName == null) { - jobName = StringUtils.EMPTY; - } - configObj.put("jobName", jobName); - String jobNamePrefix = config.getString("jobNamePrefix"); - if (jobNamePrefix == null) { - jobNamePrefix = StringUtils.EMPTY; - } - configObj.put("jobNamePrefix", jobNamePrefix); - Boolean isShow = config.getBoolean("isShow"); - if (isShow == null) { - isShow = false; - } - configObj.put("isShow", isShow); - // 批量创建作业 - if (Objects.equals(createJobPolicy, "batch")) { - JSONObject batchJobDataSourceObj = new JSONObject(); - JSONObject batchJobDataSource = config.getJSONObject("batchJobDataSource"); - if (MapUtils.isNotEmpty(batchJobDataSource)) { - String attributeUuid = batchJobDataSource.getString("attributeUuid"); - if (attributeUuid == null) { - attributeUuid = StringUtils.EMPTY; - } - batchJobDataSourceObj.put("attributeUuid", attributeUuid); - JSONArray filterArray = new JSONArray(); - JSONArray filterList = batchJobDataSource.getJSONArray("filterList"); - if (CollectionUtils.isNotEmpty(filterList)) { - for (int j = 0; j < filterList.size(); j++) { - JSONObject filter = filterList.getJSONObject(j); - if (MapUtils.isEmpty(filter)) { - continue; - } - JSONObject filterObj = new JSONObject(); - filterObj.put("column", filter.getString("column")); - filterObj.put("expression", filter.getString("expression")); - filterObj.put("value", filter.getString("value")); - filterArray.add(filterObj); - } - } - batchJobDataSourceObj.put("filterList", filterArray); - } - 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) { - JSONArray runtimeParamArray = new JSONArray(); - for (int j = 0; j < runtimeParamList.size(); j++) { - JSONObject runtimeParamObj = runtimeParamList.getJSONObject(j); - if (MapUtils.isNotEmpty(runtimeParamObj)) { - JSONObject runtimeParam = new JSONObject(); - runtimeParam.put("key", runtimeParamObj.getString("key")); - runtimeParam.put("name", runtimeParamObj.getString("name")); - runtimeParam.put("mappingMode", runtimeParamObj.getString("mappingMode")); - runtimeParam.put("value", runtimeParamObj.get("value")); - runtimeParam.put("column", runtimeParamObj.getString("column")); - runtimeParam.put("filterList", runtimeParamObj.getJSONArray("filterList")); - runtimeParam.put("isRequired", runtimeParamObj.getInteger("isRequired")); - runtimeParam.put("type", runtimeParamObj.getString("type")); - runtimeParam.put("config", runtimeParamObj.getJSONObject("config")); - runtimeParamArray.add(runtimeParam); - } - } - configObj.put("runtimeParamList", runtimeParamArray); - } - // 目标参数赋值列表 - JSONArray executeParamList = config.getJSONArray("executeParamList"); - if (executeParamList != null) { - JSONArray executeParamArray = new JSONArray(); - for (int j = 0; j < executeParamList.size(); j++) { - JSONObject executeParamObj = executeParamList.getJSONObject(j); - if (MapUtils.isNotEmpty(executeParamObj)) { - JSONObject executeParam = new JSONObject(); - executeParam.put("key", executeParamObj.getString("key")); - executeParam.put("name", executeParamObj.getString("name")); - executeParam.put("mappingMode", executeParamObj.getString("mappingMode")); - executeParam.put("value", executeParamObj.get("value")); - executeParam.put("column", executeParamObj.getString("column")); - executeParam.put("filterList", executeParamObj.getJSONArray("filterList")); - executeParam.put("isRequired", executeParamObj.getInteger("isRequired")); - executeParamArray.add(executeParam); - } - } - configObj.put("executeParamList", executeParamArray); - } - // 导出参数列表 - JSONArray exportParamList = config.getJSONArray("exportParamList"); - if (exportParamList != null) { - JSONArray exportParamArray = new JSONArray(); - for (int j = 0; j < exportParamList.size(); j++) { - JSONObject exportParamObj = exportParamList.getJSONObject(j); - if (MapUtils.isNotEmpty(exportParamObj)) { - JSONObject exportParam = new JSONObject(); - exportParam.put("value", exportParamObj.getString("value")); - exportParam.put("text", exportParamObj.getString("text")); - exportParamArray.add(exportParam); - } - } - configObj.put("exportParamList", exportParamArray); - } - // 表单赋值列表 - JSONArray formAttributeList = config.getJSONArray("formAttributeList"); - if (formAttributeList != null) { - JSONArray formAttributeArray = new JSONArray(); - for (int j = 0; j < formAttributeList.size(); j++) { - JSONObject formAttributeObj = formAttributeList.getJSONObject(j); - if (MapUtils.isNotEmpty(formAttributeObj)) { - JSONObject formAttribute = new JSONObject(); - formAttribute.put("key", formAttributeObj.getString("key")); - formAttribute.put("name", formAttributeObj.getString("name")); - formAttribute.put("value", formAttributeObj.get("value")); - formAttributeArray.add(formAttribute); - } - } - configObj.put("formAttributeList", formAttributeArray); - } - - //执行器组 - configObj.put("runnerGroup", config.getJSONObject("runnerGroup")); - configArray.add(configObj); - } - } - autoexecObj.put("configList", configArray); - return autoexecObj; - } - - private JSONObject getAutoexecConfig(JSONObject autoexecConfig) { - JSONObject autoexecObj = new JSONObject(); - if (autoexecConfig == null) { - autoexecConfig = new JSONObject(); - } - String failPolicy = autoexecConfig.getString("failPolicy"); - if (failPolicy == null) { - failPolicy = ""; - } - autoexecObj.put("failPolicy", failPolicy); - Long autoexecTypeId = autoexecConfig.getLong("autoexecTypeId"); - if (autoexecTypeId != null) { - autoexecObj.put("autoexecTypeId", autoexecTypeId); - } - Long autoexecCombopId = autoexecConfig.getLong("autoexecCombopId"); - if (autoexecCombopId != null) { - autoexecObj.put("autoexecCombopId", autoexecCombopId); - } - JSONArray runtimeParamList = autoexecConfig.getJSONArray("runtimeParamList"); - if (runtimeParamList != null) { - JSONArray runtimeParamArray = new JSONArray(); - for (int i = 0; i < runtimeParamList.size(); i++) { - JSONObject runtimeParamObj = runtimeParamList.getJSONObject(i); - if (MapUtils.isNotEmpty(runtimeParamObj)) { - JSONObject runtimeParam = new JSONObject(); - runtimeParam.put("key", runtimeParamObj.getString("key")); - runtimeParam.put("name", runtimeParamObj.getString("name")); - runtimeParam.put("mappingMode", runtimeParamObj.getString("mappingMode")); - runtimeParam.put("value", runtimeParamObj.get("value")); - runtimeParam.put("isRequired", runtimeParamObj.getInteger("isRequired")); - runtimeParam.put("type", runtimeParamObj.getString("type")); - runtimeParam.put("config", runtimeParamObj.get("config")); - runtimeParamArray.add(runtimeParam); - } - } - autoexecObj.put("runtimeParamList", runtimeParamArray); - } - JSONArray executeParamList = autoexecConfig.getJSONArray("executeParamList"); - if (executeParamList != null) { - JSONArray executeParamArray = new JSONArray(); - for (int i = 0; i < executeParamList.size(); i++) { - JSONObject executeParamObj = executeParamList.getJSONObject(i); - if (MapUtils.isNotEmpty(executeParamObj)) { - JSONObject executeParam = new JSONObject(); - executeParam.put("key", executeParamObj.getString("key")); - executeParam.put("name", executeParamObj.getString("name")); - executeParam.put("mappingMode", executeParamObj.getString("mappingMode")); - executeParam.put("value", executeParamObj.get("value")); - executeParam.put("isRequired", executeParamObj.getInteger("isRequired")); - executeParamArray.add(executeParam); - } - } - autoexecObj.put("executeParamList", executeParamArray); - } - JSONArray exportParamList = autoexecConfig.getJSONArray("exportParamList"); - if (exportParamList != null) { - JSONArray exportParamArray = new JSONArray(); - for (int i = 0; i < exportParamList.size(); i++) { - JSONObject exportParamObj = exportParamList.getJSONObject(i); - if (MapUtils.isNotEmpty(exportParamObj)) { - JSONObject exportParam = new JSONObject(); - exportParam.put("value", exportParamObj.getString("value")); - exportParam.put("text", exportParamObj.getString("text")); - exportParamArray.add(exportParam); - } - } - autoexecObj.put("exportParamList", exportParamArray); - } - JSONArray formAttributeList = autoexecConfig.getJSONArray("formAttributeList"); - if (formAttributeList != null) { - JSONArray formAttributeArray = new JSONArray(); - for (int i = 0; i < formAttributeList.size(); i++) { - JSONObject formAttributeObj = formAttributeList.getJSONObject(i); - if (MapUtils.isNotEmpty(formAttributeObj)) { - JSONObject formAttribute = new JSONObject(); - formAttribute.put("key", formAttributeObj.getString("key")); - formAttribute.put("name", formAttributeObj.getString("name")); - formAttribute.put("value", formAttributeObj.get("value")); - formAttributeArray.add(formAttribute); - } - } - autoexecObj.put("formAttributeList", formAttributeArray); - } - return autoexecObj; - } +// @Override +// public JSONObject makeupConfig(JSONObject configObj) { +// if (configObj == null) { +// configObj = new JSONObject(); +// } +// JSONObject resultObj = new JSONObject(); +// +// /* 授权 **/ +// IOperationType[] stepActions = { +// ProcessTaskStepOperationType.STEP_VIEW, +// ProcessTaskStepOperationType.STEP_TRANSFER +// }; +// JSONArray authorityList = configObj.getJSONArray("authorityList"); +// JSONArray authorityArray = ProcessConfigUtil.regulateAuthorityList(authorityList, stepActions); +// resultObj.put("authorityList", authorityArray); +// +// /* 按钮映射 **/ +// IOperationType[] stepButtons = { +// ProcessTaskStepOperationType.STEP_COMPLETE, +// ProcessTaskStepOperationType.STEP_BACK, +// ProcessTaskOperationType.PROCESSTASK_TRANSFER, +// ProcessTaskStepOperationType.STEP_ACCEPT +// }; +// JSONArray customButtonList = configObj.getJSONArray("customButtonList"); +// JSONArray customButtonArray = ProcessConfigUtil.regulateCustomButtonList(customButtonList, stepButtons); +// resultObj.put("customButtonList", customButtonArray); +// /* 状态映射列表 **/ +// JSONArray customStatusList = configObj.getJSONArray("customStatusList"); +// JSONArray customStatusArray = ProcessConfigUtil.regulateCustomStatusList(customStatusList); +// resultObj.put("customStatusList", customStatusArray); +// +// /* 可替换文本列表 **/ +// resultObj.put("replaceableTextList", ProcessConfigUtil.regulateReplaceableTextList(configObj.getJSONArray("replaceableTextList"))); +// return resultObj; +// } +// +// @Override +// public JSONObject regulateProcessStepConfig(JSONObject configObj) { +// if (configObj == null) { +// configObj = new JSONObject(); +// } +// JSONObject resultObj = new JSONObject(); +// +// /* 授权 **/ +// IOperationType[] stepActions = { +// ProcessTaskStepOperationType.STEP_VIEW, +// ProcessTaskStepOperationType.STEP_TRANSFER +// }; +// JSONArray authorityList = null; +// Integer enableAuthority = configObj.getInteger("enableAuthority"); +// if (Objects.equals(enableAuthority, 1)) { +// authorityList = configObj.getJSONArray("authorityList"); +// } else { +// enableAuthority = 0; +// } +// resultObj.put("enableAuthority", enableAuthority); +// JSONArray authorityArray = ProcessConfigUtil.regulateAuthorityList(authorityList, stepActions); +// resultObj.put("authorityList", authorityArray); +// +// /* 通知 **/ +// JSONObject notifyPolicyConfig = configObj.getJSONObject("notifyPolicyConfig"); +// INotifyServiceCrossoverService notifyServiceCrossoverService = CrossoverServiceFactory.getApi(INotifyServiceCrossoverService.class); +// InvokeNotifyPolicyConfigVo invokeNotifyPolicyConfigVo = notifyServiceCrossoverService.regulateNotifyPolicyConfig(notifyPolicyConfig, AutoexecNotifyPolicyHandler.class); +// resultObj.put("notifyPolicyConfig", invokeNotifyPolicyConfigVo); +// +// /** 动作 **/ +// JSONObject actionConfig = configObj.getJSONObject("actionConfig"); +// ActionConfigVo actionConfigVo = JSONObject.toJavaObject(actionConfig, ActionConfigVo.class); +// if (actionConfigVo == null) { +// actionConfigVo = new ActionConfigVo(); +// } +// actionConfigVo.setHandler(AutoexecNotifyPolicyHandler.class.getName()); +// resultObj.put("actionConfig", actionConfigVo); +// +// /* 按钮映射列表 **/ +// IOperationType[] stepButtons = { +// ProcessTaskStepOperationType.STEP_COMPLETE, +// ProcessTaskStepOperationType.STEP_BACK, +// ProcessTaskOperationType.PROCESSTASK_TRANSFER, +// ProcessTaskStepOperationType.STEP_ACCEPT +// }; +// JSONArray customButtonList = configObj.getJSONArray("customButtonList"); +// JSONArray customButtonArray = ProcessConfigUtil.regulateCustomButtonList(customButtonList, stepButtons); +// resultObj.put("customButtonList", customButtonArray); +// /* 状态映射列表 **/ +// JSONArray customStatusList = configObj.getJSONArray("customStatusList"); +// JSONArray customStatusArray = ProcessConfigUtil.regulateCustomStatusList(customStatusList); +// resultObj.put("customStatusList", customStatusArray); +// +// /* 可替换文本列表 **/ +// resultObj.put("replaceableTextList", ProcessConfigUtil.regulateReplaceableTextList(configObj.getJSONArray("replaceableTextList"))); +// +// /* 自动化配置 **/ +// JSONObject autoexecConfig = configObj.getJSONObject("autoexecConfig"); +// JSONObject autoexecObj = regulateAutoexecConfig(autoexecConfig); +// resultObj.put("autoexecConfig", autoexecObj); +// +// /** 分配处理人 **/ +// JSONObject workerPolicyConfig = configObj.getJSONObject("workerPolicyConfig"); +// JSONObject workerPolicyObj = ProcessConfigUtil.regulateWorkerPolicyConfig(workerPolicyConfig); +// resultObj.put("workerPolicyConfig", workerPolicyObj); +// +// JSONArray tagList = configObj.getJSONArray("tagList"); +// if (tagList == null) { +// tagList = new JSONArray(); +// } +// resultObj.put("tagList", tagList); +// /** 表单场景 **/ +// String formSceneUuid = configObj.getString("formSceneUuid"); +// String formSceneName = configObj.getString("formSceneName"); +// resultObj.put("formSceneUuid", formSceneUuid == null ? "" : formSceneUuid); +// resultObj.put("formSceneName", formSceneName == null ? "" : formSceneName); +// return resultObj; +// } +// +// private JSONObject regulateAutoexecConfig(JSONObject autoexecConfig) { +// JSONObject autoexecObj = new JSONObject(); +// if (autoexecConfig == null) { +// autoexecConfig = new JSONObject(); +// } +// // 失败策略 +// String failPolicy = autoexecConfig.getString("failPolicy"); +// if (failPolicy == null) { +// failPolicy = StringUtils.EMPTY; +// } +// autoexecObj.put("failPolicy", failPolicy); +// // 回退步骤新建作业 +// Integer rerunStepToCreateNewJob = autoexecConfig.getInteger("rerunStepToCreateNewJob"); +// if (rerunStepToCreateNewJob == null) { +// rerunStepToCreateNewJob = 0; +// } +// autoexecObj.put("rerunStepToCreateNewJob", rerunStepToCreateNewJob); +// JSONArray configArray = new JSONArray(); +// JSONArray configList = autoexecConfig.getJSONArray("configList"); +// if (CollectionUtils.isNotEmpty(configList)) { +// for (int i = 0; i < configList.size(); i++) { +// JSONObject config = configList.getJSONObject(i); +// if (MapUtils.isEmpty(config)) { +// continue; +// } +// String createJobPolicy = config.getString("createJobPolicy"); +// if (createJobPolicy == null) { +// continue; +// } +// JSONObject configObj = new JSONObject(); +// configObj.put("createJobPolicy", createJobPolicy); +// Long id = config.getLong("id"); +// if (id == null) { +// id = SnowflakeUtil.uniqueLong(); +// } +// configObj.put("id", id); +// String formTag = config.getString("formTag"); +// if (StringUtils.isBlank(formTag)) { +// formTag = StringUtils.EMPTY; +// } +// configObj.put("formTag", formTag); +// Long autoexecCombopId = config.getLong("autoexecCombopId"); +// if (autoexecCombopId != null) { +// configObj.put("autoexecCombopId", autoexecCombopId); +// } +// String jobName = config.getString("jobName"); +// if (jobName == null) { +// jobName = StringUtils.EMPTY; +// } +// configObj.put("jobName", jobName); +// String jobNamePrefix = config.getString("jobNamePrefix"); +// if (jobNamePrefix == null) { +// jobNamePrefix = StringUtils.EMPTY; +// } +// configObj.put("jobNamePrefix", jobNamePrefix); +// Boolean isShow = config.getBoolean("isShow"); +// if (isShow == null) { +// isShow = false; +// } +// configObj.put("isShow", isShow); +// // 批量创建作业 +// if (Objects.equals(createJobPolicy, "batch")) { +// JSONObject batchJobDataSourceObj = new JSONObject(); +// JSONObject batchJobDataSource = config.getJSONObject("batchJobDataSource"); +// if (MapUtils.isNotEmpty(batchJobDataSource)) { +// String attributeUuid = batchJobDataSource.getString("attributeUuid"); +// if (attributeUuid == null) { +// attributeUuid = StringUtils.EMPTY; +// } +// batchJobDataSourceObj.put("attributeUuid", attributeUuid); +// JSONArray filterArray = new JSONArray(); +// JSONArray filterList = batchJobDataSource.getJSONArray("filterList"); +// if (CollectionUtils.isNotEmpty(filterList)) { +// for (int j = 0; j < filterList.size(); j++) { +// JSONObject filter = filterList.getJSONObject(j); +// if (MapUtils.isEmpty(filter)) { +// continue; +// } +// JSONObject filterObj = new JSONObject(); +// filterObj.put("column", filter.getString("column")); +// filterObj.put("expression", filter.getString("expression")); +// filterObj.put("value", filter.getString("value")); +// filterArray.add(filterObj); +// } +// } +// batchJobDataSourceObj.put("filterList", filterArray); +// } +// 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) { +// JSONArray runtimeParamArray = new JSONArray(); +// for (int j = 0; j < runtimeParamList.size(); j++) { +// JSONObject runtimeParamObj = runtimeParamList.getJSONObject(j); +// if (MapUtils.isNotEmpty(runtimeParamObj)) { +// JSONObject runtimeParam = new JSONObject(); +// runtimeParam.put("key", runtimeParamObj.getString("key")); +// runtimeParam.put("name", runtimeParamObj.getString("name")); +// runtimeParam.put("mappingMode", runtimeParamObj.getString("mappingMode")); +// runtimeParam.put("value", runtimeParamObj.get("value")); +// runtimeParam.put("column", runtimeParamObj.getString("column")); +// runtimeParam.put("filterList", runtimeParamObj.getJSONArray("filterList")); +// runtimeParam.put("isRequired", runtimeParamObj.getInteger("isRequired")); +// runtimeParam.put("type", runtimeParamObj.getString("type")); +// runtimeParam.put("config", runtimeParamObj.getJSONObject("config")); +// runtimeParamArray.add(runtimeParam); +// } +// } +// configObj.put("runtimeParamList", runtimeParamArray); +// } +// // 目标参数赋值列表 +// JSONArray executeParamList = config.getJSONArray("executeParamList"); +// if (executeParamList != null) { +// JSONArray executeParamArray = new JSONArray(); +// for (int j = 0; j < executeParamList.size(); j++) { +// JSONObject executeParamObj = executeParamList.getJSONObject(j); +// if (MapUtils.isNotEmpty(executeParamObj)) { +// JSONObject executeParam = new JSONObject(); +// executeParam.put("key", executeParamObj.getString("key")); +// executeParam.put("name", executeParamObj.getString("name")); +// executeParam.put("mappingMode", executeParamObj.getString("mappingMode")); +// executeParam.put("value", executeParamObj.get("value")); +// executeParam.put("column", executeParamObj.getString("column")); +// executeParam.put("filterList", executeParamObj.getJSONArray("filterList")); +// executeParam.put("isRequired", executeParamObj.getInteger("isRequired")); +// executeParamArray.add(executeParam); +// } +// } +// configObj.put("executeParamList", executeParamArray); +// } +// // 导出参数列表 +// JSONArray exportParamList = config.getJSONArray("exportParamList"); +// if (exportParamList != null) { +// JSONArray exportParamArray = new JSONArray(); +// for (int j = 0; j < exportParamList.size(); j++) { +// JSONObject exportParamObj = exportParamList.getJSONObject(j); +// if (MapUtils.isNotEmpty(exportParamObj)) { +// JSONObject exportParam = new JSONObject(); +// exportParam.put("value", exportParamObj.getString("value")); +// exportParam.put("text", exportParamObj.getString("text")); +// exportParamArray.add(exportParam); +// } +// } +// configObj.put("exportParamList", exportParamArray); +// } +// // 表单赋值列表 +// JSONArray formAttributeList = config.getJSONArray("formAttributeList"); +// if (formAttributeList != null) { +// JSONArray formAttributeArray = new JSONArray(); +// for (int j = 0; j < formAttributeList.size(); j++) { +// JSONObject formAttributeObj = formAttributeList.getJSONObject(j); +// if (MapUtils.isNotEmpty(formAttributeObj)) { +// JSONObject formAttribute = new JSONObject(); +// formAttribute.put("key", formAttributeObj.getString("key")); +// formAttribute.put("name", formAttributeObj.getString("name")); +// formAttribute.put("value", formAttributeObj.get("value")); +// formAttributeArray.add(formAttribute); +// } +// } +// configObj.put("formAttributeList", formAttributeArray); +// } +// +// //执行器组 +// configObj.put("runnerGroup", config.getJSONObject("runnerGroup")); +// configArray.add(configObj); +// } +// } +// autoexecObj.put("configList", configArray); +// return autoexecObj; +// } +// +// private JSONObject getAutoexecConfig(JSONObject autoexecConfig) { +// JSONObject autoexecObj = new JSONObject(); +// if (autoexecConfig == null) { +// autoexecConfig = new JSONObject(); +// } +// String failPolicy = autoexecConfig.getString("failPolicy"); +// if (failPolicy == null) { +// failPolicy = ""; +// } +// autoexecObj.put("failPolicy", failPolicy); +// Long autoexecTypeId = autoexecConfig.getLong("autoexecTypeId"); +// if (autoexecTypeId != null) { +// autoexecObj.put("autoexecTypeId", autoexecTypeId); +// } +// Long autoexecCombopId = autoexecConfig.getLong("autoexecCombopId"); +// if (autoexecCombopId != null) { +// autoexecObj.put("autoexecCombopId", autoexecCombopId); +// } +// JSONArray runtimeParamList = autoexecConfig.getJSONArray("runtimeParamList"); +// if (runtimeParamList != null) { +// JSONArray runtimeParamArray = new JSONArray(); +// for (int i = 0; i < runtimeParamList.size(); i++) { +// JSONObject runtimeParamObj = runtimeParamList.getJSONObject(i); +// if (MapUtils.isNotEmpty(runtimeParamObj)) { +// JSONObject runtimeParam = new JSONObject(); +// runtimeParam.put("key", runtimeParamObj.getString("key")); +// runtimeParam.put("name", runtimeParamObj.getString("name")); +// runtimeParam.put("mappingMode", runtimeParamObj.getString("mappingMode")); +// runtimeParam.put("value", runtimeParamObj.get("value")); +// runtimeParam.put("isRequired", runtimeParamObj.getInteger("isRequired")); +// runtimeParam.put("type", runtimeParamObj.getString("type")); +// runtimeParam.put("config", runtimeParamObj.get("config")); +// runtimeParamArray.add(runtimeParam); +// } +// } +// autoexecObj.put("runtimeParamList", runtimeParamArray); +// } +// JSONArray executeParamList = autoexecConfig.getJSONArray("executeParamList"); +// if (executeParamList != null) { +// JSONArray executeParamArray = new JSONArray(); +// for (int i = 0; i < executeParamList.size(); i++) { +// JSONObject executeParamObj = executeParamList.getJSONObject(i); +// if (MapUtils.isNotEmpty(executeParamObj)) { +// JSONObject executeParam = new JSONObject(); +// executeParam.put("key", executeParamObj.getString("key")); +// executeParam.put("name", executeParamObj.getString("name")); +// executeParam.put("mappingMode", executeParamObj.getString("mappingMode")); +// executeParam.put("value", executeParamObj.get("value")); +// executeParam.put("isRequired", executeParamObj.getInteger("isRequired")); +// executeParamArray.add(executeParam); +// } +// } +// autoexecObj.put("executeParamList", executeParamArray); +// } +// JSONArray exportParamList = autoexecConfig.getJSONArray("exportParamList"); +// if (exportParamList != null) { +// JSONArray exportParamArray = new JSONArray(); +// for (int i = 0; i < exportParamList.size(); i++) { +// JSONObject exportParamObj = exportParamList.getJSONObject(i); +// if (MapUtils.isNotEmpty(exportParamObj)) { +// JSONObject exportParam = new JSONObject(); +// exportParam.put("value", exportParamObj.getString("value")); +// exportParam.put("text", exportParamObj.getString("text")); +// exportParamArray.add(exportParam); +// } +// } +// autoexecObj.put("exportParamList", exportParamArray); +// } +// JSONArray formAttributeList = autoexecConfig.getJSONArray("formAttributeList"); +// if (formAttributeList != null) { +// JSONArray formAttributeArray = new JSONArray(); +// for (int i = 0; i < formAttributeList.size(); i++) { +// JSONObject formAttributeObj = formAttributeList.getJSONObject(i); +// if (MapUtils.isNotEmpty(formAttributeObj)) { +// JSONObject formAttribute = new JSONObject(); +// formAttribute.put("key", formAttributeObj.getString("key")); +// formAttribute.put("name", formAttributeObj.getString("name")); +// formAttribute.put("value", formAttributeObj.get("value")); +// formAttributeArray.add(formAttribute); +// } +// } +// autoexecObj.put("formAttributeList", formAttributeArray); +// } +// return autoexecObj; +// } } -- Gitee