|  | @@ -1071,22 +1071,14 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 | 
	
		
			
				|  |  |              throw new BizException("报名失败,请重试");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          //2、插入关联关系
 | 
	
		
			
				|  |  | -        ClassGroupStudentMapper classGroupStudent = classGroupStudentMapperDao.findClassGroupStudent(classGroup.getId(), userId);
 | 
	
		
			
				|  |  | -        if(Objects.nonNull(classGroupStudent)){
 | 
	
		
			
				|  |  | -            classGroupStudent.setStatus(ClassGroupStudentStatusEnum.NORMAL);
 | 
	
		
			
				|  |  | -            classGroupStudent.setUpdateTime(date);
 | 
	
		
			
				|  |  | -            classGroupStudentMapperDao.update(classGroupStudent);
 | 
	
		
			
				|  |  | -        }else{
 | 
	
		
			
				|  |  | -            classGroupStudent = new ClassGroupStudentMapper();
 | 
	
		
			
				|  |  | -            classGroupStudent.setMusicGroupId(classGroup.getMusicGroupId());
 | 
	
		
			
				|  |  | -            classGroupStudent.setClassGroupId(classGroup.getId());
 | 
	
		
			
				|  |  | -            classGroupStudent.setUserId(userId);
 | 
	
		
			
				|  |  | -            classGroupStudent.setStatus(ClassGroupStudentStatusEnum.NORMAL);
 | 
	
		
			
				|  |  | -            classGroupStudent.setGroupType(groupType);
 | 
	
		
			
				|  |  | -            classGroupStudent.setCreateTime(date);
 | 
	
		
			
				|  |  | -            classGroupStudentMapperDao.insert(classGroupStudent);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +        ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
 | 
	
		
			
				|  |  | +        classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
 | 
	
		
			
				|  |  | +        classGroupStudentMapper.setClassGroupId(classGroup.getId());
 | 
	
		
			
				|  |  | +        classGroupStudentMapper.setUserId(userId);
 | 
	
		
			
				|  |  | +        classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
 | 
	
		
			
				|  |  | +        classGroupStudentMapper.setGroupType(groupType);
 | 
	
		
			
				|  |  | +        classGroupStudentMapper.setCreateTime(date);
 | 
	
		
			
				|  |  | +        classGroupStudentMapperDao.insert(classGroupStudentMapper);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          //3、学生加入级未开始课程
 | 
	
		
			
				|  |  |          List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroup.getId());
 | 
	
	
		
			
				|  | @@ -1234,14 +1226,21 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 | 
	
		
			
				|  |  |              classGroupDao.addStudentNum(classGroup);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              // 2、插入关联关系
 | 
	
		
			
				|  |  | -            ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
 | 
	
		
			
				|  |  | -            classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
 | 
	
		
			
				|  |  | -            classGroupStudentMapper.setClassGroupId(classGroup.getId());
 | 
	
		
			
				|  |  | -            classGroupStudentMapper.setUserId(studentId);
 | 
	
		
			
				|  |  | -            classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
 | 
	
		
			
				|  |  | -            classGroupStudentMapper.setGroupType(classGroup.getGroupType());
 | 
	
		
			
				|  |  | -            classGroupStudentMapper.setCreateTime(date);
 | 
	
		
			
				|  |  | -            classGroupStudentMapperDao.insert(classGroupStudentMapper);
 | 
	
		
			
				|  |  | +            ClassGroupStudentMapper classGroupStudent = classGroupStudentMapperDao.findClassGroupStudent(classGroup.getId(), studentId);
 | 
	
		
			
				|  |  | +            if(Objects.nonNull(classGroupStudent)){
 | 
	
		
			
				|  |  | +                classGroupStudent.setStatus(ClassGroupStudentStatusEnum.NORMAL);
 | 
	
		
			
				|  |  | +                classGroupStudent.setUpdateTime(date);
 | 
	
		
			
				|  |  | +                classGroupStudentMapperDao.update(classGroupStudent);
 | 
	
		
			
				|  |  | +            }else {
 | 
	
		
			
				|  |  | +                ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
 | 
	
		
			
				|  |  | +                classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
 | 
	
		
			
				|  |  | +                classGroupStudentMapper.setClassGroupId(classGroup.getId());
 | 
	
		
			
				|  |  | +                classGroupStudentMapper.setUserId(studentId);
 | 
	
		
			
				|  |  | +                classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
 | 
	
		
			
				|  |  | +                classGroupStudentMapper.setGroupType(classGroup.getGroupType());
 | 
	
		
			
				|  |  | +                classGroupStudentMapper.setCreateTime(date);
 | 
	
		
			
				|  |  | +                classGroupStudentMapperDao.insert(classGroupStudentMapper);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              // 3、学生加入级未开始课程
 | 
	
		
			
				|  |  |              List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroup.getId());
 |