From 35e39b7b05ab02087071214529b79843cda71d61 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Wed, 24 Apr 2024 18:27:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=A1=A8=E5=8D=95=E6=A0=87=E5=87=86?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1141293256769536]后端-自定义表单标准规范定义 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1141293256769536 --- .../java/neatlogic/module/tenant/api/form/FormSaveApi.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/neatlogic/module/tenant/api/form/FormSaveApi.java b/src/main/java/neatlogic/module/tenant/api/form/FormSaveApi.java index 8f6fd5b4..1171e63f 100644 --- a/src/main/java/neatlogic/module/tenant/api/form/FormSaveApi.java +++ b/src/main/java/neatlogic/module/tenant/api/form/FormSaveApi.java @@ -190,7 +190,7 @@ public class FormSaveApi extends PrivateApiComponentBase { } } } - formMapper.deleteFormExtendAttributeByFormUuidAndFormVersionUuid(formUuid, currentVersionUuid); + formMapper.deleteFormExtendAttributeByFormUuidAndFormVersionUuid(formUuid, formVersionVo.getUuid()); JSONObject formExtendConfig = jsonObj.getJSONObject("formExtendConfig"); if (MapUtils.isNotEmpty(formExtendConfig)) { JSONArray attributeArray = formExtendConfig.getJSONArray("attributeList"); @@ -210,7 +210,7 @@ public class FormSaveApi extends PrivateApiComponentBase { JSONObject config = attributeObj.getJSONObject("config"); FormAttributeVo formAttributeVo = new FormAttributeVo(); formAttributeVo.setFormUuid(formUuid); - formAttributeVo.setFormVersionUuid(currentVersionUuid); + formAttributeVo.setFormVersionUuid(formVersionVo.getUuid()); formAttributeVo.setParentUuid(parentUuid); formAttributeVo.setTag(tag); formAttributeVo.setKey(key); -- Gitee From dec39cb7cc24ae7c0b7433e351870d945e2a36da Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Wed, 24 Apr 2024 19:19:39 +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=87=AA=E5=AE=9A=E4=B9=89=E8=A1=A8=E5=8D=95=E6=A0=87=E5=87=86?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1141293256769536]后端-自定义表单标准规范定义 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1141293256769536 --- .../module/tenant/api/form/FormCopyApi.java | 15 ++++++--------- .../module/tenant/api/form/FormDeleteApi.java | 6 ++---- .../module/tenant/api/form/FormSaveApi.java | 5 +++-- .../tenant/api/form/FormVersionDeleteApi.java | 6 ++---- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/main/java/neatlogic/module/tenant/api/form/FormCopyApi.java b/src/main/java/neatlogic/module/tenant/api/form/FormCopyApi.java index 8df28a69..e40bca1a 100644 --- a/src/main/java/neatlogic/module/tenant/api/form/FormCopyApi.java +++ b/src/main/java/neatlogic/module/tenant/api/form/FormCopyApi.java @@ -1,10 +1,12 @@ package neatlogic.module.tenant.api.form; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.common.base.Objects; import neatlogic.framework.auth.core.AuthAction; import neatlogic.framework.auth.label.FORM_MODIFY; import neatlogic.framework.common.constvalue.ApiParamType; -import neatlogic.framework.crossover.CrossoverServiceFactory; import neatlogic.framework.dto.FieldValidResultVo; import neatlogic.framework.exception.type.ParamNotExistsException; import neatlogic.framework.form.dao.mapper.FormMapper; @@ -14,16 +16,13 @@ import neatlogic.framework.form.dto.FormVo; import neatlogic.framework.form.exception.FormNameRepeatException; import neatlogic.framework.form.exception.FormNotFoundException; import neatlogic.framework.form.exception.FormVersionNotFoundException; -import neatlogic.framework.form.service.IFormCrossoverService; import neatlogic.framework.restful.annotation.*; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.IValid; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; +import neatlogic.framework.util.FormUtil; import neatlogic.framework.util.RegexUtils; import neatlogic.framework.util.UuidUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.google.common.base.Objects; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -115,13 +114,12 @@ public class FormCopyApi extends PrivateApiComponentBase { newFormVersionList.get(i).setVersion(i + 1); } } - IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class); // 遍历要复制的版本列表 for (FormVersionVo formVersionVo : newFormVersionList) { // 插入表单版本 formMapper.insertFormVersion(formVersionVo); // 保存依赖 - formCrossoverService.saveDependency(formVersionVo); + FormUtil.saveDependency(formVersionVo); if (formVersionVo.getIsActive().equals(1)) { newFrom.setCurrentVersion(formVersionVo.getVersion()); newFrom.setCurrentVersionUuid(formVersionVo.getUuid()); @@ -175,8 +173,7 @@ public class FormCopyApi extends PrivateApiComponentBase { } String content = formConfig.toJSONString(); - IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class); - List allFormAttributeList = formCrossoverService.getAllFormAttributeList(formConfig); + List allFormAttributeList = FormUtil.getAllFormAttributeList(formConfig); for (FormAttributeVo formAttributeVo : allFormAttributeList) { // 更新表单属性uuid content = content.replace(formAttributeVo.getUuid(), UuidUtil.randomUuid()); diff --git a/src/main/java/neatlogic/module/tenant/api/form/FormDeleteApi.java b/src/main/java/neatlogic/module/tenant/api/form/FormDeleteApi.java index 42329408..3fea0a57 100644 --- a/src/main/java/neatlogic/module/tenant/api/form/FormDeleteApi.java +++ b/src/main/java/neatlogic/module/tenant/api/form/FormDeleteApi.java @@ -4,16 +4,15 @@ import com.alibaba.fastjson.JSONObject; import neatlogic.framework.auth.core.AuthAction; import neatlogic.framework.auth.label.FORM_MODIFY; import neatlogic.framework.common.constvalue.ApiParamType; -import neatlogic.framework.crossover.CrossoverServiceFactory; import neatlogic.framework.dependency.constvalue.FrameworkFromType; import neatlogic.framework.dependency.core.DependencyManager; import neatlogic.framework.form.dao.mapper.FormMapper; import neatlogic.framework.form.dto.FormVersionVo; import neatlogic.framework.form.exception.FormReferencedCannotBeDeletedException; -import neatlogic.framework.form.service.IFormCrossoverService; import neatlogic.framework.restful.annotation.*; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; +import neatlogic.framework.util.FormUtil; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -62,9 +61,8 @@ public class FormDeleteApi extends PrivateApiComponentBase { } List formVersionList = formMapper.getFormVersionByFormUuid(uuid); if (CollectionUtils.isNotEmpty(formVersionList)) { - IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class); for (FormVersionVo formVersionVo : formVersionList) { - formCrossoverService.deleteDependency(formVersionVo); + FormUtil.deleteDependency(formVersionVo); } } formMapper.deleteFormByUuid(uuid); diff --git a/src/main/java/neatlogic/module/tenant/api/form/FormSaveApi.java b/src/main/java/neatlogic/module/tenant/api/form/FormSaveApi.java index 1171e63f..4c7826ef 100644 --- a/src/main/java/neatlogic/module/tenant/api/form/FormSaveApi.java +++ b/src/main/java/neatlogic/module/tenant/api/form/FormSaveApi.java @@ -19,6 +19,7 @@ import neatlogic.framework.restful.annotation.*; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.IValid; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; +import neatlogic.framework.util.FormUtil; import neatlogic.framework.util.RegexUtils; import neatlogic.framework.util.UuidUtil; import org.apache.commons.collections4.CollectionUtils; @@ -98,7 +99,7 @@ public class FormSaveApi extends PrivateApiComponentBase { if (Objects.equals(oldFormVersionVo.getFormConfig(), formVo.getFormConfig())) { updateFormConfig = false; } else { - formCrossoverService.deleteDependency(oldFormVersionVo); + FormUtil.deleteDependency(oldFormVersionVo); } } } @@ -179,7 +180,7 @@ public class FormSaveApi extends PrivateApiComponentBase { } else { formMapper.updateFormVersion(formVersionVo); } - formCrossoverService.saveDependency(formVersionVo); + FormUtil.saveDependency(formVersionVo); //保存激活版本时,更新表单属性信息 if (Objects.equals(formVersionVo.getIsActive(), 1)) { formMapper.deleteFormAttributeByFormUuid(formUuid); diff --git a/src/main/java/neatlogic/module/tenant/api/form/FormVersionDeleteApi.java b/src/main/java/neatlogic/module/tenant/api/form/FormVersionDeleteApi.java index 9d855135..5432cf69 100644 --- a/src/main/java/neatlogic/module/tenant/api/form/FormVersionDeleteApi.java +++ b/src/main/java/neatlogic/module/tenant/api/form/FormVersionDeleteApi.java @@ -4,18 +4,17 @@ import com.alibaba.fastjson.JSONObject; import neatlogic.framework.auth.core.AuthAction; import neatlogic.framework.auth.label.FORM_MODIFY; import neatlogic.framework.common.constvalue.ApiParamType; -import neatlogic.framework.crossover.CrossoverServiceFactory; import neatlogic.framework.form.dao.mapper.FormMapper; import neatlogic.framework.form.dto.FormVersionVo; import neatlogic.framework.form.exception.FormActiveVersionCannotBeDeletedException; import neatlogic.framework.form.exception.FormVersionNotFoundException; -import neatlogic.framework.form.service.IFormCrossoverService; import neatlogic.framework.restful.annotation.Description; import neatlogic.framework.restful.annotation.Input; import neatlogic.framework.restful.annotation.OperationType; import neatlogic.framework.restful.annotation.Param; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; +import neatlogic.framework.util.FormUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -58,8 +57,7 @@ public class FormVersionDeleteApi extends PrivateApiComponentBase { } //删除表单版本 formMapper.deleteFormVersionByUuid(uuid); - IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class); - formCrossoverService.deleteDependency(formVersion); + FormUtil.deleteDependency(formVersion); return null; } -- Gitee