|
@@ -342,6 +342,14 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
Map<Integer, List<StudentServeCourseDto>> studentCourseMap = studentFutureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
|
|
|
|
|
|
+ Set<Integer> haveCourseBeServeStudentIds = studentCourseMap.keySet();
|
|
|
+ List<Integer> allServeStudentIds = studentDao.getServeStudentIds();
|
|
|
+ Set<Integer> noCourseServeStudentIds = allServeStudentIds.stream().filter(id -> !haveCourseBeServeStudentIds.contains(id)).collect(Collectors.toSet());
|
|
|
+ List<StudentServeCourseDto> noCourseBeServeStudentInfo = new ArrayList<>();
|
|
|
+ if(!CollectionUtils.isEmpty(noCourseServeStudentIds)){
|
|
|
+ noCourseBeServeStudentInfo = studentDao.getNoCourseBeServeStudentInfo(new ArrayList<>(noCourseServeStudentIds));
|
|
|
+ }
|
|
|
+
|
|
|
List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
|
|
|
|
|
|
for (Map.Entry<Integer, List<StudentServeCourseDto>> studentCourseMapEntry : studentCourseMap.entrySet()) {
|
|
@@ -496,6 +504,40 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ Map<Integer, Set<String>> noCourseStudentMusicIdsMap = noCourseBeServeStudentInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId, Collectors.mapping(StudentServeCourseDto::getMusicGroupId, Collectors.toSet())));
|
|
|
+ Map<Integer, List<StudentServeCourseDto>> noCourseStudentCourseMap = noCourseBeServeStudentInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
|
|
|
+ for (Map.Entry<Integer, Set<String>> noCourseStudentMusicIdsMapEntry : noCourseStudentMusicIdsMap.entrySet()) {
|
|
|
+ Map<Integer, Integer> teacherNumMap = new HashMap<>();
|
|
|
+ for (String groupId : noCourseStudentMusicIdsMapEntry.getValue()) {
|
|
|
+ Integer teacherId = null;
|
|
|
+ List<BaseMapDto<Integer, Integer>> studentTeacherIdList = courseScheduleStudentPaymentDao.getStudentClassGroupBishopTeacherMap(null, groupId);
|
|
|
+ if(!CollectionUtils.isEmpty(studentTeacherIdList)){
|
|
|
+ teacherId = studentTeacherIdList.get(0).getValue();
|
|
|
+ }
|
|
|
+ teacherId = Objects.isNull(teacherId)?noCourseStudentCourseMap.get(noCourseStudentMusicIdsMapEntry.getKey()).get(0).getLeadTeacherId():teacherId;
|
|
|
+ if(Objects.isNull(teacherId)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!teacherNumMap.containsKey(teacherId)){
|
|
|
+ teacherNumMap.put(teacherId, 1);
|
|
|
+ }else{
|
|
|
+ teacherNumMap.put(teacherId, teacherNumMap.get(teacherId)+1);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ for (Map.Entry<Integer, Integer> teacherNumMapEntry : teacherNumMap.entrySet()) {
|
|
|
+ StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(noCourseStudentMusicIdsMapEntry.getKey(),
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(!CollectionUtils.isEmpty(results)){
|
|
|
|
|
|
if(CollectionUtils.isEmpty(studentIds)){
|