From c49eaeb39986355548abe6cc4048db699373e1aa Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Fri, 31 May 2024 17:50:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=89=80=E6=9C=89=E7=BB=84=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E3=80=90=E8=8B=B1=E6=96=87=E5=90=8D=E3=80=91=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #[1168773799706624]后端-表单所有组件增加【英文名】属性 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1168773799706624 --- .../module/process/dao/mapper/catalog/ChannelMapper.xml | 1 + .../module/process/dao/mapper/processtask/ProcessTaskMapper.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/java/neatlogic/module/process/dao/mapper/catalog/ChannelMapper.xml b/src/main/java/neatlogic/module/process/dao/mapper/catalog/ChannelMapper.xml index 56dd17318..44bc4b9da 100644 --- a/src/main/java/neatlogic/module/process/dao/mapper/catalog/ChannelMapper.xml +++ b/src/main/java/neatlogic/module/process/dao/mapper/catalog/ChannelMapper.xml @@ -645,6 +645,7 @@ SELECT fa.`form_uuid` AS formUuid, fa.`formversion_uuid` AS formversionUuid, fa.`uuid`, + fa.`key`, fa.`label`, fa.`type`, fa.`handler` diff --git a/src/main/java/neatlogic/module/process/dao/mapper/processtask/ProcessTaskMapper.xml b/src/main/java/neatlogic/module/process/dao/mapper/processtask/ProcessTaskMapper.xml index 3bccad554..13941d92c 100644 --- a/src/main/java/neatlogic/module/process/dao/mapper/processtask/ProcessTaskMapper.xml +++ b/src/main/java/neatlogic/module/process/dao/mapper/processtask/ProcessTaskMapper.xml @@ -324,6 +324,7 @@ a.`form_uuid` AS formUuid, a.`handler`, a.`attribute_label` AS attributeLabel, + b.`attribute_key` AS attributeKey, a.`attribute_uuid` AS attributeUuid, a.`data` FROM `form_attribute_data` a @@ -342,6 +343,7 @@ b.`handler`, b.`tag`, b.`attribute_label` AS attributeLabel, + b.`attribute_key` AS attributeKey, b.`attribute_uuid` AS attributeUuid, b.`data` FROM `processtask_extend_formattribute` a -- Gitee From 5911d60516bf91da65107cc57190213018dbdc7d Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Tue, 4 Jun 2024 18:22:00 +0800 Subject: [PATCH 2/2] =?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=89=80=E6=9C=89=E7=BB=84=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E3=80=90=E8=8B=B1=E6=96=87=E5=90=8D=E3=80=91=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #[1168773799706624]后端-表单所有组件增加【英文名】属性 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1168773799706624 --- .../ProcessTaskFormDataListForEmailApi.java | 1 + .../handler/FormAuditHandler.java | 1 + .../mapper/processtask/ProcessTaskMapper.xml | 2 +- .../handler/param/FormParamHandler.java | 1 + .../service/ProcessStepHandlerUtil.java | 2 ++ .../ProcessTaskCreatePublicServiceImpl.java | 26 +++++++++++++++---- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/main/java/neatlogic/module/process/api/processtask/ProcessTaskFormDataListForEmailApi.java b/src/main/java/neatlogic/module/process/api/processtask/ProcessTaskFormDataListForEmailApi.java index af5bb954c..e96831ce0 100644 --- a/src/main/java/neatlogic/module/process/api/processtask/ProcessTaskFormDataListForEmailApi.java +++ b/src/main/java/neatlogic/module/process/api/processtask/ProcessTaskFormDataListForEmailApi.java @@ -94,6 +94,7 @@ public class ProcessTaskFormDataListForEmailApi extends PrivateApiComponentBase for (FormAttributeVo formAttribute : formAttributeList) { ProcessTaskFormAttributeDataVo attributeDataVo = processTaskFormAttributeDataMap.get(formAttribute.getUuid()); if (attributeDataVo != null) { + attributeDataVo.setAttributeKey(formAttribute.getKey()); attributeDataVo.setAttributeLabel(formAttribute.getLabel()); if (attributeDataVo.getData() != null) { IFormAttributeDataConversionHandler handler = FormAttributeDataConversionHandlerFactory.getHandler(formAttribute.getHandler()); diff --git a/src/main/java/neatlogic/module/process/audithandler/handler/FormAuditHandler.java b/src/main/java/neatlogic/module/process/audithandler/handler/FormAuditHandler.java index 3205d3541..e180d7c4e 100644 --- a/src/main/java/neatlogic/module/process/audithandler/handler/FormAuditHandler.java +++ b/src/main/java/neatlogic/module/process/audithandler/handler/FormAuditHandler.java @@ -116,6 +116,7 @@ public class FormAuditHandler implements IProcessTaskStepAuditDetailHandler { } ProcessTaskAuditFormAttributeDataVo auditFormAttributeDataVo = new ProcessTaskAuditFormAttributeDataVo(); auditFormAttributeDataVo.setAttributeUuid(attributeUuid); + auditFormAttributeDataVo.setAttributeKey(formAttributeVo.getKey()); auditFormAttributeDataVo.setAttributeLabel(formAttributeVo.getLabel()); auditFormAttributeDataVo.setHandler(formAttributeVo.getHandler()); auditFormAttributeDataList.add(auditFormAttributeDataVo); diff --git a/src/main/java/neatlogic/module/process/dao/mapper/processtask/ProcessTaskMapper.xml b/src/main/java/neatlogic/module/process/dao/mapper/processtask/ProcessTaskMapper.xml index 13941d92c..1ca1b3bec 100644 --- a/src/main/java/neatlogic/module/process/dao/mapper/processtask/ProcessTaskMapper.xml +++ b/src/main/java/neatlogic/module/process/dao/mapper/processtask/ProcessTaskMapper.xml @@ -324,7 +324,7 @@ a.`form_uuid` AS formUuid, a.`handler`, a.`attribute_label` AS attributeLabel, - b.`attribute_key` AS attributeKey, + a.`attribute_key` AS attributeKey, a.`attribute_uuid` AS attributeUuid, a.`data` FROM `form_attribute_data` a diff --git a/src/main/java/neatlogic/module/process/notify/handler/param/FormParamHandler.java b/src/main/java/neatlogic/module/process/notify/handler/param/FormParamHandler.java index 7c91ef599..a22ba7c7e 100644 --- a/src/main/java/neatlogic/module/process/notify/handler/param/FormParamHandler.java +++ b/src/main/java/neatlogic/module/process/notify/handler/param/FormParamHandler.java @@ -99,6 +99,7 @@ public class FormParamHandler extends ProcessTaskNotifyParamHandlerBase { attributeDataVo.setAttributeUuid(formAttribute.getUuid()); attributeDataVo.setHandler(formAttribute.getHandler()); } + attributeDataVo.setAttributeKey(formAttribute.getKey()); attributeDataVo.setAttributeLabel(formAttribute.getLabel()); IFormAttributeDataConversionHandler handler = FormAttributeDataConversionHandlerFactory.getHandler(formAttribute.getHandler()); if (handler != null) { diff --git a/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java b/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java index 9f77350ab..96babe1bf 100644 --- a/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java +++ b/src/main/java/neatlogic/module/process/service/ProcessStepHandlerUtil.java @@ -965,6 +965,7 @@ public class ProcessStepHandlerUtil implements IProcessStepHandlerUtil, IProcess } formAttributeDataVo.setProcessTaskId(processTaskId); formAttributeDataVo.setAttributeUuid(attributeUuid); + formAttributeDataVo.setAttributeKey(formAttributeVo.getKey()); formAttributeDataVo.setAttributeLabel(formAttributeVo.getLabel()); formAttributeDataVo.setHandler(formAttributeVo.getHandler()); formAttributeDataVo.setDataObj(data); @@ -1036,6 +1037,7 @@ public class ProcessStepHandlerUtil implements IProcessStepHandlerUtil, IProcess processTaskExtendFormAttributeDataVo.setHandler(formAttributeVo.getHandler()); processTaskExtendFormAttributeDataVo.setTag(tag); processTaskExtendFormAttributeDataVo.setAttributeUuid(formAttributeVo.getUuid()); + processTaskExtendFormAttributeDataVo.setAttributeKey(formAttributeVo.getKey()); processTaskExtendFormAttributeDataVo.setAttributeLabel(formAttributeVo.getLabel()); processTaskExtendFormAttributeDataVo.setData(dataList); // formMapper.insertFormExtendAttributeData(processTaskExtendFormAttributeDataVo); diff --git a/src/main/java/neatlogic/module/process/service/ProcessTaskCreatePublicServiceImpl.java b/src/main/java/neatlogic/module/process/service/ProcessTaskCreatePublicServiceImpl.java index 5d69d2555..e5cae422d 100644 --- a/src/main/java/neatlogic/module/process/service/ProcessTaskCreatePublicServiceImpl.java +++ b/src/main/java/neatlogic/module/process/service/ProcessTaskCreatePublicServiceImpl.java @@ -155,7 +155,8 @@ public class ProcessTaskCreatePublicServiceImpl implements ProcessTaskCreatePubl if (MapUtils.isNotEmpty(formAttributeData)) { String attributeUuid = formAttributeData.getString("attributeUuid"); String label = formAttributeData.getString("label"); - if (StringUtils.isBlank(attributeUuid) && StringUtils.isNotBlank(label)) { + String key = formAttributeData.getString("key"); + if (StringUtils.isBlank(attributeUuid) && (StringUtils.isNotBlank(label) || StringUtils.isNotBlank(key))) { count++; } } @@ -180,18 +181,29 @@ public class ProcessTaskCreatePublicServiceImpl implements ProcessTaskCreatePubl dataTypeNotArrayHandlerList.add(FormHandler.FORMTREESELECT.getHandler()); dataTypeNotArrayHandlerList.add(neatlogic.framework.cmdb.enums.FormHandler.FORMPROTOCOL.getHandler()); Map labelAttributeMap = new HashMap<>(); + Map keyAttributeMap = new HashMap<>(); for (FormAttributeVo formAttributeVo : formAttributeVoList) { labelAttributeMap.put(formAttributeVo.getLabel(), formAttributeVo); + keyAttributeMap.put(formAttributeVo.getKey(), formAttributeVo); } for (int i = 0; i < formAttributeDataList.size(); i++) { JSONObject formAttributeData = formAttributeDataList.getJSONObject(i); if (MapUtils.isNotEmpty(formAttributeData)) { String attributeUuid = formAttributeData.getString("attributeUuid"); String label = formAttributeData.getString("label"); - if (StringUtils.isBlank(attributeUuid) && StringUtils.isNotBlank(label)) { - FormAttributeVo formAttributeVo = labelAttributeMap.get(label); - if (formAttributeVo == null) { - throw new FormAttributeNotFoundException(label); + String key = formAttributeData.getString("key"); + if (StringUtils.isBlank(attributeUuid) && (StringUtils.isNotBlank(label) || StringUtils.isNotBlank(key))) { + FormAttributeVo formAttributeVo = null; + if (StringUtils.isNotBlank(key)) { + formAttributeVo = keyAttributeMap.get(key); + if (formAttributeVo == null) { + throw new FormAttributeNotFoundException(key); + } + } else if (StringUtils.isNotBlank(label)) { + formAttributeVo = labelAttributeMap.get(label); + if (formAttributeVo == null) { + throw new FormAttributeNotFoundException(label); + } } FormHandlerBase formAttributeHandler = (FormHandlerBase) FormAttributeHandlerFactory.getHandler(formAttributeVo.getHandler()); if (formAttributeHandler == null) { @@ -212,6 +224,7 @@ public class ProcessTaskCreatePublicServiceImpl implements ProcessTaskCreatePubl } else { AttributeDataVo attributeDataVo = new AttributeDataVo(); attributeDataVo.setAttributeUuid(formAttributeVo.getUuid()); + attributeDataVo.setAttributeKey(formAttributeVo.getKey()); attributeDataVo.setAttributeLabel(formAttributeVo.getLabel()); attributeDataVo.setDataObj(data); JSONArray textList = (JSONArray) formAttributeHandler.valueConversionText(attributeDataVo, config); @@ -237,6 +250,7 @@ public class ProcessTaskCreatePublicServiceImpl implements ProcessTaskCreatePubl } else { AttributeDataVo attributeDataVo = new AttributeDataVo(); attributeDataVo.setAttributeUuid(formAttributeVo.getUuid()); + attributeDataVo.setAttributeKey(formAttributeVo.getKey()); attributeDataVo.setAttributeLabel(formAttributeVo.getLabel()); attributeDataVo.setDataObj(data); JSONArray textList = (JSONArray) formAttributeHandler.valueConversionText(attributeDataVo, config); @@ -259,6 +273,7 @@ public class ProcessTaskCreatePublicServiceImpl implements ProcessTaskCreatePubl } else { AttributeDataVo attributeDataVo = new AttributeDataVo(); attributeDataVo.setAttributeUuid(formAttributeVo.getUuid()); + attributeDataVo.setAttributeKey(formAttributeVo.getKey()); attributeDataVo.setAttributeLabel(formAttributeVo.getLabel()); attributeDataVo.setDataObj(data); JSONArray textList = (JSONArray) formAttributeHandler.valueConversionText(attributeDataVo, config); @@ -278,6 +293,7 @@ public class ProcessTaskCreatePublicServiceImpl implements ProcessTaskCreatePubl } else { AttributeDataVo attributeDataVo = new AttributeDataVo(); attributeDataVo.setAttributeUuid(formAttributeVo.getUuid()); + attributeDataVo.setAttributeKey(formAttributeVo.getKey()); attributeDataVo.setAttributeLabel(formAttributeVo.getLabel()); attributeDataVo.setDataObj(data); JSONArray textList = (JSONArray) formAttributeHandler.valueConversionText(attributeDataVo, config); -- Gitee