From b79991a74398e616737eaad9b7a645b1c2026cb8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 10 Mar 2022 10:51:25 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E7=B1=BB=E5=88=AB=E5=8F=98=E5=8A=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=96=B0=E5=A2=9E/=E5=87=8F=E5=B0=91?= =?UTF-8?q?=E5=90=8E=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IcUserChangeRecordServiceImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index d9662fdc8b..caca478526 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -134,6 +134,14 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); @@ -265,4 +273,4 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl Date: Fri, 11 Mar 2022 15:00:30 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E8=B0=83=E5=8A=A8=EF=BC=8Cdetail=E8=A1=A8=E7=9A=84typ?= =?UTF-8?q?e=E5=92=8CtypeName=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcResiUserImportServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index c636d91b43..3eed6a252d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -1572,7 +1572,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res if (!StringUtils.isAllBlank(categoryDescBefore, categoryDescAfter)) { IcUserChangeRecordEntity categoryChangeRecord = fillChangeRecord(loginUserCustomerId, resiId, resiName, transferRecord.getId(), operator.getStaffId(), - operator.getRealName(), categoryDescBefore, categoryDescAfter , "category", "类别", "", now); + operator.getRealName(), categoryDescBefore, categoryDescAfter , "transfer", "调动", "", now); icUserChangeRecordDao.insert(categoryChangeRecord); } @@ -1586,7 +1586,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res if ("1".equals(oldValue)) { IcUserChangeDetailedEntity changeDetail = fillChangeDetail(loginUserCustomerId, resiId, transferChangeRecord.getId(), oldAgencyId, oldGridId, oldvillageId, oldBuildId, oldUnitId, - oldHomeId, transferChangeRecord.getType(), transferChangeRecord.getTypeName(), key, -1, pids); + oldHomeId, "out", "迁出", key, -1, pids); icUserChangeDetailedDao.insert(changeDetail); } } @@ -1600,7 +1600,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res if ("1".equals(newValue)) { IcUserChangeDetailedEntity changeDetail = fillChangeDetail(loginUserCustomerId, resiId, transferChangeRecord.getId(), newAgencyId, newGridId, newvillageId, newBuildId, newUnitId, - newHomeId, transferChangeRecord.getType(), transferChangeRecord.getTypeName(), key, 1, pids); + newHomeId, "in", "迁入", key, 1, pids); icUserChangeDetailedDao.insert(changeDetail); } } From 53f98c8c421da4c078af44ed638b581d8fef137f Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Fri, 11 Mar 2022 15:25:04 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcResiUserImportServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 3eed6a252d..e659784cbf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -1538,7 +1538,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // 保存 调动changeRecord IcUserChangeRecordEntity transferChangeRecord = fillChangeRecord(loginUserCustomerId, resiId, resiName, transferRecord.getId(), operator.getStaffId(), - operator.getRealName(), sbBefore.toString(), sbAfter.toString(), "transfer", "调动", "", now); + operator.getRealName(), sbBefore.toString(), sbAfter.toString(), "category", "类别", "", now); icUserChangeRecordDao.insert(transferChangeRecord); // 保存 类别变更changeRecord From b748556401cbd6f084517bcf306efdeffebf9169 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Fri, 11 Mar 2022 15:28:34 +0800 Subject: [PATCH 04/14] - --- .../com/epmet/service/impl/IcResiUserImportServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index e659784cbf..ba259e7f43 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -1538,7 +1538,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // 保存 调动changeRecord IcUserChangeRecordEntity transferChangeRecord = fillChangeRecord(loginUserCustomerId, resiId, resiName, transferRecord.getId(), operator.getStaffId(), - operator.getRealName(), sbBefore.toString(), sbAfter.toString(), "category", "类别", "", now); + operator.getRealName(), sbBefore.toString(), sbAfter.toString(), "transfer", "调动", "", now); icUserChangeRecordDao.insert(transferChangeRecord); // 保存 类别变更changeRecord @@ -1572,7 +1572,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res if (!StringUtils.isAllBlank(categoryDescBefore, categoryDescAfter)) { IcUserChangeRecordEntity categoryChangeRecord = fillChangeRecord(loginUserCustomerId, resiId, resiName, transferRecord.getId(), operator.getStaffId(), - operator.getRealName(), categoryDescBefore, categoryDescAfter , "transfer", "调动", "", now); + operator.getRealName(), categoryDescBefore, categoryDescAfter , "category", "类别", "", now); icUserChangeRecordDao.insert(categoryChangeRecord); } From 151543ef6c5065e41ec99fc37fa23af3acdb9475 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 15 Mar 2022 09:52:43 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E4=B8=B4=E6=97=B6=20=E5=8A=A0=E5=A4=A7fe?= =?UTF-8?q?ign=E6=A0=B8=E5=BF=83=E7=BA=BF=E7=A8=8B=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open-data-worker-server/src/main/resources/bootstrap.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml index a27e8fdf66..920c7b63f4 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml @@ -97,6 +97,9 @@ mybatis-plus: feign: hystrix: + threadpool: + default: + coreSize: 50 enabled: true client: config: @@ -146,4 +149,4 @@ thread: queueCapacity: @thread.threadPool.queue-capacity@ keepAliveSeconds: @thread.threadPool.keep-alive-seconds@ threadNamePrefix: @thread.threadPool.thread-name-prefix@ - rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@ \ No newline at end of file + rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@ From a649b13e97f68b68d1c62a8935634499a229e718 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 15 Mar 2022 10:51:39 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml index 920c7b63f4..284526ad4d 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml @@ -97,10 +97,13 @@ mybatis-plus: feign: hystrix: + enabled: true threadpool: default: - coreSize: 50 - enabled: true + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 8000 client: config: default: From a21c3790c7278974c306ed2aa7c41603a869516d Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 15 Mar 2022 14:39:31 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E9=87=8D=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/IcNeighborHoodDao.java | 2 +- .../com/epmet/service/impl/NeighborHoodServiceImpl.java | 6 +++--- .../src/main/resources/mapper/IcNeighborHoodDao.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java index 3203e96854..43b6aedaf5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -48,7 +48,7 @@ public interface IcNeighborHoodDao extends BaseDao { @Param("agencyNameList") List agencyNameList, @Param("gridNameList") List gridNameList); - Integer checkNameUq(@Param("customerId") String customerId, + Integer checkNameUq(@Param("gridId") String gridId, @Param("neighborHoodName")String neighborHoodName, @Param("neighborId")String neighborId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java index 5c68f83dba..0aeca0d13b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -73,8 +73,8 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { @Override @Transactional(rollbackFor = Exception.class) public void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { - //同一客户下,小区名称唯一 - Integer count = icNeighborHoodDao.checkNameUq(customerId,formDTO.getNeighborHoodName(),null); + //同一网格下,小区名称唯一 + Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),null); if (null != count && count > 0) { throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); } @@ -155,7 +155,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { @Transactional(rollbackFor = Exception.class) public void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { //同一客户下,小区名称唯一 - Integer count = icNeighborHoodDao.checkNameUq(customerId,formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId()); + Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId()); if (null != count && count > 0) { throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index 36daaf0d27..4b4576bb6b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -208,7 +208,7 @@ count(*) from ic_neighbor_hood a where a.del_flag='0' - and a.customer_id=#{customerId} + and a.grid_id=#{customerId} and a.NEIGHBOR_HOOD_NAME=#{neighborHoodName} and a.id !=#{neighborId} From 30f35c723c6935c381871ad5d6e3d8fa65a265c6 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 15 Mar 2022 14:49:52 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E9=87=8D=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcNeighborHoodDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index 4b4576bb6b..acc02135cf 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -208,7 +208,7 @@ count(*) from ic_neighbor_hood a where a.del_flag='0' - and a.grid_id=#{customerId} + and a.grid_id=#{gridId} and a.NEIGHBOR_HOOD_NAME=#{neighborHoodName} and a.id !=#{neighborId} From d46e8e11545409a288616322038239026429984a Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Mar 2022 17:20:52 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E5=85=A8=E5=B9=B2=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/redis/RedisKeys.java | 10 +++++++++- .../java/com/epmet/redis/GovCustomerMenuRedis.java | 12 ++++-------- .../service/impl/GovCustomerMenuServiceImpl.java | 5 ++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 0798627046..e09d7c1615 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -734,6 +734,14 @@ public class RedisKeys { } public static String getCustomerMenuList(String customerId, Integer type) { - return rootPrefix.concat("oper:access:nav:customerId:").concat(customerId).concat(":type:")+type; + return getCustomerMenuListPrefix().concat(customerId).concat(":type:")+type; + } + + /** + * desc:菜单缓存前缀 + * @return + */ + public static String getCustomerMenuListPrefix() { + return rootPrefix.concat("oper:access:nav:customerId:"); } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java index 3cc19b8ae2..6d2ec60e64 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java @@ -17,6 +17,7 @@ package com.epmet.redis; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.dto.GovMenuDTO; @@ -66,16 +67,11 @@ public class GovCustomerMenuRedis { /** * desc:删除客户菜单缓存 - * @param customerId - * @param type * @see com.epmet.enums.MenuTypeEnum */ - public void delCustomerMenu(String customerId, Integer type) { - if (checkParam(customerId, type)) { - String key = RedisKeys.getCustomerMenuList(customerId, type); - redisUtils.delete(key); - } - + public void delAllCustomerMenu() { + String key = RedisKeys.getCustomerMenuListPrefix().concat(StrConstant.STAR); + redisUtils.delete(key); } private boolean checkParam(String customerId, Integer type) { diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java index 95e4f2f8d2..a5933f8e58 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java @@ -28,7 +28,6 @@ import com.epmet.dao.GovCustomerMenuDao; import com.epmet.dto.GovCustomerMenuDTO; import com.epmet.dto.form.MenuConfigFormDTO; import com.epmet.entity.GovCustomerMenuEntity; -import com.epmet.enums.MenuTypeEnum; import com.epmet.redis.GovCustomerMenuRedis; import com.epmet.service.GovCustomerMenuService; import org.apache.commons.lang3.StringUtils; @@ -119,8 +118,8 @@ public class GovCustomerMenuServiceImpl extends BaseServiceImpl govCustomerMenuRedis.delCustomerMenu(customerId, MenuTypeEnum.MENU.value())); + //删除全部客户缓存 + govCustomerMenuRedis.delAllCustomerMenu(); } @Override From 303703a316f6a93b497c7e4875c364bf11e22bd9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Mar 2022 17:45:08 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E5=85=A8=E5=B9=B2=E6=8E=89=20*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/redis/GovCustomerMenuRedis.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java index 6d2ec60e64..6190a7c4c0 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java @@ -71,7 +71,7 @@ public class GovCustomerMenuRedis { */ public void delAllCustomerMenu() { String key = RedisKeys.getCustomerMenuListPrefix().concat(StrConstant.STAR); - redisUtils.delete(key); + redisUtils.deleteByPattern(key); } private boolean checkParam(String customerId, Integer type) { From 3a27ac452f02eb3b0ac3e102242d411d93cf23cc Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Mar 2022 19:21:14 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E6=A0=B9=E6=8D=AEid=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=B9=E6=B3=95=20=E5=B9=B6=E5=A1=AB?= =?UTF-8?q?=E5=85=85=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/config/MybatisPlusConfig.java | 6 +++++ .../epmet/commons/mybatis/dao/BaseDao.java | 4 ++-- .../interceptor/MybatisPlusSqlInjector.java | 23 +++++++++++++++++++ .../commons/mybatis/mapper/MyBaseMapper.java | 21 +++++++++++++++++ .../epmetuser/test/UserControllerTest.java | 12 ++++++++++ 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java index 8ef978f3c3..d5537bb17d 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java @@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import com.epmet.commons.mybatis.interceptor.DataFilterInterceptor; +import com.epmet.commons.mybatis.interceptor.MybatisPlusSqlInjector; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; @@ -44,5 +45,10 @@ public class MybatisPlusConfig { interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); return interceptor; } + @Bean + @Order(2) + public MybatisPlusSqlInjector mybatisPlusSqlInjector(){ + return new MybatisPlusSqlInjector(); + } } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java index f23017b6f7..30b95eaa4c 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java @@ -8,7 +8,7 @@ package com.epmet.commons.mybatis.dao; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.epmet.commons.mybatis.mapper.MyBaseMapper; /** * 基础Dao @@ -16,6 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ -public interface BaseDao extends BaseMapper { +public interface BaseDao extends MyBaseMapper { } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java new file mode 100644 index 0000000000..21cc58edd8 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java @@ -0,0 +1,23 @@ +package com.epmet.commons.mybatis.interceptor; + +import com.baomidou.mybatisplus.core.injector.AbstractMethod; +import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; +import com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill; + +import java.util.List; + +/** + * desc:mybatisPlus拦截器 + * + * @author: LiuJanJun + * @date: 2022/3/16 6:33 下午 + * @version: 1.0 + */ +public class MybatisPlusSqlInjector extends DefaultSqlInjector { + @Override + public List getMethodList(Class mapperClass) { + final List methods = super.getMethodList(mapperClass); + methods.add(new LogicDeleteByIdWithFill()); + return methods; + } +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java new file mode 100644 index 0000000000..13d589e918 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java @@ -0,0 +1,21 @@ +package com.epmet.commons.mybatis.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * desc:自定义mapper方法 + * + * @author: LiuJanJun + * @date: 2022/3/16 6:42 下午 + * @version: 1.0 + */ +public interface MyBaseMapper extends BaseMapper { + /** + * 根据Id逻辑删除 并 填充其他字段的值 id必填 + * + * @param entity 要删除的实体对象 + * @return 受影响记录数量 + */ + int deleteByIdWithFill(Entity entity); + +} diff --git a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java index 06d674a4e3..a777c0c4da 100644 --- a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java @@ -1,7 +1,9 @@ package com.epmet.epmetuser.test; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.entity.CustomerStaffEntity; import com.epmet.service.UserService; import org.junit.Test; import org.junit.runner.RunWith; @@ -16,10 +18,20 @@ public class UserControllerTest { @Autowired private UserService userService; + @Autowired + private CustomerStaffDao customerStaffDao; + @Test public void getLoginUserDetails() { LoginUserDetailsResultDTO loginUserDetails = userService.getLoginUserDetails(AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, "4aaab913d9f11d90a2cb4dd21b075259"); System.out.println(loginUserDetails); } + @Test + public void del() { + CustomerStaffEntity entity = new CustomerStaffEntity(); + //entity.setId("1476792429129445378"); + entity.setRealName("刘建军3"); + customerStaffDao.deleteByIdWithFill(entity); + } } From 6da2a6682f7abdc0a2941c9243557275c025f9b0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 17 Mar 2022 09:08:40 +0800 Subject: [PATCH 12/14] =?UTF-8?q?Revert=20"=E6=A0=B9=E6=8D=AEid=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=88=A0=E9=99=A4=E6=96=B9=E6=B3=95=20=E5=B9=B6?= =?UTF-8?q?=E5=A1=AB=E5=85=85=E5=AD=97=E6=AE=B5"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3a27ac45 --- .../mybatis/config/MybatisPlusConfig.java | 6 ----- .../epmet/commons/mybatis/dao/BaseDao.java | 4 ++-- .../interceptor/MybatisPlusSqlInjector.java | 23 ------------------- .../commons/mybatis/mapper/MyBaseMapper.java | 21 ----------------- .../epmetuser/test/UserControllerTest.java | 12 ---------- 5 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java delete mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java index d5537bb17d..8ef978f3c3 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java @@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import com.epmet.commons.mybatis.interceptor.DataFilterInterceptor; -import com.epmet.commons.mybatis.interceptor.MybatisPlusSqlInjector; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; @@ -45,10 +44,5 @@ public class MybatisPlusConfig { interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); return interceptor; } - @Bean - @Order(2) - public MybatisPlusSqlInjector mybatisPlusSqlInjector(){ - return new MybatisPlusSqlInjector(); - } } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java index 30b95eaa4c..f23017b6f7 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java @@ -8,7 +8,7 @@ package com.epmet.commons.mybatis.dao; -import com.epmet.commons.mybatis.mapper.MyBaseMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * 基础Dao @@ -16,6 +16,6 @@ import com.epmet.commons.mybatis.mapper.MyBaseMapper; * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ -public interface BaseDao extends MyBaseMapper { +public interface BaseDao extends BaseMapper { } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java deleted file mode 100644 index 21cc58edd8..0000000000 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.epmet.commons.mybatis.interceptor; - -import com.baomidou.mybatisplus.core.injector.AbstractMethod; -import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; -import com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill; - -import java.util.List; - -/** - * desc:mybatisPlus拦截器 - * - * @author: LiuJanJun - * @date: 2022/3/16 6:33 下午 - * @version: 1.0 - */ -public class MybatisPlusSqlInjector extends DefaultSqlInjector { - @Override - public List getMethodList(Class mapperClass) { - final List methods = super.getMethodList(mapperClass); - methods.add(new LogicDeleteByIdWithFill()); - return methods; - } -} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java deleted file mode 100644 index 13d589e918..0000000000 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.epmet.commons.mybatis.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * desc:自定义mapper方法 - * - * @author: LiuJanJun - * @date: 2022/3/16 6:42 下午 - * @version: 1.0 - */ -public interface MyBaseMapper extends BaseMapper { - /** - * 根据Id逻辑删除 并 填充其他字段的值 id必填 - * - * @param entity 要删除的实体对象 - * @return 受影响记录数量 - */ - int deleteByIdWithFill(Entity entity); - -} diff --git a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java index a777c0c4da..06d674a4e3 100644 --- a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java @@ -1,9 +1,7 @@ package com.epmet.epmetuser.test; import com.epmet.commons.tools.constant.AppClientConstant; -import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.result.LoginUserDetailsResultDTO; -import com.epmet.entity.CustomerStaffEntity; import com.epmet.service.UserService; import org.junit.Test; import org.junit.runner.RunWith; @@ -18,20 +16,10 @@ public class UserControllerTest { @Autowired private UserService userService; - @Autowired - private CustomerStaffDao customerStaffDao; - @Test public void getLoginUserDetails() { LoginUserDetailsResultDTO loginUserDetails = userService.getLoginUserDetails(AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, "4aaab913d9f11d90a2cb4dd21b075259"); System.out.println(loginUserDetails); } - @Test - public void del() { - CustomerStaffEntity entity = new CustomerStaffEntity(); - //entity.setId("1476792429129445378"); - entity.setRealName("刘建军3"); - customerStaffDao.deleteByIdWithFill(entity); - } } From ebbd84821b8271485e1f34aa72cf064eeec986ea Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 17 Mar 2022 09:35:20 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=85=8D=E7=BD=AE=20=E5=88=97=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/TableHeaderResultDTO.java | 1 + .../db/migration/V0.0.14__ic_form_query_add_witdh.sql | 2 ++ .../src/main/resources/mapper/IcFormItemDao.xml | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java index dd39f668e7..fbe06770ad 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java @@ -17,6 +17,7 @@ public class TableHeaderResultDTO implements Serializable { private String label; private String columnName; private String itemType; + private Integer width; private List options; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql new file mode 100644 index 0000000000..b4563ed03c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_oper_customize`.`ic_form_query_builder` + ADD COLUMN `WIDTH` int(3) NULL COMMENT '列宽' AFTER `QUERY_TYPE`; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index 9af84eaee4..8ac6634525 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -77,7 +77,8 @@ m.id as item_id, m.LABEL, m.COLUMN_NAME, - m.item_type + m.item_type, + m.width FROM ic_form_item m WHERE From 1e379e4d0b46db309646de017c7fe06eababbc6a Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 17 Mar 2022 09:40:56 +0800 Subject: [PATCH 14/14] =?UTF-8?q?Revert=20"=E6=B7=BB=E5=8A=A0=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=9F=A5=E8=AF=A2=E9=85=8D=E7=BD=AE=20=E5=88=97?= =?UTF-8?q?=E5=AE=BD"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ebbd8482 --- .../main/java/com/epmet/dto/result/TableHeaderResultDTO.java | 1 - .../db/migration/V0.0.14__ic_form_query_add_witdh.sql | 2 -- .../src/main/resources/mapper/IcFormItemDao.xml | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java index fbe06770ad..dd39f668e7 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java @@ -17,7 +17,6 @@ public class TableHeaderResultDTO implements Serializable { private String label; private String columnName; private String itemType; - private Integer width; private List options; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql deleted file mode 100644 index b4563ed03c..0000000000 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `epmet_oper_customize`.`ic_form_query_builder` - ADD COLUMN `WIDTH` int(3) NULL COMMENT '列宽' AFTER `QUERY_TYPE`; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index 8ac6634525..9af84eaee4 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -77,8 +77,7 @@ m.id as item_id, m.LABEL, m.COLUMN_NAME, - m.item_type, - m.width + m.item_type FROM ic_form_item m WHERE