|
@@ -1378,6 +1378,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if (newCourseSchedule.getEndClassTime().before(now)) {
|
|
|
newCourseSchedule.setStatus(CourseStatusEnum.OVER);
|
|
|
}
|
|
|
+ if(!CollectionUtils.isEmpty(newCourseSchedule.getTeachingTeacherIdList())){
|
|
|
+ if (newCourseSchedule.getTeachingTeacherIdList().contains(newCourseSchedule.getActualTeacherId())){
|
|
|
+ throw new BizException("主教和助教不可重复");
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
//课程冲突检测
|
|
|
checkNewCourseSchedules(newCourseSchedules, false);
|
|
@@ -1423,16 +1428,21 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
List<Map<Long, Integer>> courseLeaveStudentNumMaps = studentAttendanceDao.countCourseLeaveStudentNumWithFourHoursAgo(newCourseScheduleIds, advanceLeaveHours);
|
|
|
Map<Long,Long> courseLeaveStudentNumMap = MapUtil.convertIntegerMap((courseLeaveStudentNumMaps));
|
|
|
|
|
|
+ List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds, ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ Map<Integer, Long> classGroupStudentNumMap = MapUtil.convertIntegerMap(classGroupStudentNumMaps);
|
|
|
+
|
|
|
newCourseSchedules.forEach(newCourseSchedule -> {
|
|
|
|
|
|
CourseSchedule oldCourseSchedule = oldCourseScheduleMap.get(newCourseSchedule.getId()).get(0);
|
|
|
|
|
|
if (!sysUser.getUserType().contains("SYSTEM") && sysUser.getUserType().contains("TEACHER")) {
|
|
|
+ Long normalStudentNum = classGroupStudentNumMap.get(oldCourseSchedule.getClassGroupId());
|
|
|
Long courseLeaveStudentNum = courseLeaveStudentNumMap.get(newCourseSchedule.getId());
|
|
|
ClassGroup classGroup=idClassGroupMap.get(oldCourseSchedule.getClassGroupId());
|
|
|
if(oldCourseSchedule.getGroupType().equals(GroupType.VIP)
|
|
|
&&Objects.nonNull(courseLeaveStudentNum)
|
|
|
- &&courseLeaveStudentNum.intValue()==classGroup.getExpectStudentNum()){
|
|
|
+ &&Objects.nonNull(normalStudentNum)
|
|
|
+ &&courseLeaveStudentNum.intValue()==normalStudentNum.intValue()){
|
|
|
if(!DateUtil.isSameDay(now,oldCourseSchedule.getStartClassTime())&&now.after(oldCourseSchedule.getStartClassTime())){
|
|
|
throw new BizException("当前时间不可对相关课程进行调整");
|
|
|
}
|