Commit 2fafaea7 by 杨林龙

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

1 parent b7a24e13
...@@ -472,10 +472,11 @@ public class RiskAssessmentService { ...@@ -472,10 +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();
Integer maxMonthInt = userBehaviorWeekDTOList.stream().map(UserBehaviorDayDTO::getMonthInt).max(Integer::compareTo).orElse(0);
Map<Integer, UserBehaviorDayDTO> userBehaviorDayDTOMap = userBehaviorWeekDTOList.stream().collect(Collectors.toMap(UserBehaviorDayDTO::getDayInt, Function.identity(), (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++) {
UserBehaviorDayDTO userBehaviorDayNum = userBehaviorDayDTOMap.getOrDefault(i, new UserBehaviorDayDTO(0, 0, 0, 0)); UserBehaviorDayDTO userBehaviorDayNum = userBehaviorDayDTOMap.getOrDefault(i, new UserBehaviorDayDTO(0, maxMonthInt, 0, 0));
userBehaviorDayNewList.add(new UserBehaviorDayDTO(userBehaviorDayNum.getYearInt(), userBehaviorDayNum.getMonthInt(), i, userBehaviorDayNum.getDayNum())); userBehaviorDayNewList.add(new UserBehaviorDayDTO(userBehaviorDayNum.getYearInt(), userBehaviorDayNum.getMonthInt(), i, userBehaviorDayNum.getDayNum()));
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!