|
@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.ClassGroupDao;
|
|
|
import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
|
|
|
+import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
import com.ym.mec.biz.dal.dao.VipGroupDao;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
@@ -15,6 +16,7 @@ import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
@@ -59,6 +61,8 @@ public class CourseScheduleController extends BaseController {
|
|
|
private OrganizationService organizationService;
|
|
|
@Autowired
|
|
|
private VipGroupDao vipGroupDao;
|
|
|
+ @Autowired
|
|
|
+ private SysConfigDao sysConfigDao;
|
|
|
|
|
|
@ApiOperation(value = "课表详情")
|
|
|
@GetMapping("/query")
|
|
@@ -188,12 +192,21 @@ public class CourseScheduleController extends BaseController {
|
|
|
}
|
|
|
|
|
|
// 直播课
|
|
|
- if (GroupType.LIVE.equals(oldCourseSchedule.getGroupType())
|
|
|
- && org.apache.commons.lang3.StringUtils.isNotBlank(oldCourseSchedule.getLiveRoomId())) {
|
|
|
- // 重置连堂课,关联直播间,消息推送状态
|
|
|
- courseSchedule.setLiveRemind(0);
|
|
|
- courseSchedule.setContinuousCourse(false);
|
|
|
- courseSchedule.setLiveRoomId("");
|
|
|
+ if (GroupType.LIVE.equals(oldCourseSchedule.getGroupType())){
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(oldCourseSchedule.getLiveRoomId())){
|
|
|
+ // 重置连堂课,关联直播间,消息推送状态
|
|
|
+ courseSchedule.setLiveRemind(0);
|
|
|
+ courseSchedule.setContinuousCourse(false);
|
|
|
+ courseSchedule.setLiveRoomId("");
|
|
|
+ }
|
|
|
+ String startRemindTime = sysConfigDao.findConfigValue("live_class_start_remind_time");
|
|
|
+ if(StringUtils.isEmpty(startRemindTime)){
|
|
|
+ startRemindTime = "30";
|
|
|
+ }
|
|
|
+ if(DateUtil.minutesBetween(new Date(),oldCourseSchedule.getStartClassTime()) < Integer.parseInt(startRemindTime)
|
|
|
+ && DateUtil.minutesBetween(new Date(),oldCourseSchedule.getEndClassTime()) >= 0){
|
|
|
+ throw new BizException("直播课课程开始前{}分钟不允许调整",startRemindTime);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if(Objects.isNull(courseSchedule.getClassGroupId())){
|