// 根据三种等级分类
List<List<ScheduleResVo>> levelLists = new ArrayList<>();
int level = 1;
while (level <= 3){
List<ScheduleResVo> vos = new ArrayList<>();
for (ScheduleResVo resVo : voList){
if (resVo.getLevel() == level){
vos.add(resVo);
}
}
levelLists.add(vos);
level ++;
}
//根据每天的日期统计数量
List<List<Integer>> countLists = new ArrayList<>();
level = 1;
while (level <= 3){
List<Integer> countList = new ArrayList<>();
LocalDate now = LocalDate.now();
LocalDate min = now.minusDays(6);
LocalDate max = now.minusDays(0);
while (min.isBefore(max) || min.isEqual(max)){
int count = 0;
for (List<ScheduleResVo> vos : levelLists){
for (ScheduleResVo resVo :vos){
if (resVo.getLevel() == level){
if (isSameDay(min,resVo.getStartTime(),resVo.getEndTime())){
count++;
}
}
}
}
countList.add(count);
min = min.minusDays(-1);
}
countLists.add(countList);
level++;
}
return Response.success(countLists);
09-28
1044
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-27
474
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-12
2729
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)