|
@@ -2205,6 +2205,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
VipGroupCategory vipGroupCategory = vipGroupCategoryService.get(vipGroup.getVipGroupCategoryId());
|
|
|
vipGroupDetail.setCategoryName(vipGroupCategory.getName());
|
|
|
vipGroupDetail.setNumberOfClasses(vipGroupDao.countTeacherVipGroups(vipGroupDetail.getTeacherId().longValue()));
|
|
|
+ vipGroupDetail.setLiveConfigJson(vipGroup.getLiveConfigJson());
|
|
|
return vipGroupDetail;
|
|
|
}
|
|
|
}
|
|
@@ -2758,19 +2759,19 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
//退还优惠券
|
|
|
sysCouponCodeService.quit(order.getCouponCodeId());
|
|
|
} else {
|
|
|
+ //生成班级学员关联
|
|
|
+ ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
+ classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
+ classGroupStudentMapper.setClassGroupId(classGroup.getId());
|
|
|
+ classGroupStudentMapper.setUserId(userId);
|
|
|
+ classGroupStudentMapper.setCreateTime(date);
|
|
|
+ classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ classGroupStudentMapper.setGroupType(groupType);
|
|
|
+ classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
if(groupType == VIP){
|
|
|
//活动赠送
|
|
|
studentPaymentOrderService.activityGive(vipGroup.getVipGroupActivityId(), order,
|
|
|
vipGroup.getId().toString(), null);
|
|
|
- //生成班级学员关联
|
|
|
- ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
- classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
- classGroupStudentMapper.setClassGroupId(classGroup.getId());
|
|
|
- classGroupStudentMapper.setUserId(userId);
|
|
|
- classGroupStudentMapper.setCreateTime(date);
|
|
|
- classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
- classGroupStudentMapper.setGroupType(groupType);
|
|
|
- classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
//获取班级实际人数
|
|
|
Integer studentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(groupType, classGroup.getMusicGroupId());
|
|
|
//课程组人数已满,变更状态
|
|
@@ -2779,7 +2780,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
classGroup.setDelFlag(0);
|
|
|
VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
|
|
|
vipGroup.getOrganId(), vipGroup.getGroupType());
|
|
|
-
|
|
|
//生成课表
|
|
|
List<CourseSchedule> courseSchedules = JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
|
|
|
classGroup.setTotalClassTimes(courseSchedules.size());
|
|
@@ -4525,16 +4525,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
Integer tenantId = vipGroup.getTenantId();
|
|
|
for (String s : vipGroup.getStudentIdList().split(",")) {
|
|
|
Integer userId = Integer.parseInt(s);
|
|
|
- //生成班级学员关联
|
|
|
- ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
- classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
- classGroupStudentMapper.setClassGroupId(classGroup.getId());
|
|
|
- classGroupStudentMapper.setUserId(userId);
|
|
|
- classGroupStudentMapper.setCreateTime(now);
|
|
|
- classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
- classGroupStudentMapper.setGroupType(GroupType.LIVE);
|
|
|
- classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
-
|
|
|
classGroup.setDelFlag(0);
|
|
|
VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
|
|
|
vipGroup.getOrganId(), vipGroup.getGroupType());
|
|
@@ -4898,11 +4888,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);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<CourseSchedule> liveCourseList(LiveGroupWrapper.LiveGroupStudentQuery query) {
|
|
|
+ public Map<String, Object> liveCourseList(LiveGroupWrapper.LiveGroupStudentQuery query) {
|
|
|
|
|
|
VipGroup vipGroup = this.get(query.getLiveGroupId());
|
|
|
if (Objects.isNull(vipGroup)) {
|
|
@@ -4912,10 +4943,30 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("此课程不是直播课程");
|
|
|
}
|
|
|
// 报名中的课程直接返回json数据
|
|
|
+ List<CourseSchedule> courseSchedules;
|
|
|
if (vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)) {
|
|
|
- return JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
|
|
|
+ courseSchedules = JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
|
|
|
} 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();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|