Commit 9de14422 by 墨竹

refactor:删除旧权限代码

parent df5a3905
......@@ -247,19 +247,6 @@ public interface StaffApiService {
*/
StaffQrCodeDTO getQrCodeByClerkId(String clerkId);
/**
* 导购gic门店和好办企业门店交集
* 所有门店返回所有门店列表
*
* @param clerkId 职员id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link String }>
* @author mozhu
* @date 2022-05-25 15:37:24
*/
List<String> getHaoBanStoreRolesByClerkId(String clerkId, String wxEnterpriseId);
/**
* 导购gic门店和好办企业门店交集
* 所有门店返回 -1
......
......@@ -1296,50 +1296,6 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public List<String> getHaoBanStoreRolesByClerkId(String clerkId, String wxEnterpriseId) {
logger.info("查询导购权限,clerkId={},wxEnterpriseId={}", clerkId, wxEnterpriseId);
if (StringUtils.isAnyBlank(clerkId, wxEnterpriseId)) {
logger.info("参数为空clerkId={},wxEnterpriseId={}", clerkId, wxEnterpriseId);
return Collections.emptyList();
}
String cacheKey = "hb:clerk:store:" + clerkId + wxEnterpriseId;
Object cache = RedisUtil.getCache(cacheKey);
if (cache != null) {
logger.info("从缓存中获取通道={}", cacheKey);
return (List<String>) cache;
}
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO == null) {
logger.info("导购不存在:clerkId:{}", clerkId);
return Collections.emptyList();
}
String enterpriseId = clerkDTO.getEnterpriseId();
List<String> enterpriseIdStoreIds = storeRangeService.listStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId);
if (CollectionUtils.isEmpty(enterpriseIdStoreIds)) {
logger.info("好办门店空,eid={}", enterpriseId);
return Collections.emptyList();
}
logger.info("好办门店id数量:{}", enterpriseIdStoreIds.size());
List<String> gicStoreIds = getStoreIdList(clerkDTO);
if (CollectionUtils.isEmpty(gicStoreIds)) {
logger.info("gic门店为空");
return Collections.emptyList();
}
if (gicStoreIds.contains("-1")) {
logger.info("gic超管,clerkId:{}", clerkId);
RedisUtil.setCache(cacheKey, enterpriseIdStoreIds, 10L, TimeUnit.MINUTES);
return enterpriseIdStoreIds;
}
logger.info("gic门店数量:{}", gicStoreIds.size());
//取交集
List<String> storeList = RolesListUtils.mergeList(enterpriseIdStoreIds, gicStoreIds);
logger.info("该导购权限:clerkId:{},门店数量:{}", clerkId, storeList.size());
RedisUtil.setCache(cacheKey, storeList, 10L, TimeUnit.MINUTES);
return storeList;
}
@Override
public List<String> getHaoBanStoreIdsRolesByClerkId(String clerkId, String wxEnterpriseId) {
logger.info("查询导购权限,clerkId={},wxEnterpriseId={}", clerkId, wxEnterpriseId);
if (StringUtils.isAnyBlank(clerkId, wxEnterpriseId)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment