Browse Source

提交

master
jianjun 4 years ago
parent
commit
3521a1aaec
  1. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java

20
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java

@ -2,6 +2,7 @@ package com.epmet.commons.tools.redis.common;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.CommonAggFeignClient;
@ -102,14 +103,17 @@ public class CustomerStaffRedis {
* @param staffId
*/
public static Map<String, String> getStaffRoleMap(String customerId, String staffId) {
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
Map<String, String> roleMap = (Map<String, String>) customerStaffRedis.redisUtils.hGet(key, ROLE_MAP_KEY);
if (!CollectionUtils.isEmpty(roleMap)) {
return roleMap;
}
reloadStaffCache(staffId, key);
return getStaffRoleMap(customerId, staffId);
int retryTime = 0;
do {
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
Map<String, String> roleMap = (Map<String, String>) customerStaffRedis.redisUtils.hGet(key, ROLE_MAP_KEY);
if (!CollectionUtils.isEmpty(roleMap)) {
return roleMap;
}
retryTime++;
reloadStaffCache(staffId, key);
} while (retryTime < NumConstant.TWO);
return null;
}
/**

Loading…
Cancel
Save