|
@@ -121,18 +121,21 @@ public class HomeServiceImpl implements HomeService {
|
|
|
* <p>已完成 已完成课程
|
|
|
*
|
|
|
* @param param 传入参数
|
|
|
- * <p> - year 年
|
|
|
- * <p> - month 月
|
|
|
+ * <p> - dateTime 如果查询年数据 yyyy 如果查询月数据 yyyy-mm
|
|
|
* <p> - type 类型 PRACTICE陪练课 LIVE直播课
|
|
|
+ * <p> - timeType 时间类型 MONTH、月度 YEAR
|
|
|
*/
|
|
|
public CourseHomeVo queryCourseHomeData(Map<String, Object> param) {
|
|
|
CourseScheduleEnum.existCourseType(WrapperUtil.toStr(param, "type"), "课程类型参数错误");
|
|
|
- Integer year = WrapperUtil.toInt(param, "year", "年份不能为空!");
|
|
|
- Integer monthParam = WrapperUtil.toInt(param, "month");
|
|
|
- //按月查询true 年查询false
|
|
|
- boolean isYear = monthParam == 0;
|
|
|
- int month = isYear ? 1 : monthParam;
|
|
|
-
|
|
|
+ String dateTimeStr = WrapperUtil.toStr(param, "dateTime", "查询时间不能为空!");
|
|
|
+ String timeType = WrapperUtil.toStr(param, "timeType", "查询时间不类型不能为空!");
|
|
|
+ //按年查询true 按月查询false
|
|
|
+ boolean isYear = timeType.equals("YEAR");
|
|
|
+ //获取年
|
|
|
+ String[] split = dateTimeStr.split("-");
|
|
|
+ int year = Integer.parseInt(split[0]);
|
|
|
+ //获取月
|
|
|
+ int month = isYear ? 1 : Integer.parseInt(split[1]);;
|
|
|
LocalDate firstDate;
|
|
|
LocalDate endDate;
|
|
|
CourseHomeVo result = new CourseHomeVo();
|