|
|
@@ -93,7 +93,7 @@ public class UserService {
|
|
93
|
93
|
.withDate(localDate)
|
|
94
|
94
|
.build());
|
|
95
|
95
|
|
|
96
|
|
- if((0 < num) && list.stream().noneMatch(innerRow -> innerRow.getUid().equals(row.getSpread_uid()))) {
|
|
|
96
|
+ if(list.stream().noneMatch(innerRow -> innerRow.getUid().equals(row.getSpread_uid()))) {
|
|
97
|
97
|
//推荐人
|
|
98
|
98
|
resultList.add(UserCount.UserCountBuilder.anUserCount()
|
|
99
|
99
|
.withCreate_time(currentTime)
|
|
|
@@ -128,7 +128,14 @@ public class UserService {
|
|
128
|
128
|
relateList.clear();
|
|
129
|
129
|
});
|
|
130
|
130
|
if(!resultList.isEmpty()){
|
|
131
|
|
- userCountMapper.insertSelectiveForeach(resultList);
|
|
|
131
|
+ userCountMapper.insertSelectiveForeach(resultList.stream().collect(Collectors.groupingBy(UserCount::getUid)).entrySet().stream()
|
|
|
132
|
+ .map(row -> UserCount.UserCountBuilder.anUserCount()
|
|
|
133
|
+ .withUid(row.getKey())
|
|
|
134
|
+ .withUser_type(UserTypeEnum.NORMAL.ordinal())
|
|
|
135
|
+ .withDate(localDate)
|
|
|
136
|
+ .withNum(row.getValue().stream().mapToInt(UserCount::getNum).sum())
|
|
|
137
|
+ .withCreate_time(currentTime)
|
|
|
138
|
+ .build()).toList());
|
|
132
|
139
|
}
|
|
133
|
140
|
|
|
134
|
141
|
resolverAgent(localDate);
|