add 三年统计改为2021 - 2025年

This commit is contained in:
lijiarao
2022-09-21 10:00:37 +08:00
parent 7eb86fad94
commit 3ff4bd48ca
2 changed files with 3 additions and 3 deletions
@@ -237,14 +237,13 @@ public class IndexService {
}
public List<HistogramVO> withinThreeYears() {
int yearInt = DateUtil.year(new DateTime());
List<YearMoneyDTO> yearMoneyDTOList = payWorkingGroupMapper.getYearMoneyDTO();
Map<String, String> map = yearMoneyDTOList.stream()
.collect(Collectors.toMap(YearMoneyDTO::getYear, YearMoneyDTO::getAllMoney, (key1, key2) -> key2));
List<HistogramVO> histogramVOList = new ArrayList<>();
for (int i = 2; i >= 0 ; i--) {
for (int i = 2021; i <= 2025 ; i++) {
HistogramVO histogramVO = new HistogramVO();
String year = String.valueOf(yearInt - i);
String year = String.valueOf(i);
histogramVO.setName(year);
histogramVO.setAllMoney(map.getOrDefault(year, "0"));
histogramVOList.add(histogramVO);