|
@@ -1873,9 +1873,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Boolean checkCourseSchedules(List<CourseSchedule> courseSchedules, boolean checkExistCourseSchedule,Boolean postponeFlag,ClassGroupStudentMapper classGroupStudentMapper) {
|
|
|
+ public HttpResponseResult checkCourseSchedules(List<CourseSchedule> courseSchedules, boolean checkExistCourseSchedule,Boolean postponeFlag,ClassGroupStudentMapper classGroupStudentMapper) {
|
|
|
if (CollectionUtils.isEmpty(courseSchedules)) {
|
|
|
- return false;
|
|
|
+ return BaseController.failed();
|
|
|
}
|
|
|
List<String> classDates = courseSchedules.stream().map(courseSchedule -> DateUtil.dateToString(courseSchedule.getClassDate(), "yyyy-MM-dd"))
|
|
|
.collect(Collectors.toList());
|
|
@@ -1929,8 +1929,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
.collect(Collectors.toList());
|
|
|
//班级与学生的关联记录
|
|
|
List<ClassGroupStudentMapper> classGroupStudentMappers = classGroupStudentMapperDao.findByClassGroups(classGroupIds);
|
|
|
+ Boolean liveFlag = false;
|
|
|
if(Objects.nonNull(classGroupStudentMapper)){
|
|
|
classGroupStudentMappers.add(classGroupStudentMapper);
|
|
|
+ if(classGroupStudentMapper.getGroupType() == LIVE){
|
|
|
+ liveFlag = true;
|
|
|
+ }
|
|
|
}
|
|
|
Map<Integer, List<ClassGroupStudentMapper>> classGroupStudentsMap = classGroupStudentMappers
|
|
|
.stream()
|
|
@@ -1990,16 +1994,15 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if (Objects.nonNull(preCourseSchedule.getActualTeacherId())
|
|
|
&& preCourseSchedule.getActualTeacherId().equals(backCourseSchedule.getActualTeacherId())) {
|
|
|
if(postponeFlag){
|
|
|
- return false;
|
|
|
+ return BaseController.failed();
|
|
|
}else {
|
|
|
+ if(liveFlag){
|
|
|
+ return BaseController.failed(HttpStatus.CHECKPOINT,
|
|
|
+ courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 1) + ",是否继续购买");
|
|
|
+ }
|
|
|
throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 1));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// if(Objects.isNull(preCourseSchedule.getId())){
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-
|
|
|
//助教冲突检测
|
|
|
List<Integer> preTeachingTeacherIdList = new ArrayList<>();
|
|
|
List<Integer> backTeachingTeacherIdList = new ArrayList<>();
|
|
@@ -2039,8 +2042,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
.collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(repeatIds)) {
|
|
|
if(postponeFlag){
|
|
|
- return false;
|
|
|
+ return BaseController.failed();
|
|
|
}else {
|
|
|
+ if(liveFlag){
|
|
|
+ return BaseController.failed(HttpStatus.CHECKPOINT,
|
|
|
+ courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 2) + ",是否继续购买");
|
|
|
+ }
|
|
|
throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 2));
|
|
|
}
|
|
|
}
|
|
@@ -2049,8 +2056,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if (preCourseSchedule.getClassGroupId().equals(backCourseSchedule.getClassGroupId())) {
|
|
|
//如果班级相同,则学生肯定存在冲突
|
|
|
if(postponeFlag){
|
|
|
- return false;
|
|
|
+ return BaseController.failed();
|
|
|
}else {
|
|
|
+ if(liveFlag){
|
|
|
+ return BaseController.failed(HttpStatus.CHECKPOINT,
|
|
|
+ courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3) + ",是否继续购买");
|
|
|
+ }
|
|
|
throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3));
|
|
|
}
|
|
|
}
|
|
@@ -2088,8 +2099,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
.collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(repeatStudentIds)) {
|
|
|
if(postponeFlag){
|
|
|
- return false;
|
|
|
+ return BaseController.failed();
|
|
|
}else {
|
|
|
+ if(liveFlag){
|
|
|
+ return BaseController.failed(HttpStatus.CHECKPOINT,
|
|
|
+ courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3) + ",是否继续购买");
|
|
|
+ }
|
|
|
throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3));
|
|
|
}
|
|
|
}
|
|
@@ -2097,18 +2112,18 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return true;
|
|
|
+ return BaseController.succeed();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Boolean checkNewCourseSchedules(List<CourseSchedule> courseSchedules, boolean checkExistCourseSchedule,Boolean postponeFlag,ClassGroupStudentMapper classGroupStudentMapper) {
|
|
|
+ public HttpResponseResult checkNewCourseSchedules(List<CourseSchedule> courseSchedules, boolean checkExistCourseSchedule,Boolean postponeFlag,ClassGroupStudentMapper classGroupStudentMapper) {
|
|
|
return this.checkCourseSchedules(courseSchedules,checkExistCourseSchedule,postponeFlag,classGroupStudentMapper);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Boolean checkNewCourseSchedules(List<CourseSchedule> courseSchedules, boolean checkExistCourseSchedule,Boolean postponeFlag) {
|
|
|
+ public HttpResponseResult checkNewCourseSchedules(List<CourseSchedule> courseSchedules, boolean checkExistCourseSchedule,Boolean postponeFlag) {
|
|
|
return this.checkCourseSchedules(courseSchedules,checkExistCourseSchedule,postponeFlag,null);
|
|
|
}
|
|
|
|