|
@@ -315,9 +315,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(oldCourseScheduleList.size()!=newCourseSchedules.size()){
|
|
|
throw new BizException("课程信息错误");
|
|
|
}
|
|
|
- Map<Long, List<CourseSchedule>> oldCourseSchedules = oldCourseScheduleList.stream().collect(Collectors.groupingBy(CourseSchedule::getId));
|
|
|
+ Map<Long, CourseSchedule> oldCourseSchedules = oldCourseScheduleList.stream().collect(Collectors.toMap(CourseSchedule::getId,courseSchedule -> courseSchedule));
|
|
|
newCourseSchedules.forEach(newCourseSchedule -> {
|
|
|
- CourseSchedule oldCourseSchedule = oldCourseSchedules.get(newCourseSchedule.getId()).get(0);
|
|
|
+ CourseSchedule oldCourseSchedule = oldCourseSchedules.get(newCourseSchedule.getId());
|
|
|
ArrayList<Date> dates = new ArrayList<>();
|
|
|
dates.add(newCourseSchedule.getClassDate());
|
|
|
List<CourseSchedule> coursesByDates = courseScheduleDao.findOverLapCoursesInDay(dates,newCourseSchedule.getStartClassTime(),newCourseSchedule.getEndClassTime());
|