浏览代码

针对直播课的冲突校验更改

zouxuan 2 年之前
父节点
当前提交
f35a05f5df
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

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

@@ -1874,7 +1874,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 	@Transactional(rollbackFor = Exception.class)
     public HttpResponseResult checkCourseSchedules(List<CourseSchedule> courseSchedules, boolean checkExistCourseSchedule,Boolean postponeFlag,ClassGroupStudentMapper classGroupStudentMapper) {
-
 		if (CollectionUtils.isEmpty(courseSchedules)) {
 			return BaseController.failed();
 		}
@@ -1929,14 +1928,17 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				.distinct()
 				.collect(Collectors.toList());
 		//班级与学生的关联记录
-		List<ClassGroupStudentMapper> classGroupStudentMappers = classGroupStudentMapperDao.findByClassGroups(classGroupIds);
 		Boolean liveFlag = false;
+		List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
 		if(Objects.nonNull(classGroupStudentMapper)){
 			classGroupStudentMappers.add(classGroupStudentMapper);
 			if(classGroupStudentMapper.getGroupType() == LIVE){
 				liveFlag = true;
 			}
+		}else {
+			classGroupStudentMappers = classGroupStudentMapperDao.findByClassGroups(classGroupIds);
 		}
+
 		Map<Integer, List<ClassGroupStudentMapper>> classGroupStudentsMap = classGroupStudentMappers
 				.stream()
 				.collect(Collectors.groupingBy(ClassGroupStudentMapper::getClassGroupId));