|
@@ -328,12 +328,24 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
|
|
|
if(CollectionUtils.isEmpty(weekCourseInfo)){
|
|
|
Map<String, List<StudentServeCourseDto>> groupCourseInfo = futureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
|
|
|
+
|
|
|
+ Map<Integer, Integer> teacherNumMap = new HashMap<>();
|
|
|
for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
|
|
|
StudentServeCourseDto courseInfo = groupCourseInfoEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
|
|
|
+
|
|
|
+ if(!teacherNumMap.containsKey(courseInfo.getActualTeacherId())){
|
|
|
+ teacherNumMap.put(courseInfo.getActualTeacherId(), 1);
|
|
|
+ }else{
|
|
|
+ teacherNumMap.put(courseInfo.getActualTeacherId(), teacherNumMap.get(courseInfo.getActualTeacherId())+1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (Map.Entry<Integer, Integer> teacherNumMapEntry : teacherNumMap.entrySet()) {
|
|
|
StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
- courseInfo.getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
+ teacherNumMapEntry.getKey(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
"EXERCISE", null);
|
|
|
+ studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherNumMapEntry.getValue());
|
|
|
results.add(studentExtracurricularExercisesSituation);
|
|
|
}
|
|
|
}else{
|
|
@@ -387,16 +399,21 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
}
|
|
|
}else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.MIX)){
|
|
|
- CourseSchedule studentHistoryLastCourse = courseScheduleStudentPaymentDao.getStudentHistoryLastCourse(studentCourseMapEntry.getKey(), monDayDate.toString(), CourseSchedule.CourseScheduleType.SINGLE);
|
|
|
- StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
- Objects.isNull(studentHistoryLastCourse)?studentCourseMapEntry.getValue().get(0).getLeadTeacherId():studentHistoryLastCourse.getActualTeacherId(),
|
|
|
- nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
- DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
- "EXERCISE", null);
|
|
|
- if(Objects.isNull(studentExtracurricularExercisesSituation.getTeacherId())){
|
|
|
- continue;
|
|
|
+ List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE);
|
|
|
+ Map<String, List<StudentServeCourseDto>> groupCourseInfo = futureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
|
|
|
+
|
|
|
+ for (String groupId : groupCourseInfo.keySet()) {
|
|
|
+ CourseSchedule studentHistoryLastCourse = courseScheduleStudentPaymentDao.getStudentHistoryLastCourse(studentCourseMapEntry.getKey(), monDayDate.toString(), groupId, CourseSchedule.CourseScheduleType.SINGLE);
|
|
|
+ StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
+ Objects.isNull(studentHistoryLastCourse)?studentCourseMapEntry.getValue().get(0).getLeadTeacherId():studentHistoryLastCourse.getActualTeacherId(),
|
|
|
+ nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
+ DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
+ "EXERCISE", null);
|
|
|
+ if(Objects.isNull(studentExtracurricularExercisesSituation.getTeacherId())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ results.add(studentExtracurricularExercisesSituation);
|
|
|
}
|
|
|
- results.add(studentExtracurricularExercisesSituation);
|
|
|
}else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.PRACTICE)){
|
|
|
List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.PRACTICE);
|
|
|
List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.PRACTICE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
|