|
@@ -67,12 +67,17 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
total=new BigDecimal(beServeStudentIds.size()),
|
|
|
totalPage=total.divide(pageSize, BigDecimal.ROUND_UP);
|
|
|
|
|
|
- studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString());
|
|
|
+ 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<StudentServeDto> serviceStudents = studentDao.getBeServiceStudentsInfoWithStudents(monDayDate.toString(), sunDayDate.isBefore(LocalDate.now())?nextMonday:new Date(),studentIds);
|
|
|
+ List<StudentServeDto> serviceStudents;
|
|
|
+ if(sunDayDate.isBefore(LocalDate.now())){
|
|
|
+ serviceStudents = studentDao.getBeServiceStudentsInfoWithStudentsForHistory(monDayDate.toString(), nextMonday,studentIds);
|
|
|
+ }else{
|
|
|
+ serviceStudents = studentDao.getBeServiceStudentsInfoWithStudents(monDayDate.toString(), new Date(),studentIds);
|
|
|
+ }
|
|
|
if(CollectionUtils.isEmpty(serviceStudents)){
|
|
|
return;
|
|
|
}
|
|
@@ -128,7 +133,6 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
studentExercisesMap = studentExercises.stream().collect(Collectors.groupingBy(ExtracurricularExercisesReply::getUserId));
|
|
|
}
|
|
|
|
|
|
- List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
|
|
|
for (Map.Entry<Integer, List<StudentServeDto>> studentCoursesEntry : studentCoursesMap.entrySet()) {
|
|
|
|
|
|
if(dontServeInCurrentWeekStudentIds.contains(studentCoursesEntry.getKey())){
|
|
@@ -221,9 +225,20 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
results.add(studentExtracurricularExercisesSituation);
|
|
|
}
|
|
|
|
|
|
-// List<StudentExtracurricularExercisesSituation> rows=results.stream().skip(pageSize.multiply(currentPage.subtract(BigDecimal.ONE)).longValue()).limit(pageSize.longValue()).collect(Collectors.toList());
|
|
|
- studentExtracurricularExercisesSituationDao.batchInsert(results);
|
|
|
currentPage=currentPage.add(BigDecimal.ONE);
|
|
|
}
|
|
|
+
|
|
|
+ studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString());
|
|
|
+
|
|
|
+ BigDecimal currentPage1=BigDecimal.ONE,
|
|
|
+ pageSize1=new BigDecimal(10000),
|
|
|
+ total1=new BigDecimal(results.size()),
|
|
|
+ totalPage1=total1.divide(pageSize1, BigDecimal.ROUND_UP);
|
|
|
+
|
|
|
+ while (currentPage1.compareTo(totalPage1)<=0){
|
|
|
+ List<StudentExtracurricularExercisesSituation> rows=results.stream().skip(pageSize1.multiply(currentPage1.subtract(BigDecimal.ONE)).longValue()).limit(pageSize1.longValue()).collect(Collectors.toList());
|
|
|
+ studentExtracurricularExercisesSituationDao.batchInsert(rows);
|
|
|
+ currentPage1=currentPage1.add(BigDecimal.ONE);
|
|
|
+ }
|
|
|
}
|
|
|
}
|