|
@@ -222,7 +222,33 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
+ @Override
|
|
|
+ public void batchDeleteCourseSchedulesWithoutCheck(List<CourseSchedule> courseScheduleList) {
|
|
|
+ if(CollectionUtils.isEmpty(courseScheduleList)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<Long> courseScheduleIds = courseScheduleList.stream().map(CourseSchedule::getId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ courseScheduleDao.batchDeleteCourseSchedules(courseScheduleIds);
|
|
|
+ courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
|
|
|
+ courseScheduleStudentPaymentDao.deleteByCourseSchedule(courseScheduleIds);
|
|
|
+ // 删除考勤
|
|
|
+ teacherAttendanceDao.batchDeleteByCourseSchedules(courseScheduleIds);
|
|
|
+ studentAttendanceDao.deleteByCourseSchedules(courseScheduleIds);
|
|
|
+
|
|
|
+ // 删除作业
|
|
|
+ courseHomeworkService.delHomwworkByCourseScheduleId(courseScheduleIds);
|
|
|
+
|
|
|
+ List<Integer> classGroupIdList = courseScheduleList.stream().map(t -> t.getClassGroupId()).collect(Collectors.toList());
|
|
|
+ // 更新班级信息
|
|
|
+ if (classGroupIdList != null && classGroupIdList.size() > 0) {
|
|
|
+ for (Integer classGroupId : classGroupIdList) {
|
|
|
+ classGroupService.updateClassGroupInfo(classGroupId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void batchDeleteMusicGroupNotStartCourse(String musicGroupId, GroupType groupType) {
|
|
|
if (StringUtils.isBlank(musicGroupId)) {
|
|
@@ -247,10 +273,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if (CollectionUtils.isEmpty(musicGroupCourseSchedules)) {
|
|
|
throw new BizException("此乐团不存在未上课程");
|
|
|
}
|
|
|
- List<Long> courseScheduleIds = musicGroupCourseSchedules.stream()
|
|
|
- .map(CourseSchedule::getId)
|
|
|
- .collect(Collectors.toList());
|
|
|
- batchDeleteCourseSchedules(courseScheduleIds);
|
|
|
+ batchDeleteCourseSchedulesWithoutCheck(musicGroupCourseSchedules);
|
|
|
}
|
|
|
|
|
|
@Override
|