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 af5bb954ce5d77f94283faebb8424cc57fd6318b..e96831ce0e4dc5bd5497d730e1743cee1bb43dd6 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 3205d35417c70397b84dea5e52da16dff9253761..e180d7c4e2ad8bfcd7cd31490957d273b017e74b 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/catalog/ChannelMapper.xml b/src/main/java/neatlogic/module/process/dao/mapper/catalog/ChannelMapper.xml index 56dd17318fe13474676ec502cefad0d72a02d3d1..44bc4b9da28e1f2b4e562cfbc621c25be838377d 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 3bccad5545ec61fa90ebcadb504e8d772e4459f0..1ca1b3becba57c8b4ff7cbb782ee3dc6eb574b23 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, + a.`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 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 7c91ef5998b70881a86419889b84dd18ebdb3103..a22ba7c7e11e881b3573a7c52dfd5f4ba4578bd4 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 9f77350ab3181ff6c4efdfd805782a9199acf9cf..96babe1bf8767b3ad23e739bd532d013d9333a08 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 5d69d25551abc989a3ebd2b6996ce89322ea2d3a..e5cae422d3ded774dd6e894b59b0c9d7d36a839b 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);