|
@@ -1346,8 +1346,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public CourseScheduleDto getRecentCourseSchedule(Integer userId) {
|
|
|
- CourseScheduleDto courseSchedule = courseScheduleDao.getRecentCourseSchedule(userId);
|
|
|
+ public CourseScheduleDto getRecentCourseSchedule(Integer userId,Long courseId) {
|
|
|
+ CourseScheduleDto courseSchedule = courseScheduleDao.getRecentCourseSchedule(userId,courseId);
|
|
|
if(Objects.nonNull(courseSchedule)){
|
|
|
if (Objects.nonNull(courseSchedule.getClassGroupId())) {
|
|
|
List<StudentNameAndPhoneDto> courseStudentNameAndPhone = classGroupStudentMapperDao.findCourseStudentNameAndPhone(courseSchedule.getId().intValue());
|
|
@@ -1357,6 +1357,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ Map<Integer, Long> studentNumCourseMap = MapUtil.convertIntegerMap(studentAttendanceDao.countStudentAttendancesByCourses(Collections.singletonList(courseSchedule.getId())));
|
|
|
+ Long studentNum = studentNumCourseMap.get(courseSchedule.getId());
|
|
|
+ if (Objects.nonNull(studentNum)) {
|
|
|
+ courseSchedule.setIsCallNames(studentNum > 0 ? YesOrNoEnum.YES : YesOrNoEnum.NO);
|
|
|
+ } else {
|
|
|
+ courseSchedule.setIsCallNames(YesOrNoEnum.NO);
|
|
|
+ }
|
|
|
}
|
|
|
return courseSchedule;
|
|
|
}
|