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