|
@@ -2527,6 +2527,22 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(!oldCourseSchedule.getGroupType().equals(GroupType.PRACTICE)){
|
|
|
throw new BizException("请选择陪练课");
|
|
|
}
|
|
|
+ PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(oldCourseSchedule.getMusicGroupId()));
|
|
|
+ String classDate = DateUtil.format(courseSchedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
|
|
|
+ String startClassTime = DateUtil.format(courseSchedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
|
|
|
+ Date startDateTime = DateUtil.stringToDate(classDate + " " + startClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
|
+ Date endDateTime = DateUtil.addMinutes(startDateTime,practiceGroup.getSingleClassMinutes());
|
|
|
+ if(DateUtil.minutesBetween(practiceGroup.getCoursesExpireDate(),endDateTime) > 0){
|
|
|
+ throw new BizException("调整失败: 截止时间超过课程有效期");
|
|
|
+ }
|
|
|
+ Date date = new Date();
|
|
|
+ if(DateUtil.minutesBetween(endDateTime,date) > 0){
|
|
|
+ oldCourseSchedule.setStatus(CourseStatusEnum.OVER);
|
|
|
+ }else if(DateUtil.minutesBetween(date,startDateTime) > 0){
|
|
|
+ oldCourseSchedule.setStatus(CourseStatusEnum.NOT_START);
|
|
|
+ }else {
|
|
|
+ oldCourseSchedule.setStatus(CourseStatusEnum.UNDERWAY);
|
|
|
+ }
|
|
|
Integer practiceCourseMinutes=25;
|
|
|
SysConfig practiceCourseMinutesConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
|
|
|
if(Objects.nonNull(practiceCourseMinutesConfig)){
|
|
@@ -2535,11 +2551,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
oldCourseSchedule.setClassDate(courseSchedule.getStartClassTime());
|
|
|
oldCourseSchedule.setStartClassTime(courseSchedule.getStartClassTime());
|
|
|
oldCourseSchedule.setEndClassTime(DateUtil.addMinutes(courseSchedule.getStartClassTime(),practiceCourseMinutes));
|
|
|
- oldCourseSchedule.setStatus(CourseStatusEnum.NOT_START);
|
|
|
List<CourseSchedule> courseSchedules=new ArrayList<>();
|
|
|
courseSchedules.add(oldCourseSchedule);
|
|
|
checkNewCourseSchedules(courseSchedules,false);
|
|
|
- teacherAttendanceDao.batchUpdateTeacher(courseSchedules.stream().map(e->e.getId()).collect(Collectors.toSet()),oldCourseSchedule.getActualTeacherId());
|
|
|
+ if(oldCourseSchedule.getStatus() == CourseStatusEnum.NOT_START){
|
|
|
+ teacherAttendanceDao.batchUpdateTeacher(courseSchedules.stream().map(e->e.getId()).collect(Collectors.toSet()),oldCourseSchedule.getActualTeacherId());
|
|
|
+ }
|
|
|
courseScheduleDao.update(oldCourseSchedule);
|
|
|
}
|
|
|
|