|
@@ -14,6 +14,7 @@ import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -76,8 +77,26 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
exercisesSituationDto.setExpectExercisesNum((int) until+1);
|
|
|
List<StudentEduTeacherDto> studentEduTeachers = studentEduTeachersMap.get(exercisesSituationDto.getStudentId());
|
|
|
if(!CollectionUtils.isEmpty(studentEduTeachers)){
|
|
|
- exercisesSituationDto.setEducationalTeacherId(studentEduTeachers.get(0).getEducationalTeacherId());
|
|
|
- exercisesSituationDto.setEducationalTeacherName(studentEduTeachers.get(0).getEducationalTeacherName());
|
|
|
+ List<StudentEduTeacherDto> t1 = studentEduTeachers.stream().filter(set -> set.getGroupType().equals(GroupType.VIP.getCode())||set.getGroupType().equals(GroupType.PRACTICE.getCode())).collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isEmpty(t1)){
|
|
|
+ for (StudentEduTeacherDto studentEduTeacherDto : t1) {
|
|
|
+ if(StringUtils.isNoneBlank(studentEduTeacherDto.getEducationalTeacherName())){
|
|
|
+ exercisesSituationDto.setEducationalTeacherId(studentEduTeachers.get(0).getEducationalTeacherId());
|
|
|
+ exercisesSituationDto.setEducationalTeacherName(studentEduTeachers.get(0).getEducationalTeacherName());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<StudentEduTeacherDto> t2 = studentEduTeachers.stream().filter(set -> set.getGroupType().equals(GroupType.MUSIC.getCode())).collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isEmpty(t2)){
|
|
|
+ for (StudentEduTeacherDto studentEduTeacherDto : t2) {
|
|
|
+ if(StringUtils.isNoneBlank(studentEduTeacherDto.getEducationalTeacherName())){
|
|
|
+ exercisesSituationDto.setEducationalTeacherId(studentEduTeachers.get(0).getEducationalTeacherId());
|
|
|
+ exercisesSituationDto.setEducationalTeacherName(studentEduTeachers.get(0).getEducationalTeacherName());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|