|
@@ -1874,13 +1874,18 @@ 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();
|
|
|
}
|
|
|
List<String> classDates = courseSchedules.stream().map(courseSchedule -> DateUtil.dateToString(courseSchedule.getClassDate(), "yyyy-MM-dd"))
|
|
|
.collect(Collectors.toList());
|
|
|
-
|
|
|
- List<CourseSchedule> existCourseSchedules = courseScheduleDao.findByClassDate(classDates, TenantContextHolder.getTenantId());
|
|
|
+ List<CourseSchedule> existCourseSchedules;
|
|
|
+ if(Objects.nonNull(classGroupStudentMapper)){
|
|
|
+ existCourseSchedules = courseScheduleDao.findByClassDateAndStu(classDates, TenantContextHolder.getTenantId(),classGroupStudentMapper.getUserId());
|
|
|
+ }else {
|
|
|
+ existCourseSchedules = courseScheduleDao.findByClassDate(classDates, TenantContextHolder.getTenantId());
|
|
|
+ }
|
|
|
|
|
|
//只需要调整课程信息的课程编号列表
|
|
|
List<Long> updateCourseScheduleIds = courseSchedules
|
|
@@ -1928,17 +1933,14 @@ 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));
|