|
@@ -1300,6 +1300,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
Map<Long, CourseSchedule> idCourseMap = courseSchedules.stream().collect(Collectors.toMap(CourseSchedule::getId, c -> c));
|
|
|
List<Long> courseIds = courseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
|
|
|
List<CourseSchedule> existCourses = courseScheduleDao.findByCourseScheduleIds(courseIds);
|
|
|
+
|
|
|
List<CourseScheduleModifyLog> scheduleModifyLogs = new ArrayList<>();
|
|
|
Date now=new Date();
|
|
|
for (CourseSchedule existCours : existCourses) {
|
|
@@ -1324,6 +1325,21 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
scheduleModifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(existCours));
|
|
|
scheduleModifyLogs.add(scheduleModifyLog);
|
|
|
}
|
|
|
+
|
|
|
+ Date startDateTime = existCourses.stream().min(Comparator.comparing(CourseSchedule::getStartClassTime)).get().getStartClassTime();
|
|
|
+ Date endDateTime = existCourses.stream().min(Comparator.comparing(CourseSchedule::getEndClassTime)).get().getEndClassTime();
|
|
|
+ if(PRACTICE.equals(existCourses.get(0).getGroupType())){
|
|
|
+ PracticeGroup practiceGroup = practiceGroupDao.get(Long.valueOf(existCourses.get(0).getMusicGroupId()));
|
|
|
+ if(practiceGroup.getType() != TRIAL){
|
|
|
+ if(DateUtil.minutesBetween(startDateTime,practiceGroup.getCoursesStartDate()) > 0){
|
|
|
+ throw new BizException("调整失败: 调整时间不得早于开课时间");
|
|
|
+ }
|
|
|
+ if(DateUtil.minutesBetween(practiceGroup.getCoursesExpireDate(),endDateTime) > 0){
|
|
|
+ throw new BizException("调整失败: 截止时间超过课程有效期");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
checkNewCourseSchedules(existCourses, false);
|
|
|
courseScheduleDao.batchUpdate(existCourses);
|
|
|
|