diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java index 449a90116a..4fbf63be42 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java @@ -1,12 +1,12 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.redis.common.bean.*; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import lombok.extern.slf4j.Slf4j; @@ -35,6 +35,7 @@ public class CustomerOrgRedis { private static CustomerOrgRedis customerOrgRedis; private static final String ROLE_MAP_KEY = "roleMap"; + @PostConstruct public void init() { customerOrgRedis = this; @@ -91,4 +92,13 @@ public class CustomerOrgRedis { return agencyInfoResult.getData(); } + /** + * desc:删除网格缓存 + * @param gridId + */ + public static void delGridInfo(String gridId) { + String key = RedisKeys.getGridInfoKey(gridId); + customerOrgRedis.redisUtils.delete(key); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 962dcd994e..2eea3efe1a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -998,6 +998,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl