| 
					
				 | 
			
			
				@@ -1271,8 +1271,62 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(vipGroupId.intValue(),-1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//		classGroup.setStudentNum(classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//		classGroupDao.update(classGroup); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//学员退出班级群 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		ImGroupMember[] imGroupMembers = new ImGroupMember[]{new ImGroupMember(studentId.toString())}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, null)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	public void quitForStudent(Long vipGroupId, Integer studentId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if(Objects.isNull(vipGroupId)||Objects.isNull(studentId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			throw new BizException("请指定小课与学生"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		VipGroup vipGroup=vipGroupDao.get(vipGroupId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if(Objects.isNull(vipGroup)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			throw new BizException("指定的课程不存在"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			throw new BizException("不能对已停止的课程进行此操作"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if(vipGroup.getStatus().equals(VipGroupStatusEnum.FINISHED)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			throw new BizException("此课程已结束"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), GroupType.VIP.getCode(), studentId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if(!CollectionUtils.isEmpty(studentApplyRefunds)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			throw new BizException("此学生存在退课申请,请到系统日志中查看"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				studentId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if(Objects.isNull(classStudentMapperByUserIdAndClassGroupId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			throw new BizException("指定学生不在此课程中"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if(classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			throw new BizException("当前学生已经退学"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if(classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			throw new BizException("当前学生已是休学状态"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//		sysUserCashAccountService.updateBalance(studentId, amount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT_SCHOOL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		courseScheduleService.batchDeleteMusicGroupCourseWithStudent(vipGroupId.toString(),studentId,GroupType.VIP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Integer> studentPaymentIds = courseScheduleStudentPaymentDao.findNotStartCourseStudentPaymentIdsWithClassGroupAndStudent(classGroup.getId(), studentId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if(!CollectionUtils.isEmpty(studentPaymentIds)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(vipGroupId.intValue(),-1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		//学员退出班级群 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		ImGroupMember[] imGroupMembers = new ImGroupMember[]{new ImGroupMember(studentId.toString())}; 
			 |