|
@@ -295,15 +295,14 @@ public class TempLittleArtistTrainingCampServiceImpl extends ServiceImpl<TempLit
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
result.put("user", userRelation);
|
|
|
if (CollectionUtils.isNotEmpty(campList)) {
|
|
|
- campList.sort(Comparator.comparing(TempLittleArtistTrainingCamp::getApplyStartDate));
|
|
|
- }
|
|
|
- if (CollectionUtils.isNotEmpty(campList)) {
|
|
|
- campList.forEach(a -> {
|
|
|
- int count = tempLittleArtistTrainingCampUserRelationService.count(Wrappers.<TempLittleArtistTrainingCampUserRelation>lambdaQuery()
|
|
|
- .eq(TempLittleArtistTrainingCampUserRelation::getActivityId, a.getId())
|
|
|
- );
|
|
|
- a.setUserCount(count);
|
|
|
- });
|
|
|
+ campList = campList.stream()
|
|
|
+ .peek(a -> {
|
|
|
+ int count = tempLittleArtistTrainingCampUserRelationService.count(Wrappers.<TempLittleArtistTrainingCampUserRelation>lambdaQuery()
|
|
|
+ .eq(TempLittleArtistTrainingCampUserRelation::getActivityId, a.getId()));
|
|
|
+ a.setUserCount(count);
|
|
|
+ })
|
|
|
+ .sorted(Comparator.comparing(TempLittleArtistTrainingCamp::getApplyStartDate))
|
|
|
+ .collect(Collectors.toList());
|
|
|
}
|
|
|
result.put("campList", campList);
|
|
|
return result;
|