|
@@ -1913,6 +1913,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
//查询房间配置时间
|
|
|
LocalDateTime liveMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_LIVE_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 pianoMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PIANO_ROOM_MINUTE)));
|
|
|
|
|
|
//课程开始(开课时间 ≤ (NOW + 提前进入房间时间(分)) && NOW ≤ 结束时间)
|
|
@@ -1928,6 +1929,13 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
.eq(CourseSchedule::getType, CourseScheduleEnum.PRACTICE)
|
|
|
.le(CourseSchedule::getStartTime, practiceMinute)
|
|
|
.ge(CourseSchedule::getEndTime, LocalDateTime.now()));
|
|
|
+
|
|
|
+ List<CourseSchedule> vipStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
|
|
|
+ .eq(CourseSchedule::getLock, 0)
|
|
|
+ .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
|
|
|
+ .eq(CourseSchedule::getType, CourseScheduleEnum.VIP)
|
|
|
+ .le(CourseSchedule::getStartTime, vipMinute)
|
|
|
+ .ge(CourseSchedule::getEndTime, LocalDateTime.now()));
|
|
|
List<CourseSchedule> pianoStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
|
|
|
.eq(CourseSchedule::getLock, 0)
|
|
|
.eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
|
|
@@ -1940,10 +1948,13 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
if (CollectionUtils.isEmpty(practiceStart)) {
|
|
|
practiceStart = new ArrayList<>();
|
|
|
}
|
|
|
+ if (CollectionUtils.isEmpty(vipStart)) {
|
|
|
+ vipStart = new ArrayList<>();
|
|
|
+ }
|
|
|
if (CollectionUtils.isEmpty(pianoStart)) {
|
|
|
pianoStart = new ArrayList<>();
|
|
|
}
|
|
|
- List<CourseSchedule> courseStart = Stream.of(liveStart, practiceStart, pianoStart).flatMap(Collection::stream).collect(Collectors.toList());
|
|
|
+ List<CourseSchedule> courseStart = Stream.of(liveStart, practiceStart, pianoStart,vipStart).flatMap(Collection::stream).collect(Collectors.toList());
|
|
|
if (CollectionUtils.isNotEmpty(courseStart)) {
|
|
|
//课程状态更新为ING
|
|
|
baseMapper.updateStartTime(courseStart);
|
|
@@ -1952,8 +1963,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
//课程结束(NOW ≥ 结束时间)
|
|
|
List<CourseScheduleStudentVo> userList = paymentDao.selectUser();
|
|
|
if (CollectionUtils.isNotEmpty(userList)) {
|
|
|
- List<CourseScheduleStudentVo> practiceList = userList.stream().filter(s -> s.getType().equals(CourseScheduleEnum.PRACTICE.getCode())).collect(Collectors.toList());
|
|
|
- if (CollectionUtils.isNotEmpty(practiceList)) {//趣纠课
|
|
|
+ List<CourseScheduleStudentVo> practiceList = userList.stream()
|
|
|
+ .filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode(),CourseScheduleEnum.VIP.getCode()).contains(s.getType()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (CollectionUtils.isNotEmpty(practiceList)) {//趣纠课/vip课
|
|
|
//老师课酬状态改为待结算
|
|
|
courseScheduleTeacherSalaryService.update(null, Wrappers.<CourseScheduleTeacherSalary>lambdaUpdate()
|
|
|
.set(CourseScheduleTeacherSalary::getStatus, TeacherSalaryEnum.WAIT.getCode())
|
|
@@ -2008,7 +2021,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
}
|
|
|
|
|
|
List<CourseScheduleStudentVo> courseList = userList.stream()
|
|
|
- .filter(s -> (s.getType().equals(CourseScheduleEnum.PRACTICE.getCode()) || s.getType().equals(CourseScheduleEnum.PIANO_ROOM_CLASS.getCode())))
|
|
|
+ .filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode(),CourseScheduleEnum.VIP.getCode(),CourseScheduleEnum.PIANO_ROOM_CLASS.getCode()).contains(s.getType()))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
//清除缓存
|