|
@@ -625,21 +625,42 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
String musicGroupId = courseScheduleList.get(0).getMusicGroupId();
|
|
|
|
|
|
// 批量删课
|
|
|
- batchDeleteCourseSchedules(batchInsertCoursesDto.getCourseScheduleIdList());
|
|
|
-
|
|
|
+ List<Long> courseScheduleIds = batchInsertCoursesDto.getCourseScheduleIdList();
|
|
|
+
|
|
|
+ // 学生已点名不能调整(请假可以调整)
|
|
|
+ for (Long courseScheduleId : courseScheduleIds) {
|
|
|
+ List<StudentAttendance> studentAttendanceList = studentAttendanceDao.findByCourseId(courseScheduleId);
|
|
|
+
|
|
|
+ for (StudentAttendance studentAttendance : studentAttendanceList) {
|
|
|
+ if (studentAttendance.getStatus() != null && studentAttendance.getStatus() != StudentAttendanceStatusEnum.LEAVE) {
|
|
|
+ throw new BizException("操作失败,存在已点名课程");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ courseScheduleDao.batchDeleteAllCourseSchedules(courseScheduleIds);
|
|
|
+ courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
|
|
|
+ courseScheduleStudentPaymentDao.deleteByCourseSchedule(courseScheduleIds);
|
|
|
+ // 删除考勤
|
|
|
+ teacherAttendanceDao.batchDeleteByCourseSchedules(courseScheduleIds);
|
|
|
+ studentAttendanceDao.deleteByCourseSchedules(courseScheduleIds);
|
|
|
+
|
|
|
+ // 删除作业
|
|
|
+ courseHomeworkService.delHomwworkByCourseScheduleId(courseScheduleIds);
|
|
|
+
|
|
|
Date endDate = null;
|
|
|
Date startDate = null;
|
|
|
- if(batchInsertCoursesDto.getType() == CourseScheduleType.PRACTICE){
|
|
|
+ if (batchInsertCoursesDto.getType() == CourseScheduleType.PRACTICE) {
|
|
|
PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(musicGroupId));
|
|
|
- if(practiceGroup == null){
|
|
|
- throw new BizException("找不到课程组[{}]信息",musicGroupId);
|
|
|
+ if (practiceGroup == null) {
|
|
|
+ throw new BizException("找不到课程组[{}]信息", musicGroupId);
|
|
|
}
|
|
|
endDate = practiceGroup.getCoursesExpireDate();
|
|
|
startDate = practiceGroup.getCoursesStartDate();
|
|
|
}
|
|
|
|
|
|
// 批量加课
|
|
|
- batchAddCourseSchedule(classGroupId, batchInsertCoursesDto.getCourseScheduleIdList().size(), batchInsertCoursesDto.getStartDate(), endDate,startDate,
|
|
|
+ batchAddCourseSchedule(classGroupId, batchInsertCoursesDto.getCourseScheduleIdList().size(), batchInsertCoursesDto.getStartDate(), endDate, startDate,
|
|
|
batchInsertCoursesDto.getTeachingArrangementList(), batchInsertCoursesDto.getTeachMode(), batchInsertCoursesDto.getType(),
|
|
|
batchInsertCoursesDto.getSchoolId(), batchInsertCoursesDto.getIsJumpHoliday());
|
|
|
return true;
|