|
@@ -313,58 +313,39 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
|
|
List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
|
|
|
|
|
|
for (Map.Entry<Integer, List<StudentServeCourseDto>> studentCourseMapEntry : studentCourseMap.entrySet()) {
|
|
for (Map.Entry<Integer, List<StudentServeCourseDto>> studentCourseMapEntry : studentCourseMap.entrySet()) {
|
|
-// Map<CourseSchedule.CourseScheduleType, List<StudentServeCourseDto>> typeCourseMap = studentCourseMapEntry.getValue().stream().collect(Collectors.groupingBy(StudentServeCourseDto::getType));
|
|
|
|
-
|
|
|
|
- Map<GroupType, List<StudentServeCourseDto>> groupCourseMap = studentCourseMapEntry.getValue().stream().collect(Collectors.groupingBy(StudentServeCourseDto::getGroupType));
|
|
|
|
-
|
|
|
|
- if(groupCourseMap.containsKey(GroupType.MUSIC)){
|
|
|
|
- Map<String, List<StudentServeCourseDto>> groupIdCourseMap = groupCourseMap.get(GroupType.MUSIC).stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
|
|
|
|
- for (Map.Entry<String, List<StudentServeCourseDto>> groupIdCourseMapEntry : groupIdCourseMap.entrySet()) {
|
|
|
|
- Map<CourseSchedule.CourseScheduleType, List<StudentServeCourseDto>> typeCourseMap = groupIdCourseMapEntry.getValue().stream().collect(Collectors.groupingBy(StudentServeCourseDto::getType));
|
|
|
|
- if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.SINGLE)){
|
|
|
|
- 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);
|
|
|
|
- }else{
|
|
|
|
- Map<String, List<StudentServeCourseDto>> groupCourseInfo = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
|
|
|
|
- Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
|
|
|
|
- for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
|
|
|
|
- StudentServeCourseDto courseInfo = groupCourseInfoEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
|
|
|
|
- if(!teacherServiceCourseIdMap.containsKey(courseInfo.getActualTeacherId())){
|
|
|
|
- teacherServiceCourseIdMap.put(courseInfo.getActualTeacherId(), new HashSet<>());
|
|
|
|
- }
|
|
|
|
- teacherServiceCourseIdMap.get(courseInfo.getActualTeacherId()).add(courseInfo.getCourseScheduleId());
|
|
|
|
- }
|
|
|
|
- for (Map.Entry<Integer, Set<Long>> teacherServiceCourseIdMapEntry : teacherServiceCourseIdMap.entrySet()) {
|
|
|
|
- StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
|
- teacherServiceCourseIdMapEntry.getKey(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
|
- DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
|
- "HOMEWORK", StringUtils.join(teacherServiceCourseIdMapEntry.getValue(), ","));
|
|
|
|
- studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherServiceCourseIdMapEntry.getValue().size());
|
|
|
|
- results.add(studentExtracurricularExercisesSituation);
|
|
|
|
- }
|
|
|
|
|
|
+ Map<CourseSchedule.CourseScheduleType, List<StudentServeCourseDto>> typeCourseMap = studentCourseMapEntry.getValue().stream().collect(Collectors.groupingBy(StudentServeCourseDto::getType));
|
|
|
|
+
|
|
|
|
+ if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.SINGLE)){
|
|
|
|
+ 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);
|
|
|
|
+ }else{
|
|
|
|
+ Map<String, List<StudentServeCourseDto>> groupCourseInfo = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
|
|
|
|
+ Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
|
|
|
|
+ for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
|
|
|
|
+ StudentServeCourseDto courseInfo = groupCourseInfoEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
|
|
|
|
+ if(!teacherServiceCourseIdMap.containsKey(courseInfo.getActualTeacherId())){
|
|
|
|
+ teacherServiceCourseIdMap.put(courseInfo.getActualTeacherId(), new HashSet<>());
|
|
}
|
|
}
|
|
- }else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.MIX)){
|
|
|
|
- CourseSchedule studentHistoryLastCourse = courseScheduleStudentPaymentDao.getStudentHistoryLastCourse(studentCourseMapEntry.getKey(), monDayDate.toString(), CourseSchedule.CourseScheduleType.SINGLE);
|
|
|
|
|
|
+ teacherServiceCourseIdMap.get(courseInfo.getActualTeacherId()).add(courseInfo.getCourseScheduleId());
|
|
|
|
+ }
|
|
|
|
+ for (Map.Entry<Integer, Set<Long>> teacherServiceCourseIdMapEntry : teacherServiceCourseIdMap.entrySet()) {
|
|
StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
- Objects.isNull(studentHistoryLastCourse)?studentCourseMapEntry.getValue().get(0).getLeadTeacherId():studentHistoryLastCourse.getActualTeacherId(),
|
|
|
|
- nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
|
|
|
+ teacherServiceCourseIdMapEntry.getKey(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
- "EXERCISE", null);
|
|
|
|
- if(Objects.isNull(studentExtracurricularExercisesSituation.getTeacherId())){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
|
|
+ "HOMEWORK", StringUtils.join(teacherServiceCourseIdMapEntry.getValue(), ","));
|
|
|
|
+ studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherServiceCourseIdMapEntry.getValue().size());
|
|
results.add(studentExtracurricularExercisesSituation);
|
|
results.add(studentExtracurricularExercisesSituation);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else if(groupCourseMap.containsKey(GroupType.VIP)){
|
|
|
|
- List<StudentServeCourseDto> futureCourseInfo = groupCourseMap.get(GroupType.VIP);
|
|
|
|
- List<StudentServeCourseDto> weekCourseInfo = groupCourseMap.get(GroupType.VIP).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
|
|
|
|
|
|
+ }else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.VIP)){
|
|
|
|
+ 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)){
|
|
if(CollectionUtils.isEmpty(weekCourseInfo)){
|
|
StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
@@ -391,9 +372,20 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
results.add(studentExtracurricularExercisesSituation);
|
|
results.add(studentExtracurricularExercisesSituation);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else if(groupCourseMap.containsKey(GroupType.PRACTICE)){
|
|
|
|
- List<StudentServeCourseDto> futureCourseInfo = groupCourseMap.get(GroupType.PRACTICE);
|
|
|
|
- List<StudentServeCourseDto> weekCourseInfo = groupCourseMap.get(GroupType.PRACTICE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
|
|
|
|
|
|
+ }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;
|
|
|
|
+ }
|
|
|
|
+ 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());
|
|
if(CollectionUtils.isEmpty(weekCourseInfo)){
|
|
if(CollectionUtils.isEmpty(weekCourseInfo)){
|
|
StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
@@ -530,7 +522,7 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
}
|
|
}
|
|
|
|
|
|
List<StudentExtracurricularExercisesSituation> weekServiceWithStudents = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(monDayDate.toString(), teacherId, studentIds);
|
|
List<StudentExtracurricularExercisesSituation> weekServiceWithStudents = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(monDayDate.toString(), teacherId, studentIds);
|
|
- if(!CollectionUtils.isEmpty(weekServiceWithStudents)){
|
|
|
|
|
|
+ if(CollectionUtils.isEmpty(weekServiceWithStudents)){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|