|
@@ -1418,6 +1418,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
//删除班级未开始课程
|
|
|
List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
|
|
|
if (courseScheduleList.size() > 0) {
|
|
|
+ List<CourseSchedule> courseSchedules = courseScheduleDao.queryPreCourseListByClassGroupId(classGroupId);
|
|
|
+ if(courseSchedules.size() > 0){
|
|
|
+ throw new BizException("操作失败:该班级存在预排课程");
|
|
|
+ }
|
|
|
List<Long> courseScheduleIds = courseScheduleList.stream().map(courseSchedule -> courseSchedule.getId()).collect(Collectors.toList());
|
|
|
courseScheduleDao.batchDeleteCourseSchedules(courseScheduleIds);
|
|
|
courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
|
|
@@ -1441,6 +1445,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
//删除班级未开始课程
|
|
|
List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
|
|
|
if (courseScheduleList.size() > 0) {
|
|
|
+ List<CourseSchedule> courseSchedules = courseScheduleDao.queryPreCourseListByClassGroupId(classGroupId);
|
|
|
+ if(courseSchedules.size() > 0){
|
|
|
+ throw new BizException("操作失败:该班级存在预排课程");
|
|
|
+ }
|
|
|
List<Long> courseScheduleIds = courseScheduleList.stream().map(courseSchedule -> courseSchedule.getId()).collect(Collectors.toList());
|
|
|
courseScheduleDao.batchDeleteCourseSchedules(courseScheduleIds);
|
|
|
courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
|