|
@@ -1807,9 +1807,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
}
|
|
}
|
|
|
|
|
|
//所有课程编号
|
|
//所有课程编号
|
|
- List<Long> allCourseScheduleIds = allCourseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
|
|
|
|
|
|
+ Set<Long> allCourseScheduleIds = allCourseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toSet());
|
|
//所有课程学员签到记录
|
|
//所有课程学员签到记录
|
|
- List<StudentAttendance> studentAttendances = studentAttendanceDao.findByCourseIds(allCourseScheduleIds);
|
|
|
|
|
|
+ List<StudentAttendance> studentAttendances = studentAttendanceDao.findByCourseIds(new ArrayList<>(allCourseScheduleIds));
|
|
//课程请假学员字典
|
|
//课程请假学员字典
|
|
Map<Long, Set<Integer>> courseLeaveStudentMap = studentAttendances.stream()
|
|
Map<Long, Set<Integer>> courseLeaveStudentMap = studentAttendances.stream()
|
|
.filter(e -> StudentAttendanceStatusEnum.LEAVE.equals(e.getStatus()))
|
|
.filter(e -> StudentAttendanceStatusEnum.LEAVE.equals(e.getStatus()))
|
|
@@ -1878,24 +1878,27 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
// }
|
|
// }
|
|
|
|
|
|
//助教冲突检测
|
|
//助教冲突检测
|
|
- if (Objects.isNull(preCourseSchedule.getId())) {
|
|
|
|
- IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(preCourseSchedule.getClassGroupId());
|
|
|
|
- if (Objects.nonNull(integerAndIntegerListDto)) {
|
|
|
|
- preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
|
|
|
|
- }
|
|
|
|
- } else if (existCourseScheduleIdsSet.contains(preCourseSchedule.getId())) {
|
|
|
|
- IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(preCourseSchedule.getId());
|
|
|
|
|
|
+ if (allCourseScheduleIds.contains(preCourseSchedule.getId())) {
|
|
|
|
+ IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(preCourseSchedule.getId());
|
|
|
|
+ if (Objects.nonNull(integerAndIntegerListDto)) {
|
|
|
|
+ preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())) {
|
|
|
|
+ IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(preCourseSchedule.getClassGroupId().longValue());
|
|
if (Objects.nonNull(integerAndIntegerListDto)) {
|
|
if (Objects.nonNull(integerAndIntegerListDto)) {
|
|
preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
|
|
preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (Objects.isNull(backCourseSchedule.getId())) {
|
|
|
|
- IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(backCourseSchedule.getClassGroupId());
|
|
|
|
- if (Objects.nonNull(integerAndIntegerListDto)) {
|
|
|
|
- backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
|
|
|
|
- }
|
|
|
|
- } else if (existCourseScheduleIdsSet.contains(backCourseSchedule.getId())) {
|
|
|
|
- IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(backCourseSchedule.getId());
|
|
|
|
|
|
+
|
|
|
|
+ if (allCourseScheduleIds.contains(backCourseSchedule.getId())) {
|
|
|
|
+ IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(backCourseSchedule.getId());
|
|
|
|
+ if (Objects.nonNull(integerAndIntegerListDto)) {
|
|
|
|
+ backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())) {
|
|
|
|
+ IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(backCourseSchedule.getClassGroupId().longValue());
|
|
if (Objects.nonNull(integerAndIntegerListDto)) {
|
|
if (Objects.nonNull(integerAndIntegerListDto)) {
|
|
backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
|
|
backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
|
|
}
|
|
}
|
|
@@ -5178,6 +5181,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
courseRepeatCheckInfos.sort(Comparator.comparing(CourseRepeatCheckDto::getStartClassTime));
|
|
courseRepeatCheckInfos.sort(Comparator.comparing(CourseRepeatCheckDto::getStartClassTime));
|
|
Map<Date, List<CourseRepeatCheckDto>> dayCourseMap = courseRepeatCheckInfos.stream().collect(Collectors.groupingBy(CourseRepeatCheckDto::getClassDate));
|
|
Map<Date, List<CourseRepeatCheckDto>> dayCourseMap = courseRepeatCheckInfos.stream().collect(Collectors.groupingBy(CourseRepeatCheckDto::getClassDate));
|
|
Map<Long, List<Long>> courseRepeatIdMap = new HashMap<>();
|
|
Map<Long, List<Long>> courseRepeatIdMap = new HashMap<>();
|
|
|
|
+ int needAdjustCourseNum = 0;
|
|
for (CourseRepeatCheckDto cs1 : courseRepeatCheckInfos) {
|
|
for (CourseRepeatCheckDto cs1 : courseRepeatCheckInfos) {
|
|
if(!courseRepeatIdMap.containsKey(cs1.getCourseId())){
|
|
if(!courseRepeatIdMap.containsKey(cs1.getCourseId())){
|
|
courseRepeatIdMap.put(cs1.getCourseId(), new ArrayList<>());
|
|
courseRepeatIdMap.put(cs1.getCourseId(), new ArrayList<>());
|
|
@@ -5209,21 +5213,24 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
if(repeatTeacherNums>0){
|
|
if(repeatTeacherNums>0){
|
|
System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
|
|
System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
|
|
courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
|
|
courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
|
|
|
|
+ needAdjustCourseNum++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
-// long repeatStudentNums = cs1.getStudentIds().stream().filter(studentId -> cs2.getStudentIds().contains(studentId)).count();
|
|
|
|
-// if(repeatStudentNums>0){
|
|
|
|
-// System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
|
|
|
|
-// courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
|
|
+ long repeatStudentNums = cs1.getStudentIds().stream().filter(studentId -> cs2.getStudentIds().contains(studentId)).count();
|
|
|
|
+ if(repeatStudentNums>0){
|
|
|
|
+ System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
|
|
|
|
+ courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
|
|
|
|
+ needAdjustCourseNum++;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))||courseRepeatIdMap.get(cs1.getCourseId()).size()==1){
|
|
if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))||courseRepeatIdMap.get(cs1.getCourseId()).size()==1){
|
|
courseRepeatIdMap.remove(cs1.getCourseId());
|
|
courseRepeatIdMap.remove(cs1.getCourseId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
System.out.println("重复课程:" + JSON.toJSONString(courseRepeatIdMap));
|
|
System.out.println("重复课程:" + JSON.toJSONString(courseRepeatIdMap));
|
|
|
|
+ System.out.println("需调整课程数量:" + needAdjustCourseNum);
|
|
System.out.println("重复课程数量:" + courseRepeatIdMap.size());
|
|
System.out.println("重复课程数量:" + courseRepeatIdMap.size());
|
|
}
|
|
}
|
|
}
|
|
}
|