|  | @@ -313,39 +313,58 @@ public class StudentServeServiceImpl implements StudentServeService {
 | 
	
		
			
				|  |  |          List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          for (Map.Entry<Integer, List<StudentServeCourseDto>> studentCourseMapEntry : studentCourseMap.entrySet()) {
 | 
	
		
			
				|  |  | -            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<>());
 | 
	
		
			
				|  |  | +//            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);
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                        teacherServiceCourseIdMap.get(courseInfo.getActualTeacherId()).add(courseInfo.getCourseScheduleId());
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    for (Map.Entry<Integer, Set<Long>> teacherServiceCourseIdMapEntry : teacherServiceCourseIdMap.entrySet()) {
 | 
	
		
			
				|  |  | +                    }else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.MIX)){
 | 
	
		
			
				|  |  | +                        CourseSchedule studentHistoryLastCourse = courseScheduleStudentPaymentDao.getStudentHistoryLastCourse(studentCourseMapEntry.getKey(), monDayDate.toString(), CourseSchedule.CourseScheduleType.SINGLE);
 | 
	
		
			
				|  |  |                          StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
 | 
	
		
			
				|  |  | -                                teacherServiceCourseIdMapEntry.getKey(),nowDate.get(DateUtil.weekFields.weekOfYear()),
 | 
	
		
			
				|  |  | +                                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"),
 | 
	
		
			
				|  |  | -                                "HOMEWORK", StringUtils.join(teacherServiceCourseIdMapEntry.getValue(), ","));
 | 
	
		
			
				|  |  | -                        studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherServiceCourseIdMapEntry.getValue().size());
 | 
	
		
			
				|  |  | +                                "EXERCISE", null);
 | 
	
		
			
				|  |  | +                        if(Objects.isNull(studentExtracurricularExercisesSituation.getTeacherId())){
 | 
	
		
			
				|  |  | +                            continue;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |                          results.add(studentExtracurricularExercisesSituation);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -            }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());
 | 
	
		
			
				|  |  | +            }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());
 | 
	
		
			
				|  |  |                  if(CollectionUtils.isEmpty(weekCourseInfo)){
 | 
	
		
			
				|  |  |                      StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
 | 
	
		
			
				|  |  |                              futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
 | 
	
	
		
			
				|  | @@ -372,20 +391,9 @@ public class StudentServeServiceImpl implements StudentServeService {
 | 
	
		
			
				|  |  |                          results.add(studentExtracurricularExercisesSituation);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -            }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());
 | 
	
		
			
				|  |  | +            }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());
 | 
	
		
			
				|  |  |                  if(CollectionUtils.isEmpty(weekCourseInfo)){
 | 
	
		
			
				|  |  |                      StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
 | 
	
		
			
				|  |  |                              futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
 | 
	
	
		
			
				|  | @@ -453,7 +461,11 @@ public class StudentServeServiceImpl implements StudentServeService {
 | 
	
		
			
				|  |  |                      courseIds.addAll(Arrays.stream(result.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toList()));
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  s.setServeType(result.getServeType());
 | 
	
		
			
				|  |  | -                s.setCourseIds(StringUtils.join(courseIds, ","));
 | 
	
		
			
				|  |  | +                if(s.getServeType().equals("HOMEWORK")){
 | 
	
		
			
				|  |  | +                    s.setCourseIds(StringUtils.join(courseIds, ","));
 | 
	
		
			
				|  |  | +                }else{
 | 
	
		
			
				|  |  | +                    s.setCourseIds("");
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |                  if(StringUtils.isBlank(s.getCourseIds())){
 | 
	
		
			
				|  |  |                      s.setExpectExercisesNum(1);
 | 
	
		
			
				|  |  |                  }else{
 |