|
@@ -17,6 +17,7 @@ import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
|
|
import com.yonge.cooleshow.biz.dal.service.*;
|
|
import com.yonge.cooleshow.biz.dal.service.*;
|
|
import com.yonge.cooleshow.biz.dal.support.PageUtil;
|
|
import com.yonge.cooleshow.biz.dal.support.PageUtil;
|
|
import com.yonge.cooleshow.biz.dal.support.WrapperUtil;
|
|
import com.yonge.cooleshow.biz.dal.support.WrapperUtil;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.CourseStudent;
|
|
import com.yonge.cooleshow.biz.dal.vo.MyCourseVo;
|
|
import com.yonge.cooleshow.biz.dal.vo.MyCourseVo;
|
|
import com.yonge.cooleshow.biz.dal.vo.TeacherLiveCourseInfoVo;
|
|
import com.yonge.cooleshow.biz.dal.vo.TeacherLiveCourseInfoVo;
|
|
import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
@@ -90,7 +91,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
if (StringUtils.isNotBlank(status)) {
|
|
if (StringUtils.isNotBlank(status)) {
|
|
CourseScheduleEnum.existCourseState(status, "查询条件错误,课程状态不正确");
|
|
CourseScheduleEnum.existCourseState(status, "查询条件错误,课程状态不正确");
|
|
}
|
|
}
|
|
- param.put("status",status);
|
|
|
|
|
|
+ param.put("status", status);
|
|
String classDate = WrapperUtil.toStr(param, "classDate", "查询时间不能为空!");
|
|
String classDate = WrapperUtil.toStr(param, "classDate", "查询时间不能为空!");
|
|
//本月的第一天
|
|
//本月的第一天
|
|
LocalDate firstDay;
|
|
LocalDate firstDay;
|
|
@@ -257,7 +258,9 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
Integer month = WrapperUtil.toInt(param, "month", "日历的时间月份不能为空!");
|
|
Integer month = WrapperUtil.toInt(param, "month", "日历的时间月份不能为空!");
|
|
Integer day = WrapperUtil.toInt(param, "month", "日历的时间日期不能为空!");
|
|
Integer day = WrapperUtil.toInt(param, "month", "日历的时间日期不能为空!");
|
|
Integer singleCourseMinutes = WrapperUtil.toInt(param, "singleCourseMinutes", "单课时时长不能为空!");
|
|
Integer singleCourseMinutes = WrapperUtil.toInt(param, "singleCourseMinutes", "单课时时长不能为空!");
|
|
-
|
|
|
|
|
|
+ if (singleCourseMinutes < 25) {
|
|
|
|
+ throw new BizException("单课时时长不能小于25分钟!");
|
|
|
|
+ }
|
|
//传入的日期+1天开始
|
|
//传入的日期+1天开始
|
|
LocalDate firstDay = LocalDate.of(year, month, day).plusDays(1L);
|
|
LocalDate firstDay = LocalDate.of(year, month, day).plusDays(1L);
|
|
//根据firstDay计算出该月的最后一天
|
|
//根据firstDay计算出该月的最后一天
|
|
@@ -628,6 +631,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
* <p>
|
|
* <p>
|
|
* 老师端-课表
|
|
* 老师端-课表
|
|
* search:{"classDate":"2022-03-27"}
|
|
* search:{"classDate":"2022-03-27"}
|
|
|
|
+ * search:{"classMonth":"2022-03"}
|
|
|
|
+ * <p>
|
|
|
|
+ * 老师端-课表-陪练课
|
|
|
|
+ * search:{"classDate":"2022-03-27"}
|
|
*
|
|
*
|
|
* @Description: 根据老师id查询购课学员
|
|
* @Description: 根据老师id查询购课学员
|
|
* @Author: cy
|
|
* @Author: cy
|
|
@@ -655,7 +662,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
search.setRepliedIds(studentList);
|
|
search.setRepliedIds(studentList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return page.setRecords(baseMapper.queryTeacherPracticeCourse(page, search));
|
|
|
|
|
|
+ return page.setRecords(baseMapper.queryTeacherPracticeCourse(page, monthToDate(search)));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -666,12 +673,34 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 按月份计算开始结束日期
|
|
|
|
+ *
|
|
|
|
+ * @param search
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public MyCourseSearch monthToDate(MyCourseSearch search) {
|
|
|
|
+ String classMonth = search.getClassMonth();
|
|
|
|
+ String[] classDateSp = classMonth.split("-");
|
|
|
|
+ LocalDate firstDay;
|
|
|
|
+ try {
|
|
|
|
+ firstDay = LocalDate.of(Integer.parseInt(classDateSp[0]), Integer.parseInt(classDateSp[1]), 1);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new BizException("查询时间格式不正确 [" + classMonth + "]");
|
|
|
|
+ }
|
|
|
|
+ //本月的最后一天
|
|
|
|
+ LocalDate lastDay = firstDay.with(TemporalAdjusters.lastDayOfMonth());
|
|
|
|
+ search.setStartDate(firstDay.toString());
|
|
|
|
+ search.setEndDate(lastDay.toString());
|
|
|
|
+ return search;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* @Description: 查询老师约课日历
|
|
* @Description: 查询老师约课日历
|
|
* @Author: cy
|
|
* @Author: cy
|
|
* @Date: 2022/4/13
|
|
* @Date: 2022/4/13
|
|
*/
|
|
*/
|
|
- public List<String> queryCourseSchedule(MyCourseSearch search) {
|
|
|
|
- return baseMapper.queryCourseSchedule(search);
|
|
|
|
|
|
+ public Set<String> queryCourseSchedule(MyCourseSearch search) {
|
|
|
|
+ return baseMapper.queryCourseSchedule(monthToDate(search));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -680,7 +709,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
* @Date: 2022/4/13
|
|
* @Date: 2022/4/13
|
|
*/
|
|
*/
|
|
public IPage<MyCourseVo> queryStudentPracticeCourse(IPage<MyCourseVo> page, MyCourseSearch search) {
|
|
public IPage<MyCourseVo> queryStudentPracticeCourse(IPage<MyCourseVo> page, MyCourseSearch search) {
|
|
- return page.setRecords(baseMapper.queryStudentPracticeCourse(page, search));
|
|
|
|
|
|
+ return page.setRecords(baseMapper.queryStudentPracticeCourse(page, monthToDate(search)));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -694,8 +723,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
* @Author: cy
|
|
* @Author: cy
|
|
* @Date: 2022/4/14
|
|
* @Date: 2022/4/14
|
|
*/
|
|
*/
|
|
- public List<String> queryCourseScheduleStudent(MyCourseSearch search) {
|
|
|
|
- return baseMapper.queryCourseScheduleStudent(search);
|
|
|
|
|
|
+ public Set<String> queryCourseScheduleStudent(MyCourseSearch search) {
|
|
|
|
+ return baseMapper.queryCourseScheduleStudent(monthToDate(search));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -705,5 +734,17 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
return courseScheduleStudentPayment != null && studentId.equals(courseScheduleStudentPayment.getUserId());
|
|
return courseScheduleStudentPayment != null && studentId.equals(courseScheduleStudentPayment.getUserId());
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * search: {"classDate":"2022-03-27"}
|
|
|
|
+ *
|
|
|
|
+ * @Description: 老师端-课表-日历-用户
|
|
|
|
+ * @Author: cy
|
|
|
|
+ * @Date: 2022/4/18
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public IPage<CourseStudent> queryCourseUser(IPage<CourseStudent> page, MyCourseSearch search) {
|
|
|
|
+ return page.setRecords(baseMapper.queryCourseUser(page, search));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|