|
@@ -1,6 +1,7 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
+import com.ym.mec.biz.dal.dto.StudentServeCourseDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentServeCourseHomeworkDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentServeDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentServiceHomeworkDto;
|
|
@@ -64,15 +65,33 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
Date nextMonday = Date.from(sunDayDate.plusDays(1).atStartOfDay(DateUtil.zoneId).toInstant());
|
|
|
|
|
|
List<Integer> beServeStudentIds=studentDao.getServeStudentIds();
|
|
|
+ List<Integer> serveStudentIds=new ArrayList<>();
|
|
|
+ List<StudentServeCourseDto> serveStudentCourseStartTimes = studentDao.getServeStudentCourseStartTimes(monDayDate.toString());
|
|
|
+ Map<Integer, List<StudentServeCourseDto>> studentTimesMap = new HashMap<>();
|
|
|
+ if(!CollectionUtils.isEmpty(serveStudentCourseStartTimes)){
|
|
|
+ studentTimesMap = serveStudentCourseStartTimes.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
|
|
|
+ }
|
|
|
+ for (Integer beServeStudentId : beServeStudentIds) {
|
|
|
+ List<StudentServeCourseDto> studentServeCourseDtos = studentTimesMap.get(beServeStudentId);
|
|
|
+ if(CollectionUtils.isEmpty(studentServeCourseDtos)){
|
|
|
+ serveStudentIds.add(beServeStudentId);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ long thisWeekCourses = studentServeCourseDtos.stream().filter(e -> !e.getCourseStartTime().before(e.getServiceTagUpdateTime()) && e.getCourseStartTime().compareTo(nextMonday) <= 0).count();
|
|
|
+ if(thisWeekCourses>0){
|
|
|
+ serveStudentIds.add(beServeStudentId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
BigDecimal currentPage=BigDecimal.ONE,
|
|
|
pageSize=new BigDecimal(1000),
|
|
|
- total=new BigDecimal(beServeStudentIds.size()),
|
|
|
+ total=new BigDecimal(serveStudentIds.size()),
|
|
|
totalPage=total.divide(pageSize, BigDecimal.ROUND_UP);
|
|
|
|
|
|
List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
|
|
|
|
|
|
while (currentPage.compareTo(totalPage)<=0){
|
|
|
- List<Integer> studentIds=beServeStudentIds.stream().skip(pageSize.multiply(currentPage.subtract(BigDecimal.ONE)).longValue()).limit(pageSize.longValue()).collect(Collectors.toList());
|
|
|
+ List<Integer> studentIds=serveStudentIds.stream().skip(pageSize.multiply(currentPage.subtract(BigDecimal.ONE)).longValue()).limit(pageSize.longValue()).collect(Collectors.toList());
|
|
|
|
|
|
List<StudentServeDto> serviceStudents;
|
|
|
if(sunDayDate.isBefore(LocalDate.now())){
|