|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.auth.api.entity.SysUserRole;
|
|
import com.ym.mec.auth.api.entity.SysUserRole;
|
|
|
|
+import com.ym.mec.auth.api.enums.SysUserType;
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
@@ -543,6 +544,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
public void classStartDateAdjust(List<CourseSchedule> newCourseSchedules) {
|
|
public void classStartDateAdjust(List<CourseSchedule> newCourseSchedules) {
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
List<Long> newCourseScheduleIds = newCourseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
|
|
List<Long> newCourseScheduleIds = newCourseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
|
|
//获取对应未修改的课程列表
|
|
//获取对应未修改的课程列表
|
|
List<CourseSchedule> oldCourseScheduleList = courseScheduleDao.findByCourseScheduleIds(newCourseScheduleIds);
|
|
List<CourseSchedule> oldCourseScheduleList = courseScheduleDao.findByCourseScheduleIds(newCourseScheduleIds);
|
|
@@ -565,15 +567,15 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
Map<Long, CourseSchedule> oldCourseSchedules = oldCourseScheduleList.stream().collect(Collectors.toMap(CourseSchedule::getId,courseSchedule -> courseSchedule));
|
|
Map<Long, CourseSchedule> oldCourseSchedules = oldCourseScheduleList.stream().collect(Collectors.toMap(CourseSchedule::getId,courseSchedule -> courseSchedule));
|
|
newCourseSchedules.forEach(newCourseSchedule -> {
|
|
newCourseSchedules.forEach(newCourseSchedule -> {
|
|
|
|
|
|
- if(newCourseSchedule.getStartClassTime().before(tomorrow)){
|
|
|
|
|
|
+ if(newCourseSchedule.getStartClassTime().before(tomorrow)&&sysUser.getUserType().equals(SysUserType.TEACHER)){
|
|
throw new BizException("调整时间必须为明天以后");
|
|
throw new BizException("调整时间必须为明天以后");
|
|
}
|
|
}
|
|
|
|
|
|
CourseSchedule oldCourseSchedule = oldCourseSchedules.get(newCourseSchedule.getId());
|
|
CourseSchedule oldCourseSchedule = oldCourseSchedules.get(newCourseSchedule.getId());
|
|
|
|
|
|
-// if(oldCourseSchedule.getStartClassTime().before(now)){
|
|
|
|
-// throw new BizException("不能调整今天及以前的课程");
|
|
|
|
-// }
|
|
|
|
|
|
+ if(oldCourseSchedule.getStartClassTime().before(now)&&sysUser.getUserType().equals(SysUserType.TEACHER)){
|
|
|
|
+ throw new BizException("不能调整今天及以前的课程");
|
|
|
|
+ }
|
|
|
|
|
|
oldCourseSchedule.setClassDate(newCourseSchedule.getClassDate());
|
|
oldCourseSchedule.setClassDate(newCourseSchedule.getClassDate());
|
|
oldCourseSchedule.setStartClassTime(newCourseSchedule.getStartClassTime());
|
|
oldCourseSchedule.setStartClassTime(newCourseSchedule.getStartClassTime());
|