|
@@ -256,7 +256,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean batchAddCourseSchedule(Integer classGroupId, int coursesTimes, Date startDate, Date endDate, List<CourseTimeDto> teachingArrangementList,
|
|
|
+ public boolean batchAddCourseSchedule(Integer classGroupId, int coursesTimes, Date startDate, Date groupEndDate, Date groupStartDate, List<CourseTimeDto> teachingArrangementList,
|
|
|
TeachModeEnum teachMode, CourseScheduleType type, Integer schoolId, boolean isJumpHoliday) {
|
|
|
ClassGroup classGroup = classGroupService.get(classGroupId);
|
|
|
if (classGroup == null) {
|
|
@@ -451,9 +451,14 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
|
|
|
// 判断课程时间是否超过排课结束时间
|
|
|
- if (endDate != null) {
|
|
|
- if (calendar.getTime().after(endDate)) {
|
|
|
- throw new BizException("排课时间超出排课截止日期({})", endDate);
|
|
|
+ if(groupStartDate != null){
|
|
|
+ if(groupStartDate.after(calendar.getTime())){
|
|
|
+ throw new BizException("调整时间不得早于开课时间({})",groupStartDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (groupEndDate != null) {
|
|
|
+ if (calendar.getTime().after(groupEndDate)) {
|
|
|
+ throw new BizException("排课时间超出排课截止日期({})", groupEndDate);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -623,16 +628,18 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
batchDeleteCourseSchedules(batchInsertCoursesDto.getCourseScheduleIdList());
|
|
|
|
|
|
Date endDate = null;
|
|
|
+ Date startDate = null;
|
|
|
if(batchInsertCoursesDto.getType() == CourseScheduleType.PRACTICE){
|
|
|
PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(musicGroupId));
|
|
|
if(practiceGroup == null){
|
|
|
throw new BizException("找不到课程组[{}]信息",musicGroupId);
|
|
|
}
|
|
|
endDate = practiceGroup.getCoursesExpireDate();
|
|
|
+ startDate = practiceGroup.getCoursesStartDate();
|
|
|
}
|
|
|
|
|
|
// 批量加课
|
|
|
- batchAddCourseSchedule(classGroupId, batchInsertCoursesDto.getCourseScheduleIdList().size(), batchInsertCoursesDto.getStartDate(), endDate,
|
|
|
+ batchAddCourseSchedule(classGroupId, batchInsertCoursesDto.getCourseScheduleIdList().size(), batchInsertCoursesDto.getStartDate(), endDate,startDate,
|
|
|
batchInsertCoursesDto.getTeachingArrangementList(), batchInsertCoursesDto.getTeachMode(), batchInsertCoursesDto.getType(),
|
|
|
batchInsertCoursesDto.getSchoolId(), batchInsertCoursesDto.getIsJumpHoliday());
|
|
|
return true;
|