Browse Source

弃用网格 删除网格缓存

dev
jianjun 3 years ago
parent
commit
5ed6be9e7c
  1. 14
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java
  2. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

14
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; package com.epmet.commons.tools.redis.common;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.feign.CommonAggFeignClient;
import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils; 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.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -35,6 +35,7 @@ public class CustomerOrgRedis {
private static CustomerOrgRedis customerOrgRedis; private static CustomerOrgRedis customerOrgRedis;
private static final String ROLE_MAP_KEY = "roleMap"; private static final String ROLE_MAP_KEY = "roleMap";
@PostConstruct @PostConstruct
public void init() { public void init() {
customerOrgRedis = this; customerOrgRedis = this;
@ -91,4 +92,13 @@ public class CustomerOrgRedis {
return agencyInfoResult.getData(); return agencyInfoResult.getData();
} }
/**
* desc:删除网格缓存
* @param gridId
*/
public static void delGridInfo(String gridId) {
String key = RedisKeys.getGridInfoKey(gridId);
customerOrgRedis.redisUtils.delete(key);
}
} }

1
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<CustomerGridDao, Cu
updateGrid.set(CustomerGridEntity::getAbandonFlag,true); updateGrid.set(CustomerGridEntity::getAbandonFlag,true);
updateGrid.eq(CustomerGridEntity::getId,formDTO.getGridId()); updateGrid.eq(CustomerGridEntity::getId,formDTO.getGridId());
baseDao.update(null,updateGrid); baseDao.update(null,updateGrid);
CustomerOrgRedis.delGridInfo(formDTO.getGridId());
} }
@Override @Override

Loading…
Cancel
Save