Browse Source

fix:教师端课表获取学员被删除系统繁忙

Joburgess 4 năm trước cách đây
mục cha
commit
6c835e8dbf

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -1210,7 +1210,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 //                String[] studentNames = classGroupStudentMapperDao.findCourseStudentName(courseScheduleDto.getId().intValue());
                 List<StudentNameAndPhoneDto> courseStudentNameAndPhone = classGroupStudentMapperDao.findCourseStudentNameAndPhone(courseScheduleDto.getId().intValue());
                 if(!CollectionUtils.isEmpty(courseStudentNameAndPhone)){
-                    List<String> studentNames = courseStudentNameAndPhone.stream().map(StudentNameAndPhoneDto::getUserName).collect(Collectors.toList());
+                    List<String> studentNames = courseStudentNameAndPhone.stream().filter(s->Objects.nonNull(s)&&Objects.nonNull(s.getUserName())).map(StudentNameAndPhoneDto::getUserName).collect(Collectors.toList());
                     courseScheduleDto.setStudentNames(org.apache.commons.lang3.StringUtils.join(studentNames, ","));
                     courseScheduleDto.setStudents(courseStudentNameAndPhone);
                 }