|
@@ -319,11 +319,15 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE);
|
|
|
List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
|
|
|
if(CollectionUtils.isEmpty(weekCourseInfo)){
|
|
|
- StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
- futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
- DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
- "EXERCISE", null);
|
|
|
- results.add(studentExtracurricularExercisesSituation);
|
|
|
+ Map<String, List<StudentServeCourseDto>> groupCourseInfo = futureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
|
|
|
+ for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
|
|
|
+ StudentServeCourseDto courseInfo = groupCourseInfoEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
|
|
|
+ StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
+ courseInfo.getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
+ DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
+ "EXERCISE", null);
|
|
|
+ results.add(studentExtracurricularExercisesSituation);
|
|
|
+ }
|
|
|
}else{
|
|
|
Map<String, List<StudentServeCourseDto>> groupCourseInfo = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
|
|
|
Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
|
|
@@ -347,11 +351,14 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.VIP);
|
|
|
List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.VIP).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
|
|
|
if(CollectionUtils.isEmpty(weekCourseInfo)){
|
|
|
- StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
- futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
- DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
- "EXERCISE", null);
|
|
|
- results.add(studentExtracurricularExercisesSituation);
|
|
|
+ Map<Integer, List<StudentServeCourseDto>> teacherCourseMap = futureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getActualTeacherId));
|
|
|
+ for (Integer teacherId : teacherCourseMap.keySet()) {
|
|
|
+ StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
+ teacherId,nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
+ DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
+ "EXERCISE", null);
|
|
|
+ results.add(studentExtracurricularExercisesSituation);
|
|
|
+ }
|
|
|
}else{
|
|
|
Map<Integer, List<StudentServeCourseDto>> teacherCourseMap = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getActualTeacherId));
|
|
|
for (Map.Entry<Integer, List<StudentServeCourseDto>> teacherCourseMapEntry : teacherCourseMap.entrySet()) {
|
|
@@ -386,11 +393,14 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
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());
|
|
|
if(CollectionUtils.isEmpty(weekCourseInfo)){
|
|
|
- StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
- futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
- DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
- "EXERCISE", null);
|
|
|
- results.add(studentExtracurricularExercisesSituation);
|
|
|
+ Set<Integer> teacherIds = weekCourseInfo.stream().map(StudentServeCourseDto::getActualTeacherId).collect(Collectors.toSet());
|
|
|
+ for (Integer teacherId : teacherIds) {
|
|
|
+ StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
+ teacherId,nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
+ DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
+ "EXERCISE", null);
|
|
|
+ results.add(studentExtracurricularExercisesSituation);
|
|
|
+ }
|
|
|
}else{
|
|
|
Map<Integer, List<StudentServeCourseDto>> teacherCourseMap = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getActualTeacherId));
|
|
|
Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
|