|
@@ -695,11 +695,19 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void delSingle(Integer classGroupId) {
|
|
|
+ ClassGroup classGroup = classGroupDao.get(classGroupId);
|
|
|
+
|
|
|
//删除学员班级关联关系
|
|
|
classGroupStudentMapperDao.deleteByClassId(classGroupId);
|
|
|
studentRegistrationDao.deleteClassGroup(classGroupId);
|
|
|
+
|
|
|
//删除班级跟合奏班关系
|
|
|
- classGroupRelationDao.deleteBySubClassId(classGroupId);
|
|
|
+ if (classGroup.getType().equals(ClassGroupTypeEnum.MIX)) { //合奏班
|
|
|
+ classGroupRelationDao.deleteByClassId(classGroupId);
|
|
|
+ } else {
|
|
|
+ classGroupRelationDao.deleteBySubClassId(classGroupId);
|
|
|
+ }
|
|
|
+
|
|
|
//删除班级未开始课程
|
|
|
List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
|
|
|
if (courseScheduleList.size() > 0) {
|
|
@@ -987,7 +995,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
String subjectIds = subjectList.stream().map(subject -> subject.getId().toString()).collect(Collectors.joining(","));
|
|
|
String subjectNames = subjectList.stream().map(subject -> subject.getName()).collect(Collectors.joining("/"));
|
|
|
|
|
|
- if(classGroup4MixDto.getType() == null){
|
|
|
+ if (classGroup4MixDto.getType() == null) {
|
|
|
classGroup4MixDto.setType(ClassGroupTypeEnum.NORMAL);
|
|
|
}
|
|
|
//1、新建班级
|