|  | @@ -590,10 +590,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |          vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		//如果默认课酬与实际课酬不匹配则需要审批
 | 
	
		
			
				|  |  | -		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary()) < 0
 | 
	
		
			
				|  |  | -			&& StringUtils.isBlank(studentIds)){
 | 
	
		
			
				|  |  | -			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
 | 
	
		
			
				|  |  | -		}
 | 
	
		
			
				|  |  | +//		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary()) < 0
 | 
	
		
			
				|  |  | +//			&& StringUtils.isBlank(studentIds)){
 | 
	
		
			
				|  |  | +//			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
 | 
	
		
			
				|  |  | +//		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.get("totalPrice"));
 | 
	
		
			
				|  |  |  		if(StringUtils.isNotBlank(studentIds)){
 | 
	
	
		
			
				|  | @@ -978,7 +978,15 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  			//计算课程相关费用信息
 | 
	
		
			
				|  |  |  			Map<String, BigDecimal> costInfo = countVipGroupPredictFee1(vipGroupApplyBaseInfoDto,
 | 
	
		
			
				|  |  |  					vipGroupApplyBaseInfoDto.getUserId(), null);
 | 
	
		
			
				|  |  | -			vipGroupApplyBaseInfoDto.setOfflineTeacherSalary(costInfo.get("offlineTeacherSalary"));
 | 
	
		
			
				|  |  | +			BigDecimal teacherSalary = costInfo.get("offlineTeacherSalary");
 | 
	
		
			
				|  |  | +			//是否是赠送课程
 | 
	
		
			
				|  |  | +			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroupApplyBaseInfoDto.getId(),"VIP");
 | 
	
		
			
				|  |  | +			if(activityUserMapper != null){
 | 
	
		
			
				|  |  | +				if(vipGroupApplyBaseInfoDto.getId().equals(activityUserMapper.getGiveVipGroupId())){
 | 
	
		
			
				|  |  | +					teacherSalary = costInfo.get("giveOfflineTeacherSalary");
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			vipGroupApplyBaseInfoDto.setOfflineTeacherSalary(teacherSalary);
 | 
	
		
			
				|  |  |  			vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.get("totalPrice"));
 | 
	
		
			
				|  |  |  		}else{
 | 
	
		
			
				|  |  |  			vipGroupApplyBaseInfoDto.setOfflineTeacherSalary(BigDecimal.ZERO);
 | 
	
	
		
			
				|  | @@ -3341,11 +3349,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +			BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
 | 
	
		
			
				|  |  | +			//是否是赠送课程
 | 
	
		
			
				|  |  | +			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
 | 
	
		
			
				|  |  | +			if(activityUserMapper != null){
 | 
	
		
			
				|  |  | +				if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 | 
	
		
			
				|  |  | +					teacherSalary = salaryMap.get("giveOfflineTeacherSalary");
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  |  			//创建老师单节课课酬信息
 | 
	
		
			
				|  |  |  			courseScheduleTeacherSalaryService.createCourseScheduleTeacherVipSalary(vipGroup,
 | 
	
		
			
				|  |  | -					newCourseSchedules,
 | 
	
		
			
				|  |  | -					salaryMap.get("offlineTeacherSalary"));
 | 
	
		
			
				|  |  | +					newCourseSchedules,teacherSalary);
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		BigDecimal surplusCourseFee = new BigDecimal(0);
 | 
	
	
		
			
				|  | @@ -4001,11 +4015,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  		courseScheduleService.batchAddCourseSchedule(vipGroupApplyDto.getCourseSchedules());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		Map<String, BigDecimal> map = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -		BigDecimal offlineTeacherSalary = ZERO;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -		if(Objects.nonNull(map)){
 | 
	
		
			
				|  |  | -			offlineTeacherSalary = map.get("offlineTeacherSalary");
 | 
	
		
			
				|  |  | +		BigDecimal offlineTeacherSalary = map.get("offlineTeacherSalary");
 | 
	
		
			
				|  |  | +		//是否是赠送课程
 | 
	
		
			
				|  |  | +		ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
 | 
	
		
			
				|  |  | +		if(activityUserMapper != null){
 | 
	
		
			
				|  |  | +			if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 | 
	
		
			
				|  |  | +				offlineTeacherSalary = map.get("giveOfflineTeacherSalary");
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		if(Objects.isNull(offlineTeacherSalary)){
 | 
	
	
		
			
				|  | @@ -4143,11 +4159,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  				courseScheduleService.batchAddCourseSchedule(courseSchedules);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  				Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 | 
	
		
			
				|  |  | +				BigDecimal offlineTeacherSalary = salaryMap.get("offlineTeacherSalary");
 | 
	
		
			
				|  |  | +				//是否是赠送课程
 | 
	
		
			
				|  |  | +				ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
 | 
	
		
			
				|  |  | +				if(activityUserMapper != null){
 | 
	
		
			
				|  |  | +					if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 | 
	
		
			
				|  |  | +						offlineTeacherSalary = salaryMap.get("giveOfflineTeacherSalary");
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  				//创建老师单节课课酬信息
 | 
	
		
			
				|  |  |  				courseScheduleTeacherSalaryService.createCourseScheduleTeacherVipSalary(vipGroup,
 | 
	
		
			
				|  |  | -						courseSchedules,
 | 
	
		
			
				|  |  | -						salaryMap.get("offlineTeacherSalary"));
 | 
	
		
			
				|  |  | +						courseSchedules,offlineTeacherSalary);
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |              userRoleMap.put(vipGroup.getUserId(), "指导老师");
 | 
	
		
			
				|  |  |              
 |