Commit 8248bae4 by 杨林龙

1.50.0 开发1.50.0需求版本 优化用户行为列表返回

1 parent 389ce5e9
......@@ -436,6 +436,10 @@ public class RiskAssessmentService {
userBehaviorWeekDTOList.stream().collect(Collectors.groupingBy(UserBehaviorWeekDTO::getYearInt)).forEach((year, tempUserBehaviorWeekList) -> {
int maxWeekOfYear = DateUtil.getMaxWeekOfYear(year);
Map<Integer, UserBehaviorWeekDTO> tempUserBehaviorWeekMap = tempUserBehaviorWeekList.stream().collect(Collectors.toMap(UserBehaviorWeekDTO::getWeekInt, Function.identity(), (o, n) -> n));
// 最大的年 则使用最大的周计算即刻
if (Objects.equals(year, maxYearInt)) {
maxWeekOfYear = maxWeekInt;
}
for (int i = 0; i < maxWeekOfYear + 1; i++) {
UserBehaviorWeekDTO tempUserBehaviorWeekDTO = tempUserBehaviorWeekMap.getOrDefault(i, new UserBehaviorWeekDTO(year, i, 0));
newUserBehaviorWeekList.add(tempUserBehaviorWeekDTO);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!