From fc32cff25d2d0892179d37b690c0e4782e5fbb7e Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Sun, 14 Jun 2020 17:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8A=A8=E6=80=81=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E8=A1=A8=E5=90=8D=E4=BF=AE=E6=94=B9=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E5=AD=97=E6=AE=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dynamic/config/form/IDynamicConfigFormDao.java | 9 +++++++++ .../config/form/IDynamicConfigFormService.java | 9 +++++++++ .../form/impl/DynamicConfigFormServiceImpl.java | 9 +++++++++ .../config/impl/DynamicConfigTableServiceImpl.java | 3 +++ .../dynamic/config/form/dynamicconfigform-mapper.xml | 12 ++++++++++++ 5 files changed, 42 insertions(+) diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/dao/dynamic/config/form/IDynamicConfigFormDao.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/dao/dynamic/config/form/IDynamicConfigFormDao.java index a85feb4..56f9419 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/dao/dynamic/config/form/IDynamicConfigFormDao.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/dao/dynamic/config/form/IDynamicConfigFormDao.java @@ -46,6 +46,14 @@ public interface IDynamicConfigFormDao { */ void updateForm(Map params) throws UpdateException; + /** + * 修改表单中的表名 + * + * @param params + * @throws UpdateException + */ + void updateFormTableName(Map params) throws UpdateException; + /** * 表单详情 * @@ -63,4 +71,5 @@ public interface IDynamicConfigFormDao { * @throws SearchException */ List listForm(Map params) throws SearchException; + } diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/form/IDynamicConfigFormService.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/form/IDynamicConfigFormService.java index 0a55851..33af984 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/form/IDynamicConfigFormService.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/form/IDynamicConfigFormService.java @@ -53,6 +53,15 @@ public interface IDynamicConfigFormService { */ SuccessResult updateForm(String id, DynamicConfigFormVO dynamicConfigFormVO) throws Exception; + /** + * 修改表单中的表名 + * + * @param newTableName + * @param oldTableName + * @throws UpdateException + */ + void updateFormTableName(String newTableName, String oldTableName) throws UpdateException; + /** * 字段列表显示修改 * diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/form/impl/DynamicConfigFormServiceImpl.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/form/impl/DynamicConfigFormServiceImpl.java index 569701f..a2064b5 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/form/impl/DynamicConfigFormServiceImpl.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/form/impl/DynamicConfigFormServiceImpl.java @@ -66,6 +66,15 @@ public class DynamicConfigFormServiceImpl extends AbstractService implements IDy return new SuccessResult(); } + @Override + public void updateFormTableName(String newTableName, String oldTableName) throws UpdateException { + Map params = getHashMap(4); + params.put("newTableName", newTableName); + params.put("oldTableName", oldTableName); + setUpdateInfo(params); + dynamicConfigFormDao.updateFormTableName(params); + } + @Override public SuccessResult updateFieldListShow(String id, FieldShowVO fieldShowVO) throws UpdateException { Map params = getHashMap(2); diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/impl/DynamicConfigTableServiceImpl.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/impl/DynamicConfigTableServiceImpl.java index 706a18f..0747ba1 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/impl/DynamicConfigTableServiceImpl.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/config/impl/DynamicConfigTableServiceImpl.java @@ -116,8 +116,11 @@ public class DynamicConfigTableServiceImpl extends AbstractService implements ID public SuccessResult updateTable(String id, DynamicConfigTableVO dynamicConfigTableVO) throws Exception { Map params = HashMapUtil.beanToMap(dynamicConfigTableVO); params.put("id", id); + DynamicConfigTableDTO dynamicConfigTableDTO = dynamicConfigTableDao.getTableById(params); setUpdateInfo(params); dynamicConfigTableDao.updateTable(params); + // 修改表单中的表名 + dynamicConfigFormService.updateFormTableName(dynamicConfigTableVO.getTableName(), dynamicConfigTableDTO.getTableName()); return new SuccessResult(); } diff --git a/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/config/form/dynamicconfigform-mapper.xml b/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/config/form/dynamicconfigform-mapper.xml index df13f9f..02ba448 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/config/form/dynamicconfigform-mapper.xml +++ b/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/config/form/dynamicconfigform-mapper.xml @@ -154,6 +154,18 @@ id = #{id} + + + UPDATE + dynamic_config_form + SET + table_name = #{newTableName}, + modifier = #{modifier}, + gmt_modified = #{gmtModified} + WHERE + table_name = #{oldTableName} + +