|
@@ -46,6 +46,8 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
|
private SysMessageService sysMessageService;
|
|
|
@Autowired
|
|
|
private TeacherDao teacherDao;
|
|
|
+ @Autowired
|
|
|
+ private CourseScheduleDao courseScheduleDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExtracurricularExercisesReply> getDAO() {
|
|
@@ -185,6 +187,22 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
|
Map<Integer, String> idNameMap = teachers.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, SimpleUserDto::getUserName));
|
|
|
for (ExtraExerciseStudentsDto extraExerciseStudentsDto : dataList) {
|
|
|
extraExerciseStudentsDto.setTeacherName(idNameMap.get(extraExerciseStudentsDto.getTeacherId()));
|
|
|
+ if(Objects.nonNull(queryInfo.getExistVipCourse())){
|
|
|
+ extraExerciseStudentsDto.setExistVipCourse(queryInfo.getExistVipCourse());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(Objects.isNull(queryInfo.getExistVipCourse())){
|
|
|
+ List<Integer> studentIds = dataList.stream().map(ExtraExerciseStudentsDto::getUserId).collect(Collectors.toList());
|
|
|
+ List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesInFuture(studentIds);
|
|
|
+ Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
|
|
|
+ for (ExtraExerciseStudentsDto exercisesSituationDto : dataList) {
|
|
|
+ Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getUserId());
|
|
|
+ if(Objects.isNull(vipCourses)||vipCourses<=0){
|
|
|
+ exercisesSituationDto.setExistVipCourse(0);
|
|
|
+ }else{
|
|
|
+ exercisesSituationDto.setExistVipCourse(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (count == 0) {
|