develop #1
|
@ -66,11 +66,8 @@ public class AggregationServiceImpl implements AggregationService {
|
||||||
|
|
||||||
private <T extends AggregationInfo> Map<String, List<T>> createYearMap(List<T> aggregationHistory) {
|
private <T extends AggregationInfo> Map<String, List<T>> createYearMap(List<T> aggregationHistory) {
|
||||||
|
|
||||||
aggregationHistory = aggregationHistory.stream()
|
|
||||||
.sorted(Comparator.comparing(AggregationInfo::getDate).reversed())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
return aggregationHistory.stream()
|
return aggregationHistory.stream()
|
||||||
|
.sorted(Comparator.comparing(AggregationInfo::getDate).reversed())
|
||||||
.collect(Collectors.groupingBy(item -> getYear(item.getDate())));
|
.collect(Collectors.groupingBy(item -> getYear(item.getDate())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue