|
@@ -1115,6 +1115,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
public PageInfo<CourseStudent> queryStudentLiveCourse(Map<String, Object> param) {
|
|
public PageInfo<CourseStudent> queryStudentLiveCourse(Map<String, Object> param) {
|
|
//本月的最后一天
|
|
//本月的最后一天
|
|
param.put("orderState", OrderStatusEnum.PAID.getCode());
|
|
param.put("orderState", OrderStatusEnum.PAID.getCode());
|
|
|
|
+ param.put("groupState", String.join(",", CourseGroupEnum.ING.getCode(), CourseGroupEnum.COMPLETE.getCode()));
|
|
Page<CourseStudent> pageInfo = PageUtil.getPageInfo(param);
|
|
Page<CourseStudent> pageInfo = PageUtil.getPageInfo(param);
|
|
return PageUtil.pageInfo(baseMapper.queryStudentLiveCourse(pageInfo, param));
|
|
return PageUtil.pageInfo(baseMapper.queryStudentLiveCourse(pageInfo, param));
|
|
}
|
|
}
|
|
@@ -1442,8 +1443,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
CourseSchedule schedule = baseMapper.selectOne(Wrappers.<CourseSchedule>lambdaQuery()
|
|
CourseSchedule schedule = baseMapper.selectOne(Wrappers.<CourseSchedule>lambdaQuery()
|
|
.eq(CourseSchedule::getId, courseId)
|
|
.eq(CourseSchedule::getId, courseId)
|
|
.eq(CourseSchedule::getLock, 0)
|
|
.eq(CourseSchedule::getLock, 0)
|
|
- .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
|
|
|
|
- .in(CourseSchedule::getType, CourseScheduleEnum.PRACTICE, CourseScheduleEnum.VIP));
|
|
|
|
|
|
+ .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START));
|
|
if (ObjectUtil.isEmpty(schedule)) {
|
|
if (ObjectUtil.isEmpty(schedule)) {
|
|
throw new BizException("无法调整该课程,课程不存在");
|
|
throw new BizException("无法调整该课程,课程不存在");
|
|
}
|
|
}
|
|
@@ -1460,8 +1460,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
|
|
|
//查询是否有人购买
|
|
//查询是否有人购买
|
|
CourseScheduleStudentPayment studentPayment = paymentDao.selectOne(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
|
|
CourseScheduleStudentPayment studentPayment = paymentDao.selectOne(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
|
|
- .eq(CourseScheduleStudentPayment::getCourseId, courseId)
|
|
|
|
- .in(CourseScheduleStudentPayment::getCourseType, CourseScheduleEnum.PRACTICE,CourseScheduleEnum.VIP));
|
|
|
|
|
|
+ .eq(CourseScheduleStudentPayment::getCourseId, courseId));
|
|
if (ObjectUtil.isEmpty(studentPayment)) {
|
|
if (ObjectUtil.isEmpty(studentPayment)) {
|
|
throw new BizException("课程无人购买");
|
|
throw new BizException("课程无人购买");
|
|
}
|
|
}
|
|
@@ -1950,12 +1949,13 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
LocalDateTime practiceMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PRACTICE_ROOM_MINUTE)));
|
|
LocalDateTime practiceMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PRACTICE_ROOM_MINUTE)));
|
|
LocalDateTime vipMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_VIP_ROOM_MINUTE)));
|
|
LocalDateTime vipMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_VIP_ROOM_MINUTE)));
|
|
LocalDateTime pianoMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PIANO_ROOM_MINUTE)));
|
|
LocalDateTime pianoMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PIANO_ROOM_MINUTE)));
|
|
|
|
+ LocalDateTime groupMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_GROUP_ROOM_MINUTE)));
|
|
|
|
|
|
//课程开始(开课时间 ≤ (NOW + 提前进入房间时间(分)) && NOW ≤ 结束时间)
|
|
//课程开始(开课时间 ≤ (NOW + 提前进入房间时间(分)) && NOW ≤ 结束时间)
|
|
List<CourseSchedule> liveStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
|
|
List<CourseSchedule> liveStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
|
|
.eq(CourseSchedule::getLock, 0)
|
|
.eq(CourseSchedule::getLock, 0)
|
|
.eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
|
|
.eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
|
|
- .in(CourseSchedule::getType, CourseScheduleEnum.LIVE, CourseScheduleEnum.GROUP)
|
|
|
|
|
|
+ .in(CourseSchedule::getType, CourseScheduleEnum.LIVE)
|
|
.le(CourseSchedule::getStartTime, liveMinute)
|
|
.le(CourseSchedule::getStartTime, liveMinute)
|
|
.ge(CourseSchedule::getEndTime, LocalDateTime.now()));
|
|
.ge(CourseSchedule::getEndTime, LocalDateTime.now()));
|
|
List<CourseSchedule> practiceStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
|
|
List<CourseSchedule> practiceStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
|
|
@@ -1977,6 +1977,13 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
.eq(CourseSchedule::getType, CourseScheduleEnum.PIANO_ROOM_CLASS)
|
|
.eq(CourseSchedule::getType, CourseScheduleEnum.PIANO_ROOM_CLASS)
|
|
.le(CourseSchedule::getStartTime, pianoMinute)
|
|
.le(CourseSchedule::getStartTime, pianoMinute)
|
|
.ge(CourseSchedule::getEndTime, LocalDateTime.now()));
|
|
.ge(CourseSchedule::getEndTime, LocalDateTime.now()));
|
|
|
|
+
|
|
|
|
+ List<CourseSchedule> groupStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
|
|
|
|
+ .eq(CourseSchedule::getLock, 0)
|
|
|
|
+ .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
|
|
|
|
+ .eq(CourseSchedule::getType, CourseScheduleEnum.GROUP)
|
|
|
|
+ .le(CourseSchedule::getStartTime, groupMinute)
|
|
|
|
+ .ge(CourseSchedule::getEndTime, LocalDateTime.now()));
|
|
if (CollectionUtils.isEmpty(liveStart)) {
|
|
if (CollectionUtils.isEmpty(liveStart)) {
|
|
liveStart = new ArrayList<>();
|
|
liveStart = new ArrayList<>();
|
|
}
|
|
}
|
|
@@ -1989,7 +1996,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
if (CollectionUtils.isEmpty(pianoStart)) {
|
|
if (CollectionUtils.isEmpty(pianoStart)) {
|
|
pianoStart = new ArrayList<>();
|
|
pianoStart = new ArrayList<>();
|
|
}
|
|
}
|
|
- List<CourseSchedule> courseStart = Stream.of(liveStart, practiceStart, pianoStart,vipStart).flatMap(Collection::stream).collect(Collectors.toList());
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(groupStart)) {
|
|
|
|
+ groupStart = new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+ List<CourseSchedule> courseStart = Stream.of(liveStart, practiceStart, pianoStart,vipStart,groupStart).flatMap(Collection::stream).collect(Collectors.toList());
|
|
if (CollectionUtils.isNotEmpty(courseStart)) {
|
|
if (CollectionUtils.isNotEmpty(courseStart)) {
|
|
//课程状态更新为ING
|
|
//课程状态更新为ING
|
|
baseMapper.updateStartTime(courseStart);
|
|
baseMapper.updateStartTime(courseStart);
|
|
@@ -1999,7 +2009,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
List<CourseScheduleStudentVo> userList = paymentDao.selectUser();
|
|
List<CourseScheduleStudentVo> userList = paymentDao.selectUser();
|
|
if (CollectionUtils.isNotEmpty(userList)) {
|
|
if (CollectionUtils.isNotEmpty(userList)) {
|
|
List<CourseScheduleStudentVo> practiceList = userList.stream()
|
|
List<CourseScheduleStudentVo> practiceList = userList.stream()
|
|
- .filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode(),CourseScheduleEnum.VIP.getCode()).contains(s.getType()))
|
|
|
|
|
|
+ .filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode()
|
|
|
|
+ ,CourseScheduleEnum.VIP.getCode(),CourseScheduleEnum.GROUP.getCode()).contains(s.getType()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
if (CollectionUtils.isNotEmpty(practiceList)) {//趣纠课/vip课
|
|
if (CollectionUtils.isNotEmpty(practiceList)) {//趣纠课/vip课
|
|
//老师课酬状态改为待结算
|
|
//老师课酬状态改为待结算
|
|
@@ -2058,6 +2069,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
List<CourseScheduleStudentVo> courseList = userList.stream()
|
|
List<CourseScheduleStudentVo> courseList = userList.stream()
|
|
.filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode(),
|
|
.filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode(),
|
|
CourseScheduleEnum.VIP.getCode(),
|
|
CourseScheduleEnum.VIP.getCode(),
|
|
|
|
+ CourseScheduleEnum.GROUP.getCode(),
|
|
CourseScheduleEnum.PIANO_ROOM_CLASS.getCode()).contains(s.getType()))
|
|
CourseScheduleEnum.PIANO_ROOM_CLASS.getCode()).contains(s.getType()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
|
|