|  | @@ -897,7 +897,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  	public void createVipGroupCourseScheInfo(Long vipGroupId,ClassGroup classGroup){
 | 
	
		
			
				|  |  |  		VipGroup vipGroupApplyBaseInfoDto = vipGroupDao.get(vipGroupId);
 | 
	
		
			
				|  |  |  		List<CourseSchedule> courseSchedules = JSON.parseArray(vipGroupApplyBaseInfoDto.getCourseSchedulesJson(),CourseSchedule.class);
 | 
	
		
			
				|  |  | -		courseScheduleService.batchAddCourseSchedule(courseSchedules);
 | 
	
		
			
				|  |  | +		int courseNum = courseScheduleDao.countVipGroupCourses(vipGroupId.intValue());
 | 
	
		
			
				|  |  | +		if(courseNum==0){
 | 
	
		
			
				|  |  | +			courseScheduleService.batchAddCourseSchedule(courseSchedules);
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		SysUser sysUser = sysUserFeignService.queryUserById(vipGroupApplyBaseInfoDto.getUserId());
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1621,6 +1624,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  			throw new BizException("班级不存在");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		if(!vipGroup.getStatus().equals(VipGroupStatusEnum.PROGRESS)){
 | 
	
		
			
				|  |  | +			throw new BizException("此状态的vip课程不支持加课");
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		Date now=new Date();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		BigDecimal onlineCoursePrice = courseScheduleStudentPaymentDao.findVipGroupCoursePrice(vipGroup.getId().intValue(),TeachModeEnum.ONLINE.getCode());
 | 
	
	
		
			
				|  | @@ -1737,6 +1744,22 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		Date now=new Date();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
 | 
	
		
			
				|  |  | +			List<CourseSchedule> courseSchedules = JSON.parseArray(vipGroup.getCourseSchedulesJson(),CourseSchedule.class);
 | 
	
		
			
				|  |  | +			int courseNum = courseScheduleDao.countVipGroupCourses(vipGroupId.intValue());
 | 
	
		
			
				|  |  | +			if(courseNum==0){
 | 
	
		
			
				|  |  | +				courseScheduleService.batchAddCourseSchedule(courseSchedules);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +				ClassGroupTeacherSalary classGroupTeacherSalary = classGroupTeacherSalaryDao.findByVipGoupAndTeacher(vipGroupId.intValue(), vipGroup.getUserId());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +				//创建老师单节课课酬信息
 | 
	
		
			
				|  |  | +				courseScheduleTeacherSalaryService.createCourseScheduleTeacherVipSalary(vipGroup,
 | 
	
		
			
				|  |  | +						courseSchedules,
 | 
	
		
			
				|  |  | +						classGroupTeacherSalary.getOnlineClassesSalary(),
 | 
	
		
			
				|  |  | +						classGroupTeacherSalary.getSalary());
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		List<CourseSchedule> surplusCourses = courseScheduleDao.findByClassGroupAndStatus(classGroup.getId(), CourseStatusEnum.NOT_START.getCode());
 | 
	
		
			
				|  |  |  		if(CollectionUtils.isEmpty(surplusCourses)){
 | 
	
		
			
				|  |  |  			throw new BizException("此vip课程没有剩余课程计划");
 | 
	
	
		
			
				|  | @@ -1811,6 +1834,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  			classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
 | 
	
		
			
				|  |  | +		vipGroupDao.update(vipGroup);
 | 
	
		
			
				|  |  |  		classGroupService.updateClassGroupInfo(classGroup.getId());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		try {
 |