李一帆 2025-04-10 15:50:50 +08:00
parent 1ddf2ced03
commit 3741cbc4af
1 changed files with 3 additions and 3 deletions

View File

@ -218,9 +218,9 @@ public class SzCaseController extends AbstractCommonFileController{
public R<List<SzCaseStatisticsVo>> statisticsNum(@Schema(name = "年份") @PathVariable("year") Integer year) { public R<List<SzCaseStatisticsVo>> statisticsNum(@Schema(name = "年份") @PathVariable("year") Integer year) {
LambdaQueryChainWrapper<SzCase> query = service.lambdaQuery(); LambdaQueryChainWrapper<SzCase> query = service.lambdaQuery();
query.ge(SzCase::getCaseDate, DateUtil.beginOfYearToDate(year)); query.ge(SzCase::getCreateTime, DateUtil.beginOfYearToDate(year));
query.le(SzCase::getCaseDate, DateUtil.endOfYearToDate(year)); query.le(SzCase::getCreateTime, DateUtil.endOfYearToDate(year));
List<SzCaseStatisticsVo> vos = Lists.newArrayList(); List<SzCaseStatisticsVo> vos = Lists.newArrayList();
@ -230,7 +230,7 @@ public class SzCaseController extends AbstractCommonFileController{
for (int i = 0; i < 12; i++) { for (int i = 0; i < 12; i++) {
int month = i; int month = i;
long cnt = list.stream().filter(item -> { long cnt = list.stream().filter(item -> {
calendar.setTime(item.getCaseDate()); calendar.setTime(item.getCreateTime());
return month == calendar.get(Calendar.MONTH); return month == calendar.get(Calendar.MONTH);
}).count(); }).count();
vos.add(new SzCaseStatisticsVo(month + 1,null,Integer.valueOf(String.valueOf(cnt)))); vos.add(new SzCaseStatisticsVo(month + 1,null,Integer.valueOf(String.valueOf(cnt))));