Forráskód Böngészése

1、课程冲突检测优化

Joburgess 5 éve
szülő
commit
a629ebcd5f

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -386,6 +386,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				.map(CourseSchedule::getId)
 				.collect(Collectors.toList());
 
+		HashSet<Long> courseScheduleIdsSet = new HashSet<>(existCourseScheduleIds);
+
 		//合并新课程和已存在的课程
 		List<CourseSchedule> allCourseSchedules;
 		if(!CollectionUtils.isEmpty(existCourseSchedules)){
@@ -432,8 +434,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                     //判断前后两节课是否存在冲突
                     if(backCourseSchedule.getStartClassTime().before(preCourseSchedule.getEndClassTime())){
 						if(!checkExistCourseSchedule
-								&&existCourseScheduleIds.contains(preCourseSchedule.getId())
-								&&existCourseScheduleIds.contains(backCourseSchedule.getId())){
+								&&courseScheduleIdsSet.contains(preCourseSchedule.getId())
+								&&courseScheduleIdsSet.contains(backCourseSchedule.getId())){
 							if(j==repeatTimes){
 								repeatTimes+=1;
 							}

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1624,7 +1624,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("班级不存在");
 		}
 
-		if(!vipGroup.getStatus().equals(VipGroupStatusEnum.PROGRESS)){
+		if(!vipGroup.getStatus().equals(VipGroupStatusEnum.PROGRESS)
+			&&!vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING_END)){
 			throw new BizException("此状态的vip课程不支持加课");
 		}