|
@@ -4898,11 +4898,52 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 学生休学状态
|
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(query.getLiveGroupId(), GroupType.LIVE.getCode());
|
|
|
|
+ if (Objects.isNull(classGroup)) {
|
|
|
|
+ return livedStudentList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<ClassGroupStudentMapper> studentMapperList = classGroupStudentMapperDao.findAllByClassGroup(classGroup.getId().longValue());
|
|
|
|
+ if (CollectionUtils.isEmpty(studentMapperList)) {
|
|
|
|
+ return livedStudentList;
|
|
|
|
+ }
|
|
|
|
+ Map<Integer, ClassGroupStudentMapper> studentMapperMap = studentMapperList.stream().collect(Collectors.toMap(ClassGroupStudentMapper::getUserId, o->o ,(k1,k2)->k2));
|
|
|
|
+
|
|
|
|
+ List<StudentApplyRefunds> applyRefunds = studentApplyRefundsDao.findByGroupAndType(query.getLiveGroupId().toString(), GroupType.LIVE.getCode());
|
|
|
|
+ Map<Integer, List<StudentApplyRefunds>> studentApplyRefundsMap = applyRefunds.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(StudentApplyRefunds::getUserId));
|
|
|
|
+ records.forEach(data -> {
|
|
|
|
+ ClassGroupStudentMapper classGroupStudentMapper = studentMapperMap.get(data.getStudentId().intValue());
|
|
|
|
+ if (Objects.isNull(classGroupStudentMapper)) {
|
|
|
|
+ data.setStudentStatus(0);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (classGroupStudentMapper.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)) {
|
|
|
|
+ data.setStudentStatus(1);
|
|
|
|
+ return;
|
|
|
|
+ } else if (classGroupStudentMapper.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)) {
|
|
|
|
+ data.setStudentStatus(3);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsMap.get(data.getStudentId().intValue());
|
|
|
|
+ if (!CollectionUtils.isEmpty(studentApplyRefunds)) {
|
|
|
|
+ StudentApplyRefunds studentApplyRefund = studentApplyRefunds.get(0);
|
|
|
|
+ if (data.getStudentStatus() == 0 && studentApplyRefund.getStatus().equals(StudentApplyRefundsStatus.ING)) {
|
|
|
|
+ data.setStudentStatus(2);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ data.setStudentStatus(0);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
return livedStudentList.setRecords(records);
|
|
return livedStudentList.setRecords(records);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<CourseSchedule> liveCourseList(LiveGroupWrapper.LiveGroupStudentQuery query) {
|
|
|
|
|
|
+ public Map<String, Object> liveCourseList(LiveGroupWrapper.LiveGroupStudentQuery query) {
|
|
|
|
|
|
VipGroup vipGroup = this.get(query.getLiveGroupId());
|
|
VipGroup vipGroup = this.get(query.getLiveGroupId());
|
|
if (Objects.isNull(vipGroup)) {
|
|
if (Objects.isNull(vipGroup)) {
|
|
@@ -4912,10 +4953,30 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
throw new BizException("此课程不是直播课程");
|
|
throw new BizException("此课程不是直播课程");
|
|
}
|
|
}
|
|
// 报名中的课程直接返回json数据
|
|
// 报名中的课程直接返回json数据
|
|
|
|
+ List<CourseSchedule> courseSchedules;
|
|
if (vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)) {
|
|
if (vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)) {
|
|
- return JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
|
|
|
|
|
|
+ courseSchedules = JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
|
|
} else {
|
|
} else {
|
|
- return courseScheduleDao.findGroupCourseSchedules(vipGroup.getId().toString(), GroupType.LIVE.getCode());
|
|
|
|
|
|
+ courseSchedules = courseScheduleDao.findGroupCourseSchedules(vipGroup.getId().toString(), GroupType.LIVE.getCode());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
|
+ result.put("list", courseSchedules);
|
|
|
|
+ result.put("singleClassMinutes", vipGroup.getSingleClassMinutes());
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 直播课程提醒
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void liveCourseRemind() {
|
|
|
|
+ // 查询30分钟内要开始的并且没有直播通知的直播课
|
|
|
|
+ List<CourseSchedule> courseSchedules = courseScheduleDao.liveCourseRemind();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|