diff --git a/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java b/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java index b316ae2bcd7b13fc6feb026765214f135e636456..d9dbea0898b563787731fed7e7ef79f85c0a4790 100644 --- a/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java +++ b/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java @@ -934,16 +934,17 @@ public class ProcessStepHandlerUtil implements IProcessStepHandlerUtil, IProcess } Map formExtendAttributeMap = new HashMap<>(); + Map formCustomExtendAttributeMap = new HashMap<>(); List mainSceneFormAttributeList; String formContent = selectContentByHashMapper.getProcessTaskFromContentByHash(processTaskFormVo.getFormContentHash()); + JSONObject formConfig = JSON.parseObject(formContent); + String mainSceneUuid = formConfig.getString("uuid"); { // 主场景的表单 - JSONObject formConfig = JSON.parseObject(formContent); FormVersionVo formVersionVo = new FormVersionVo(); formVersionVo.setFormUuid(processTaskFormVo.getFormUuid()); formVersionVo.setFormName(processTaskFormVo.getFormName()); formVersionVo.setFormConfig(formConfig); - String mainSceneUuid = formConfig.getString("uuid"); formVersionVo.setSceneUuid(mainSceneUuid); /* 校验表单属性是否合法 **/ FormUtil.formAttributeValueValid(formVersionVo, formAttributeDataList); @@ -952,6 +953,10 @@ public class ProcessStepHandlerUtil implements IProcessStepHandlerUtil, IProcess if (CollectionUtils.isNotEmpty(formExtendAttributeList)) { formExtendAttributeMap = formExtendAttributeList.stream().collect(Collectors.toMap(e -> e.getParentUuid() + "#" + e.getTag() + "#" + e.getKey(), e -> e)); } + List formCustomExtendAttributeList = formVersionVo.getFormCustomExtendAttributeList(); + if (CollectionUtils.isNotEmpty(formCustomExtendAttributeList)) { + formCustomExtendAttributeMap = formCustomExtendAttributeList.stream().collect(Collectors.toMap(e -> mainSceneUuid + "#" + e.getTag() + "#" + e.getKey(), e -> e)); + } } if (CollectionUtils.isEmpty(mainSceneFormAttributeList)) { return; @@ -1105,7 +1110,12 @@ public class ProcessStepHandlerUtil implements IProcessStepHandlerUtil, IProcess String parentUuid = formExtendAttributeDataObj.getString("parentUuid"); String tag = formExtendAttributeDataObj.getString("tag"); String key = formExtendAttributeDataObj.getString("key"); - FormAttributeVo formAttributeVo = formExtendAttributeMap.get(parentUuid + "#" + tag + "#" + key); + FormAttributeVo formAttributeVo = null; + if (StringUtils.isNotBlank(parentUuid)) { + formAttributeVo = formExtendAttributeMap.get(parentUuid + "#" + tag + "#" + key); + } else { + formAttributeVo = formCustomExtendAttributeMap.get(mainSceneUuid + "#" + tag + "#" + key); + } if (formAttributeVo == null) { continue; } diff --git a/src/main/java/neatlogic/module/process/service/ProcessTaskServiceImpl.java b/src/main/java/neatlogic/module/process/service/ProcessTaskServiceImpl.java index f343a3f51b08a9c76001c6d4e76ce201e594e3dc..8e98cbb0fc0e00dff09d38627622a6c7c0c85cd2 100644 --- a/src/main/java/neatlogic/module/process/service/ProcessTaskServiceImpl.java +++ b/src/main/java/neatlogic/module/process/service/ProcessTaskServiceImpl.java @@ -2160,6 +2160,15 @@ public class ProcessTaskServiceImpl implements ProcessTaskService, IProcessTaskC } } } + List formCustomExtendAttributeList = new ArrayList<>(); + List allFormCustomExtendAttributeList = formVersionVo.getFormCustomExtendAttributeList(); + if (CollectionUtils.isNotEmpty(allFormCustomExtendAttributeList)) { + for (FormAttributeVo formAttributeVo : allFormCustomExtendAttributeList) { + if (Objects.equals(formAttributeVo.getTag(), tag)) { + formCustomExtendAttributeList.add(formAttributeVo); + } + } + } for (FormAttributeVo formAttributeVo : formAttributeList) { if (parentUuidList.contains(formAttributeVo.getUuid())) { continue; @@ -2167,6 +2176,7 @@ public class ProcessTaskServiceImpl implements ProcessTaskService, IProcessTaskC resultList.add(formAttributeVo); } resultList.addAll(formExtendAttributeList); + resultList.addAll(formCustomExtendAttributeList); return resultList; }