|
@@ -1950,12 +1950,13 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
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)));
|
|
|
+ LocalDateTime groupMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_GROUP_ROOM_MINUTE)));
|
|
|
|
|
|
//课程开始(开课时间 ≤ (NOW + 提前进入房间时间(分)) && NOW ≤ 结束时间)
|
|
|
List<CourseSchedule> liveStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
|
|
|
.eq(CourseSchedule::getLock, 0)
|
|
|
.eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
|
|
|
- .in(CourseSchedule::getType, CourseScheduleEnum.LIVE, CourseScheduleEnum.GROUP)
|
|
|
+ .in(CourseSchedule::getType, CourseScheduleEnum.LIVE)
|
|
|
.le(CourseSchedule::getStartTime, liveMinute)
|
|
|
.ge(CourseSchedule::getEndTime, LocalDateTime.now()));
|
|
|
List<CourseSchedule> practiceStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
|
|
@@ -1977,6 +1978,13 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
.eq(CourseSchedule::getType, CourseScheduleEnum.PIANO_ROOM_CLASS)
|
|
|
.le(CourseSchedule::getStartTime, pianoMinute)
|
|
|
.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)) {
|
|
|
liveStart = new ArrayList<>();
|
|
|
}
|
|
@@ -1989,7 +1997,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
if (CollectionUtils.isEmpty(pianoStart)) {
|
|
|
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)) {
|
|
|
//课程状态更新为ING
|
|
|
baseMapper.updateStartTime(courseStart);
|
|
@@ -1999,7 +2010,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
List<CourseScheduleStudentVo> userList = paymentDao.selectUser();
|
|
|
if (CollectionUtils.isNotEmpty(userList)) {
|
|
|
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());
|
|
|
if (CollectionUtils.isNotEmpty(practiceList)) {//趣纠课/vip课
|
|
|
//老师课酬状态改为待结算
|
|
@@ -2058,6 +2070,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
List<CourseScheduleStudentVo> courseList = userList.stream()
|
|
|
.filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode(),
|
|
|
CourseScheduleEnum.VIP.getCode(),
|
|
|
+ CourseScheduleEnum.GROUP.getCode(),
|
|
|
CourseScheduleEnum.PIANO_ROOM_CLASS.getCode()).contains(s.getType()))
|
|
|
.collect(Collectors.toList());
|
|
|
|