|
@@ -2399,7 +2399,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
Date secondSunday = DateUtil.getWeekDayWithDate(applyEndDate, Calendar.SUNDAY);
|
|
|
|
|
|
Map<Integer, List<String>> weekNumApplyTimesMap = getEnableApplyDatesWithWeek();
|
|
|
- List<CourseSchedule> allTeacherCourses = courseScheduleDao.findTeacherCoursesWithDateRange(teacherId, applyStartDate, secondSunday);
|
|
|
+ List<CourseSchedule> allTeacherCourses = courseScheduleDao.findTeacherCoursesWithDateRange(teacherId, firstMonday, secondSunday);
|
|
|
allTeacherCourses.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
|
|
|
|
|
|
JSONObject teacherLeaveData = null;
|
|
@@ -2448,8 +2448,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
while (iterator.hasNext()) {
|
|
|
defaultApplyTime = LocalTime.parse(iterator.next(), dtf);
|
|
|
LocalTime defaultApplyEndTime = defaultApplyTime.plusMinutes(practiceCourseMinutes);
|
|
|
- if (defaultApplyTime.compareTo(leaveStartTime) <= 0
|
|
|
- && defaultApplyEndTime.compareTo(leaveEndTime) >= 0) {
|
|
|
+ if (defaultApplyTime.compareTo(leaveEndTime) <= 0
|
|
|
+ && defaultApplyEndTime.compareTo(leaveStartTime) >= 0) {
|
|
|
iterator.remove();
|
|
|
continue;
|
|
|
}
|
|
@@ -2496,7 +2496,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
|
|
|
int courseWeekNum = 0;
|
|
|
int practiceCourseNum = 0;
|
|
|
- Set<Integer> disableApplyWeek = new HashSet<>();
|
|
|
+ Set<Integer> disableApplyWeekNum = new HashSet<>();
|
|
|
+ Set<Integer> tempDisableApplyWeekNum = new HashSet<>();
|
|
|
LocalDateTime tempClassDateTime;
|
|
|
for (int i = 0; i < allTeacherCourses.size(); i++) {
|
|
|
CourseSchedule teacherCourse = allTeacherCourses.get(i);
|
|
@@ -2505,8 +2506,12 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
practiceCourseNum += 1;
|
|
|
courseWeekNum = tempClassDateTime.get(weekFields.weekOfYear());
|
|
|
}
|
|
|
+ if(teacherCourse.getStartClassTime().compareTo(applyStartDate)>=0
|
|
|
+ &&teacherCourse.getEndClassTime().compareTo(applyEndDate)<=0){
|
|
|
+ tempDisableApplyWeekNum.add(tempClassDateTime.get(weekFields.dayOfWeek()));
|
|
|
+ }
|
|
|
if (Objects.nonNull(maxTeacherCourses) && practiceCourseNum >= maxTeacherCourses) {
|
|
|
- disableApplyWeek.add(courseWeekNum);
|
|
|
+ disableApplyWeekNum.addAll(tempDisableApplyWeekNum);
|
|
|
}
|
|
|
if (tempClassDateTime.get(weekFields.weekOfYear()) != courseWeekNum) {
|
|
|
courseWeekNum = tempClassDateTime.get(weekFields.weekOfYear());
|
|
@@ -2520,7 +2525,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
Iterator<Integer> weekNumApplyTimeIterator2 = weekNumApplyTimesMap.keySet().iterator();
|
|
|
while (weekNumApplyTimeIterator2.hasNext()) {
|
|
|
Integer weekNum=weekNumApplyTimeIterator2.next();
|
|
|
- if(disableApplyWeek.contains(weekNum)){
|
|
|
+ if(disableApplyWeekNum.contains(weekNum)){
|
|
|
weekNumApplyTimeIterator2.remove();
|
|
|
}
|
|
|
}
|