|  | @@ -198,10 +198,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |          String studentIds=vipGroup.getStudentIds();
 | 
	
		
			
				|  |  |  		List<String> studentIdList=new ArrayList<>();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if(StringUtils.isNotBlank(studentIds)){
 | 
	
		
			
				|  |  | -			studentIdList = Arrays.asList(studentIds.split(","));
 | 
	
		
			
				|  |  | -		}
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          Date now=new Date();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto=vipGroup.getVipGroupApplyBaseInfo();
 | 
	
	
		
			
				|  | @@ -243,6 +239,15 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		//获取活动信息
 | 
	
		
			
				|  |  |  		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId());
 | 
	
		
			
				|  |  | +		if(Objects.nonNull(vipGroupActivity)&&Objects.nonNull(vipGroupActivity.getStudentMaxUsedTimes())&&StringUtils.isNotBlank(studentIds)){
 | 
	
		
			
				|  |  | +			studentIdList = Arrays.asList(studentIds.split(","));
 | 
	
		
			
				|  |  | +			for (String studentIdStr : studentIdList) {
 | 
	
		
			
				|  |  | +				int useNum = vipGroupDao.countStudentUserActivityNum(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId(), Integer.valueOf(studentIdStr));
 | 
	
		
			
				|  |  | +				if(useNum>=vipGroupActivity.getStudentMaxUsedTimes()){
 | 
	
		
			
				|  |  | +					throw new BizException("创建失败:当前活动可购买次数为{}次", vipGroupActivity.getStudentMaxUsedTimes());
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  |  		//判断课程安排是否超出范围
 | 
	
		
			
				|  |  |  		if(Objects.nonNull(vipGroupActivity)&&(Objects.nonNull(vipGroupActivity.getCoursesEndTime())||Objects.nonNull(vipGroupActivity.getCoursesStartTime()))){
 | 
	
		
			
				|  |  |  			if(latestCourseSchedule.getEndClassTime().after(vipGroupActivity.getCoursesEndTime())
 | 
	
	
		
			
				|  | @@ -1492,7 +1497,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          VipGroup vipGroup = vipGroupDao.get(vipGroupBuyParams.getVipGroupId());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  		if(classGroup.getStudentNum()>0&&(VipGroupStatusEnum.APPLYING.equals(vipGroup.getStatus()))){
 | 
	
		
			
				|  |  |  			int i = studentPaymentOrderDao.countGroupOrderWithoutFailed(vipGroupBuyParams.getVipGroupId().toString(), GroupType.VIP);
 | 
	
		
			
				|  |  |  			if(i<=0){
 | 
	
	
		
			
				|  | @@ -1500,6 +1504,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		VipGroupActivity vipGroupActivity = null;
 | 
	
		
			
				|  |  | +		if(Objects.nonNull(vipGroup.getVipGroupActivityId())){
 | 
	
		
			
				|  |  | +			vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId().intValue());
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if(Objects.nonNull(vipGroupActivity)&&Objects.nonNull(vipGroupActivity.getStudentMaxUsedTimes())){
 | 
	
		
			
				|  |  | +			int useNum = vipGroupDao.countStudentUserActivityNum(vipGroup.getVipGroupActivityId(), Integer.valueOf(user.getId()));
 | 
	
		
			
				|  |  | +			if(useNum>=vipGroupActivity.getStudentMaxUsedTimes()){
 | 
	
		
			
				|  |  | +				throw new BizException("创建失败:当前活动可购买次数为{}次", vipGroupActivity.getStudentMaxUsedTimes());
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		if(vipGroup.getPaymentExpireDate().before(date)){
 | 
	
		
			
				|  |  |  			throw new BizException("该课程已结束报名!");
 | 
	
		
			
				|  |  |  		}
 | 
	
	
		
			
				|  | @@ -2885,6 +2901,20 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  			throw new BizException("选择的学生中存在此课程中已存在的学生");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		VipGroupActivity vipGroupActivity = null;
 | 
	
		
			
				|  |  | +		if(Objects.nonNull(vipGroup.getVipGroupActivityId())){
 | 
	
		
			
				|  |  | +			vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId().intValue());
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if(Objects.nonNull(vipGroupActivity)&&Objects.nonNull(vipGroupActivity.getStudentMaxUsedTimes())&&!CollectionUtils.isEmpty(studentIds)){
 | 
	
		
			
				|  |  | +			for (Integer studentId : studentIds) {
 | 
	
		
			
				|  |  | +				int useNum = vipGroupDao.countStudentUserActivityNum(vipGroup.getVipGroupActivityId(), Integer.valueOf(studentId));
 | 
	
		
			
				|  |  | +				if(useNum>=vipGroupActivity.getStudentMaxUsedTimes()){
 | 
	
		
			
				|  |  | +					throw new BizException("创建失败:当前活动可购买次数为{}次", vipGroupActivity.getStudentMaxUsedTimes());
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		Date now=new Date();
 | 
	
		
			
				|  |  |          Map<Integer,String> userRoleMap = new HashMap<Integer, String>();
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -2965,11 +2995,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  			return;
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		VipGroupActivity vipGroupActivity = null;
 | 
	
		
			
				|  |  | -		if(Objects.nonNull(vipGroup.getVipGroupActivityId())){
 | 
	
		
			
				|  |  | -			vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId().intValue());
 | 
	
		
			
				|  |  | -		}
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  		BigDecimal surplusCoursesPrice=new BigDecimal(0);
 | 
	
		
			
				|  |  |  		boolean hasGiveClass=false;
 | 
	
		
			
				|  |  |  		int onlineCourseTimes=0,
 |