|
@@ -427,7 +427,7 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(results)){
|
|
|
-// studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString());
|
|
|
+
|
|
|
studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString(), studentIds);
|
|
|
BigDecimal currentPage1=BigDecimal.ONE,
|
|
|
pageSize1=new BigDecimal(10000),
|
|
@@ -437,10 +437,10 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
while (currentPage1.compareTo(totalPage1)<=0){
|
|
|
List<StudentExtracurricularExercisesSituation> rows=results.stream().skip(pageSize1.multiply(currentPage1.subtract(BigDecimal.ONE)).longValue()).limit(pageSize1.longValue()).collect(Collectors.toList());
|
|
|
// List<Integer> updateStudentIds = rows.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
|
|
|
-
|
|
|
+//
|
|
|
// List<StudentExtracurricularExercisesSituation> weekServiceWithStudents = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(monDayDate.toString(), null, updateStudentIds);
|
|
|
// Map<String, StudentExtracurricularExercisesSituation> codeServeMap = weekServiceWithStudents.stream().collect(Collectors.toMap(StudentExtracurricularExercisesSituation::getStuAndTeaCode, s -> s, (s1, s2) -> s1));
|
|
|
-
|
|
|
+//
|
|
|
// Set<String> newCodes = rows.stream().map(StudentExtracurricularExercisesSituation::getStuAndTeaCode).collect(Collectors.toSet());
|
|
|
// for (StudentExtracurricularExercisesSituation weekServiceWithStudent : weekServiceWithStudents) {
|
|
|
// if(weekServiceWithStudent.getActualExercisesNum()>0||newCodes.contains(weekServiceWithStudent.getStuAndTeaCode())){
|
|
@@ -448,7 +448,7 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
// }
|
|
|
// studentExtracurricularExercisesSituationDao.delete(weekServiceWithStudent.getId());
|
|
|
// }
|
|
|
-
|
|
|
+//
|
|
|
// List<StudentExtracurricularExercisesSituation> newService = new ArrayList<>();
|
|
|
// List<StudentExtracurricularExercisesSituation> updateService = new ArrayList<>();
|
|
|
// for (StudentExtracurricularExercisesSituation result : rows) {
|
|
@@ -482,8 +482,6 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
// if(!CollectionUtils.isEmpty(newService))
|
|
|
// studentExtracurricularExercisesSituationDao.batchInsert(newService);
|
|
|
|
|
|
- studentExtracurricularExercisesSituationDao.batchInsert(rows);
|
|
|
-
|
|
|
currentPage1=currentPage1.add(BigDecimal.ONE);
|
|
|
}
|
|
|
return;
|
|
@@ -543,9 +541,11 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
|
|
|
for (StudentExtracurricularExercisesSituation weekServiceWithStudent : weekServiceWithStudents) {
|
|
|
- List<StudentServeCourseHomeworkDto> studentHomeworks = studentHomeworkMap.get(weekServiceWithStudent.getStudentId());
|
|
|
+ List<StudentServeCourseHomeworkDto> studentAllHomeworks = studentHomeworkMap.get(weekServiceWithStudent.getStudentId());
|
|
|
weekServiceWithStudent.setActualExercisesNum(0);
|
|
|
- if(!CollectionUtils.isEmpty(studentHomeworks)&&weekServiceWithStudent.getServeType().equals("HOMEWORK")){
|
|
|
+ if(!CollectionUtils.isEmpty(studentAllHomeworks)&&weekServiceWithStudent.getServeType().equals("HOMEWORK")){
|
|
|
+ Set<String> courseIds = Arrays.stream(weekServiceWithStudent.getCourseIds().split(",")).collect(Collectors.toSet());
|
|
|
+ List<StudentServeCourseHomeworkDto> studentHomeworks = studentAllHomeworks.stream().filter(s -> courseIds.contains(s.getCourseScheduleId())).collect(Collectors.toList());
|
|
|
weekServiceWithStudent.setActualExercisesNum(1);
|
|
|
long replyNum = studentHomeworks.stream().filter(e -> YesOrNoEnum.YES.equals(e.getStatus())).count();
|
|
|
weekServiceWithStudent.setExercisesReplyNum(replyNum>0?1:0);
|
|
@@ -572,8 +572,9 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
weekServiceWithStudent.setExercisesMessageTimelyNum(exercisesMessageTimelyNum>0?1:0);
|
|
|
}
|
|
|
|
|
|
- List<ExtracurricularExercisesReply> studentExercises = studentExercisesMap.get(weekServiceWithStudent.getStudentId());
|
|
|
- if(!CollectionUtils.isEmpty(studentExercises)&&weekServiceWithStudent.getServeType().equals("EXERCISE")){
|
|
|
+ List<ExtracurricularExercisesReply> studentAllExercises = studentExercisesMap.get(weekServiceWithStudent.getStudentId());
|
|
|
+ if(!CollectionUtils.isEmpty(studentAllExercises)&&weekServiceWithStudent.getServeType().equals("EXERCISE")){
|
|
|
+ List<ExtracurricularExercisesReply> studentExercises = studentAllExercises.stream().filter(s -> weekServiceWithStudent.getTeacherId().equals(s.getExtracurricularExercises().getTeacherId())).collect(Collectors.toList());
|
|
|
weekServiceWithStudent.setActualExercisesNum(1);
|
|
|
long replyNum = studentExercises.stream().filter(e -> e.getStatus()==1).count();
|
|
|
if(weekServiceWithStudent.getExercisesReplyNum()<=0){
|