|
@@ -2680,8 +2680,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
while (true) {
|
|
|
// int dayOfWeek = now.getDayOfWeek().getValue();
|
|
|
for (CourseTimeDto courseTimeDto : classGroup4MixDto.getCourseTimeDtoList()) {
|
|
|
- //排课开始时间
|
|
|
- LocalDateTime now = courseTimeDto.getStartDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
+ if(courseTimeDto.getCalendar() == null){
|
|
|
+ //排课开始时间
|
|
|
+ courseTimeDto.setCalendar(courseTimeDto.getStartDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
|
|
+ }
|
|
|
List<ClassGroupTeacherMapper> newClassGroupTeacherMapperList = courseTimeDto.getClassGroupTeacherMapperList();
|
|
|
|
|
|
Set<Integer> noRepeatTeacherIds = newClassGroupTeacherMapperList.stream().map(ClassGroupTeacherMapper::getUserId).collect(Collectors.toSet());
|
|
@@ -2702,14 +2704,14 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
}
|
|
|
|
|
|
//跳过节假日
|
|
|
- if (courseTimeDto.getHoliday() && holidayDays.contains(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))) {
|
|
|
- now = now.plusDays(courseTimeDto.getIntervalDays());
|
|
|
+ if (courseTimeDto.getHoliday() && holidayDays.contains(courseTimeDto.getCalendar().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))) {
|
|
|
+ courseTimeDto.setCalendar(courseTimeDto.getCalendar().plusDays(courseTimeDto.getIntervalDays()));
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
// if (!courseTimeDto.getDayOfWeek().equals(dayOfWeek)) continue;
|
|
|
|
|
|
- Date classDate = DateConvertor.toDate(now);
|
|
|
+ Date classDate = DateConvertor.toDate(courseTimeDto.getCalendar());
|
|
|
|
|
|
if (courseTimeDto.getStartDate().compareTo(classDate) > 0
|
|
|
|| courseTimeDto.getEndDate().compareTo(classDate) < 0
|
|
@@ -2720,7 +2722,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
if (totalCourseTimes <= generateCourseTimes) {
|
|
|
break WhileNode;
|
|
|
}
|
|
|
- now = now.plusDays(courseTimeDto.getIntervalDays());
|
|
|
+ courseTimeDto.setCalendar(courseTimeDto.getCalendar().plusDays(courseTimeDto.getIntervalDays()));
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -2802,7 +2804,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
return BaseController.failed(HttpStatus.MULTI_STATUS, "当前课程课酬预计为0,是否继续");
|
|
|
}
|
|
|
}
|
|
|
- now = now.plusDays(courseTimeDto.getIntervalDays());
|
|
|
+ courseTimeDto.setCalendar(courseTimeDto.getCalendar().plusDays(courseTimeDto.getIntervalDays()));
|
|
|
}
|
|
|
}
|
|
|
|