|
@@ -516,9 +516,14 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
courseCalendarEntities.forEach(calendarEntity -> {
|
|
|
//获取课程数据,并剔除交集时间段数据
|
|
|
List<CourseTimeEntity> nowCourse = nowCourseMap.get(calendarEntity.getDate());
|
|
|
+
|
|
|
+ List<CourseTimeEntity> courseTime = new ArrayList<>();
|
|
|
if (CollectionUtils.isEmpty(nowCourse)) {
|
|
|
//当日没课
|
|
|
calendarEntity.setFullCourse(0);// 0:未满 1满
|
|
|
+ if (CollectionUtils.isNotEmpty(calendarEntity.getCourseTime())) {
|
|
|
+ courseTime = calendarEntity.getCourseTime();
|
|
|
+ }
|
|
|
} else {
|
|
|
//将日历时间与课程时间进行对比,如果有交集则将日历的时间数据删除
|
|
|
if (CollectionUtils.isEmpty(calendarEntity.getCourseTime())) {
|
|
@@ -526,26 +531,23 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
}
|
|
|
|
|
|
nowCourse = mergeTime(nowCourse);
|
|
|
-
|
|
|
- List<CourseTimeEntity> courseTime = new ArrayList<>();
|
|
|
Iterator<CourseTimeEntity> iterator = calendarEntity.getCourseTime().iterator();
|
|
|
while (iterator.hasNext()) {
|
|
|
CourseTimeEntity next = iterator.next();
|
|
|
// 去除 next 上 有交集的时间段
|
|
|
courseTime.addAll(delOverlapTime(nowCourse, next));
|
|
|
}
|
|
|
-
|
|
|
- // 检查时间段是否满足课程时间,不满足则删除,满足 并且可多段的情况下,将时间段拆分
|
|
|
- courseTime = splitTime(courseTime,courseMinutes,freeMinutes);
|
|
|
- courseTime.sort(Comparator.comparing(CourseTimeEntity::getStartTime));
|
|
|
- calendarEntity.setCourseTime(courseTime);
|
|
|
-
|
|
|
- //如果日历时间集合数据删没了,那么就证明当天课程已经满了 0:未满 1满
|
|
|
- if (CollectionUtils.isEmpty(calendarEntity.getCourseTime())) {
|
|
|
- calendarEntity.setFullCourse(1);
|
|
|
- } else {
|
|
|
- calendarEntity.setFullCourse(0);
|
|
|
- }
|
|
|
+ }
|
|
|
+ // 检查时间段是否满足课程时间,不满足则删除,满足 并且可多段的情况下,将时间段拆分
|
|
|
+ courseTime = splitTime(courseTime,courseMinutes,freeMinutes);
|
|
|
+ courseTime.sort(Comparator.comparing(CourseTimeEntity::getStartTime));
|
|
|
+ calendarEntity.setCourseTime(courseTime);
|
|
|
+
|
|
|
+ //如果日历时间集合数据删没了,那么就证明当天课程已经满了 0:未满 1满
|
|
|
+ if (CollectionUtils.isEmpty(calendarEntity.getCourseTime())) {
|
|
|
+ calendarEntity.setFullCourse(1);
|
|
|
+ } else {
|
|
|
+ calendarEntity.setFullCourse(0);
|
|
|
}
|
|
|
//获取节假日信息
|
|
|
int calendarYear = LocalDate.parse(calendarEntity.getDate()).getYear();
|