liujc 2 anos atrás
pai
commit
8e556c35a9

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -6479,6 +6479,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 		if (CollectionUtils.isNotEmpty(newCourseSchedules)) {
 
+            // newCourseSchedules集合去重
+            newCourseSchedules = newCourseSchedules.stream()
+                    .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(CourseSchedule::getId))), ArrayList::new));
+
 			// 课程按开始时间排序
 			newCourseSchedules = newCourseSchedules.stream()
 					.sorted(Comparator.comparing(CourseSchedule::getStartClassTime))