Commit 2eccab73 by 杨林龙

1.50.0 开发1.50.0需求版本 优化用户行为按天统计行为查询展示

1 parent 5142423e
...@@ -472,11 +472,11 @@ public class RiskAssessmentService { ...@@ -472,11 +472,11 @@ public class RiskAssessmentService {
private List<UserBehaviorDayDTO> getUserBehaviorDayList(List<UserBehaviorDayDTO> userBehaviorWeekDTOList, Integer minDayInt, Integer maxDayInt) { private List<UserBehaviorDayDTO> getUserBehaviorDayList(List<UserBehaviorDayDTO> userBehaviorWeekDTOList, Integer minDayInt, Integer maxDayInt) {
List<UserBehaviorDayDTO> userBehaviorDayNewList = Lists.newArrayList(); List<UserBehaviorDayDTO> userBehaviorDayNewList = Lists.newArrayList();
Map<Integer, Integer> userBehaviorDayDTOMap = userBehaviorWeekDTOList.stream().collect(Collectors.toMap(UserBehaviorDayDTO::getDayInt, UserBehaviorDayDTO::getDayNum, (o, n) -> n)); Map<Integer, UserBehaviorDayDTO> userBehaviorDayDTOMap = userBehaviorWeekDTOList.stream().collect(Collectors.toMap(UserBehaviorDayDTO::getDayInt, Function.identity(), (o, n) -> n));
log.info("userBehaviorDayDTOMap===" + JSONUtil.toJsonStr(userBehaviorDayDTOMap)); log.info("userBehaviorDayDTOMap===" + JSONUtil.toJsonStr(userBehaviorDayDTOMap));
for (int i = minDayInt; i < maxDayInt + 1; i++) { for (int i = minDayInt; i < maxDayInt + 1; i++) {
Integer dayNum = userBehaviorDayDTOMap.getOrDefault(i, 0); UserBehaviorDayDTO userBehaviorDayNum = userBehaviorDayDTOMap.getOrDefault(i, new UserBehaviorDayDTO(0, 0, 0, 0));
userBehaviorDayNewList.add(new UserBehaviorDayDTO(0, 0, i, dayNum)); userBehaviorDayNewList.add(new UserBehaviorDayDTO(userBehaviorDayNum.getYearInt(), userBehaviorDayNum.getMonthInt(), i, userBehaviorDayNum.getDayNum()));
} }
// 如果集合全部为0 则返回空数据 // 如果集合全部为0 则返回空数据
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!