|
@@ -146,6 +146,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
param.put("endDate", lastDay.toString());
|
|
|
param.put("teacherId", getSysUser().getId());
|
|
|
param.put("type", CourseScheduleEnum.LIVE.getCode());
|
|
|
+ param.put("groupState", String.join(",", CourseGroupEnum.ING.getCode(), CourseGroupEnum.COMPLETE.getCode()));
|
|
|
log.info("queryTeacherLiveCourse:{}", param);
|
|
|
Page<TeacherLiveCourseInfoVo> pageInfo = PageUtil.getPageInfo(param);
|
|
|
pageInfo.setAsc("a.start_time_");
|
|
@@ -666,26 +667,21 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
public IPage<MyCourseVo> queryTeacherPracticeCourse(IPage<MyCourseVo> page, MyCourseSearch search) {
|
|
|
Integer replied = search.getReplied();
|
|
|
if (replied != null) {
|
|
|
- //查询所有已评价学生id
|
|
|
- List<Long> replyStudent = repliedDao.selectReplyStudent();
|
|
|
- //查询所有购课用户
|
|
|
- List<Long> userList = paymentDao.selectAll();
|
|
|
-
|
|
|
- if (CollectionUtils.isEmpty(userList)) {
|
|
|
- return page.setRecords(new ArrayList<>());
|
|
|
- }
|
|
|
-
|
|
|
+ search.setStatus(CourseScheduleEnum.COMPLETE.getCode());
|
|
|
+ List<MyCourseVo> list = baseMapper.queryTeacherPracticeCourse(page, monthToDate(search));
|
|
|
if (replied == 0) {//未评价
|
|
|
- userList.removeAll(replyStudent);
|
|
|
- search.setRepliedIds(userList);
|
|
|
+ return page.setRecords(list.stream().filter(s -> {
|
|
|
+ return s.getTeacherReplied() == 0;
|
|
|
+ }).collect(Collectors.toList()));
|
|
|
}
|
|
|
|
|
|
if (replied == 1) {//已评价
|
|
|
- replyStudent.add(Long.valueOf(-1));
|
|
|
- search.setRepliedIds(replyStudent);
|
|
|
+ return page.setRecords(list.stream().filter(s -> {
|
|
|
+ return s.getTeacherReplied() == 1;
|
|
|
+ }).collect(Collectors.toList()));
|
|
|
}
|
|
|
- search.setStatus(CourseScheduleEnum.COMPLETE.getCode());
|
|
|
}
|
|
|
+
|
|
|
return page.setRecords(baseMapper.queryTeacherPracticeCourse(page, monthToDate(search)));
|
|
|
}
|
|
|
|
|
@@ -1132,6 +1128,15 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
throw new BizException("无法调整该课程");
|
|
|
}
|
|
|
|
|
|
+ //校验系统配置上下课时间
|
|
|
+ String star = sysConfigService.findConfigValue(SysConfigConstant.COURSE_START_SETTING);//系统开课时间
|
|
|
+ String end = sysConfigService.findConfigValue(SysConfigConstant.COURSE_END_SETTING);//系统关课时间
|
|
|
+ Date s = DateUtil.strToDate(DateUtil.dateToString(classDate) + " " + star + ":00");
|
|
|
+ Date e = DateUtil.strToDate(DateUtil.dateToString(classDate) + " " + end + ":00");
|
|
|
+ if (startTime.before(s) || endTime.after(e)) {
|
|
|
+ throw new BizException("无法调整该课程");
|
|
|
+ }
|
|
|
+
|
|
|
//查询是否有人购买
|
|
|
CourseScheduleStudentPayment studentPayment = paymentDao.selectOne(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
|
|
|
.eq(CourseScheduleStudentPayment::getCourseId, courseId)
|