|
|
@ -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) { |
|
|
|
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); |
|
|
|
return getStaffRoleMap(customerId, staffId); |
|
|
|
} while (retryTime < NumConstant.TWO); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|