|
@@ -2374,4 +2374,33 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
checkNewCourseSchedules(courseSchedules,false);
|
|
|
courseScheduleDao.update(oldCourseSchedule);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void practiceCourseTeacherAdjust(CourseSchedule courseSchedule) {
|
|
|
+ if(Objects.isNull(courseSchedule.getId())){
|
|
|
+ throw new BizException("请指定课程");
|
|
|
+ }
|
|
|
+ if(Objects.isNull(courseSchedule.getActualTeacherId())){
|
|
|
+ throw new BizException("请指定上课老师");
|
|
|
+ }
|
|
|
+ CourseSchedule oldCourseSchedule = courseScheduleDao.get(courseSchedule.getId());
|
|
|
+ if(Objects.isNull(oldCourseSchedule)){
|
|
|
+ throw new BizException("未找到对应课程");
|
|
|
+ }
|
|
|
+ if(!oldCourseSchedule.getGroupType().equals(GroupType.PRACTICE)){
|
|
|
+ throw new BizException("请选择陪练课");
|
|
|
+ }
|
|
|
+ Integer practiceCourseMinutes=25;
|
|
|
+ SysConfig practiceCourseMinutesConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
|
|
|
+ if(Objects.nonNull(practiceCourseMinutesConfig)){
|
|
|
+ practiceCourseMinutes=practiceCourseMinutesConfig.getParanValue(Integer.class);
|
|
|
+ }
|
|
|
+ oldCourseSchedule.setClassDate(courseSchedule.getStartClassTime());
|
|
|
+ oldCourseSchedule.setStartClassTime(courseSchedule.getStartClassTime());
|
|
|
+ oldCourseSchedule.setEndClassTime(DateUtil.addMinutes(courseSchedule.getStartClassTime(),practiceCourseMinutes));
|
|
|
+ List<CourseSchedule> courseSchedules=new ArrayList<>();
|
|
|
+ courseSchedules.add(oldCourseSchedule);
|
|
|
+ checkNewCourseSchedules(courseSchedules,false);
|
|
|
+ courseScheduleDao.update(oldCourseSchedule);
|
|
|
+ }
|
|
|
}
|