Commit 45104b3dcf460227d40f9a4ffef0e2b2d9a8bdd4

Authored by 张志伟
1 parent 87e563f9

:fire: feat(*): bug修复

- bug修复
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/report/CustomerRetentionRatioBizService.java
... ... @@ -174,9 +174,13 @@ public class CustomerRetentionRatioBizService {
174 174 List<CustomerRetentionRatio> list = new ArrayList<>();
175 175 for (UserInfo userInfo : set) {
176 176 List<UserRoleDataRangeDTO> userRoleDataRange = userService.getUserRoleDataRange(userInfo.getUserId(), RoleCode.FWGW);
177   - if (CollectionUtils.isEmpty(userRoleDataRange)) {
  177 + boolean noneMatch = userRoleDataRange.stream().noneMatch(r -> r.getRangeValue().equals(shop.getId()));
  178 + if (CollectionUtils.isEmpty(userRoleDataRange) || noneMatch) {
178 179 String cacheKey = String.format("%s:%s:%s:%s", getStashRetentionKey(), YearMonth.from(DateUtil.date2LocalDate(nowDate)), shop.getId(), userInfo.getUserId());
179 180 String jsonString = stringRedisTemplate.opsForValue().get(cacheKey);
  181 + if (StringUtils.isEmpty(jsonString)) {
  182 + continue;
  183 + }
180 184 List<CustomerRetentionRatio> roleChangeCacheInfoList = JSONUtil.parseArray(jsonString).toList(CustomerRetentionRatio.class);
181 185 if (!CollectionUtils.isEmpty(roleChangeCacheInfoList)) {
182 186 roleChangeCacheInfoList.forEach(r -> {
... ...