diff --git a/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java b/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java index 723f36b71f66fb541b0321a536d52bc3c317f818..26f3b9214ff6629da7d0ff2178f2280136fe7600 100644 --- a/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java +++ b/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java @@ -36,6 +36,8 @@ public class FormVersionVo extends BaseEditorVo { private JSONObject formConfig; private String sceneUuid; @JSONField(serialize = false) + private List formCustomExtendAttributeList; + @JSONField(serialize = false) private List formExtendAttributeList; @JSONField(serialize = false) private List formAttributeList; @@ -320,4 +322,56 @@ public class FormVersionVo extends BaseEditorVo { public void setFormExtendAttributeList(List formExtendAttributeList) { this.formExtendAttributeList = formExtendAttributeList; } + + public List getFormCustomExtendAttributeList() { + if (formCustomExtendAttributeList == null) { + if (MapUtils.isNotEmpty(getFormConfig())) { + JSONObject formCustomExtendConfig = this.formConfig.getJSONObject("formCustomExtendConfig"); + if (MapUtils.isNotEmpty(formCustomExtendConfig)) { + JSONArray extendConfigList = formCustomExtendConfig.getJSONArray("extendConfigList"); + if (CollectionUtils.isNotEmpty(extendConfigList)) { + for (int i = 0; i < extendConfigList.size(); i++) { + JSONObject extendConfigObj = extendConfigList.getJSONObject(i); + if (MapUtils.isEmpty(extendConfigObj)) { + continue; + } + JSONArray attributeArray = extendConfigObj.getJSONArray("attributeList"); + if (CollectionUtils.isNotEmpty(attributeArray)) { + String mainSceneUuid = this.formConfig.getString("uuid"); + formCustomExtendAttributeList = new ArrayList<>(); + for (int j = 0; j < attributeArray.size(); j++) { + JSONObject attributeObj = attributeArray.getJSONObject(j); + if (MapUtils.isEmpty(attributeObj)) { + continue; + } + String tag = attributeObj.getString("tag"); + String key = attributeObj.getString("key"); + String label = attributeObj.getString("label"); + String type = attributeObj.getString("type"); + String handler = attributeObj.getString("handler"); + JSONObject config = attributeObj.getJSONObject("config"); + FormAttributeVo formAttributeVo = new FormAttributeVo(); + formAttributeVo.setFormUuid(formUuid); + formAttributeVo.setFormVersionUuid(uuid); + formAttributeVo.setTag(tag); + formAttributeVo.setKey(key); + formAttributeVo.setUuid(UuidUtil.getCustomUUID(mainSceneUuid + "#" + tag + "#" + key)); + formAttributeVo.setLabel(label); + formAttributeVo.setType(type); + formAttributeVo.setHandler(handler); + formAttributeVo.setConfig(config); + formCustomExtendAttributeList.add(formAttributeVo); + } + } + } + } + } + } + } + return formCustomExtendAttributeList; + } + + public void setFormCustomExtendAttributeList(List formCustomExtendAttributeList) { + this.formCustomExtendAttributeList = formCustomExtendAttributeList; + } } diff --git a/src/main/resources/neatlogic/resources/framework/changelog/2024-06-17/neatlogic_tenant.sql b/src/main/resources/neatlogic/resources/framework/changelog/2024-06-17/neatlogic_tenant.sql new file mode 100644 index 0000000000000000000000000000000000000000..ebc2f01907dea04953cfb90e37d01b787320016c --- /dev/null +++ b/src/main/resources/neatlogic/resources/framework/changelog/2024-06-17/neatlogic_tenant.sql @@ -0,0 +1,2 @@ +ALTER TABLE `form_extend_attribute` + CHANGE `parent_uuid` `parent_uuid` CHAR(32) CHARSET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '属性父级uuid'; \ No newline at end of file diff --git a/src/main/resources/neatlogic/resources/framework/changelog/2024-06-17/version.json b/src/main/resources/neatlogic/resources/framework/changelog/2024-06-17/version.json new file mode 100644 index 0000000000000000000000000000000000000000..f210cce6c0d48a945c900b93a5f2137eebf21609 --- /dev/null +++ b/src/main/resources/neatlogic/resources/framework/changelog/2024-06-17/version.json @@ -0,0 +1,10 @@ +{ + "content":[ + { + "type":"新增功能", + "detail":[ + {"msg":"1.表单新增数据转换功能"} + ] + } + ] +}