From 370de81522438edc5c598313d4db39dccb7fd721 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 17 Jun 2024 19:45:27 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=96=B0=E5=A2=9E=E6=95=B0=E6=8D=AE=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #[1181253229838336]后端-表单新增数据转换功能 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1181253229838336 --- .../process/service/ProcessStepHandlerUtil.java | 16 +++++++++++++--- .../process/service/ProcessTaskServiceImpl.java | 10 ++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java b/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java index b316ae2bc..d9dbea089 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 f343a3f51..8e98cbb0f 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; } -- Gitee