|
@@ -670,7 +670,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
// List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
|
|
// List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
|
|
// List<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
// List<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
Integer classGroupId = classGroup.getId();
|
|
Integer classGroupId = classGroup.getId();
|
|
- ClassGroupRelation classGroupRelation = classGroupRelationService.findClassGroupRelation(classGroupId);
|
|
|
|
|
|
|
|
//校验是否存在历史记录
|
|
//校验是否存在历史记录
|
|
ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId);
|
|
ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId);
|
|
@@ -688,35 +687,32 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
classGroupStudentMapper.setGroupType(GroupType.MUSIC);
|
|
classGroupStudentMapper.setGroupType(GroupType.MUSIC);
|
|
classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
}
|
|
}
|
|
- ClassGroupStudentMapper classGroupStudentMapperMix = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupRelation.getClassGroupId());
|
|
|
|
- if(classGroupStudentMapperMix != null){
|
|
|
|
- classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
- classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId());
|
|
|
|
- classGroupStudentMapperDao.update(classGroupStudentMapperMix);
|
|
|
|
- }else {
|
|
|
|
- classGroupStudentMapperMix = new ClassGroupStudentMapper();
|
|
|
|
- classGroupStudentMapperMix.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
|
- classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId());
|
|
|
|
- classGroupStudentMapperMix.setUserId(userId);
|
|
|
|
- classGroupStudentMapperMix.setCreateTime(nowDate);
|
|
|
|
- classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
- classGroupStudentMapperMix.setGroupType(GroupType.MUSIC);
|
|
|
|
- classGroupStudentMapperDao.insert(classGroupStudentMapperMix);
|
|
|
|
- }
|
|
|
|
-// imGroupMemberList.add(new ImGroupMember(userId.toString()));
|
|
|
|
|
|
+
|
|
//添加进IM群组
|
|
//添加进IM群组
|
|
ImGroupMember[] imGroupMembers = {new ImGroupMember(userId.toString())};
|
|
ImGroupMember[] imGroupMembers = {new ImGroupMember(userId.toString())};
|
|
imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
|
|
imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
|
|
-
|
|
|
|
//2、班级人数调整
|
|
//2、班级人数调整
|
|
classGroupDao.updateClassStudentNum(classGroupId.longValue(), 1);
|
|
classGroupDao.updateClassStudentNum(classGroupId.longValue(), 1);
|
|
-
|
|
|
|
//3、学生加入新班级未开始课程
|
|
//3、学生加入新班级未开始课程
|
|
List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
|
|
List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
|
|
|
|
|
|
- //4、班级在合奏班、添加合奏课程
|
|
|
|
- if (classGroupRelation != null) {
|
|
|
|
- //合奏班增加人数
|
|
|
|
|
|
+ ClassGroupRelation classGroupRelation = classGroupRelationService.findClassGroupRelation(classGroupId);
|
|
|
|
+ if(classGroupRelation != null){
|
|
|
|
+ ClassGroupStudentMapper classGroupStudentMapperMix = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupRelation.getClassGroupId());
|
|
|
|
+ if(classGroupStudentMapperMix != null){
|
|
|
|
+ classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
+ classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId());
|
|
|
|
+ classGroupStudentMapperDao.update(classGroupStudentMapperMix);
|
|
|
|
+ }else {
|
|
|
|
+ classGroupStudentMapperMix = new ClassGroupStudentMapper();
|
|
|
|
+ classGroupStudentMapperMix.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
|
+ classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId());
|
|
|
|
+ classGroupStudentMapperMix.setUserId(userId);
|
|
|
|
+ classGroupStudentMapperMix.setCreateTime(nowDate);
|
|
|
|
+ classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
+ classGroupStudentMapperMix.setGroupType(GroupType.MUSIC);
|
|
|
|
+ classGroupStudentMapperDao.insert(classGroupStudentMapperMix);
|
|
|
|
+ }
|
|
classGroupDao.updateClassStudentNum(classGroupRelation.getClassGroupId().longValue(), 1);
|
|
classGroupDao.updateClassStudentNum(classGroupRelation.getClassGroupId().longValue(), 1);
|
|
List<CourseSchedule> mixCourseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupRelation.getClassGroupId());
|
|
List<CourseSchedule> mixCourseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupRelation.getClassGroupId());
|
|
courseScheduleList.addAll(mixCourseScheduleList);
|
|
courseScheduleList.addAll(mixCourseScheduleList);
|