|  | @@ -19,9 +19,11 @@ import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.StudentInfo;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.Goods;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.StudentRegistration;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.Subject;
 | 
	
	
		
			
				|  | @@ -69,6 +71,9 @@ public class ContractServiceImpl implements ContractService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private MusicGroupSubjectGoodsGroupService musicGroupSubjectGoodsGroupService;
 | 
	
	
		
			
				|  | @@ -250,12 +255,18 @@ public class ContractServiceImpl implements ContractService {
 | 
	
		
			
				|  |  |  		if (studentRegistration == null) {
 | 
	
		
			
				|  |  |  			throw new BizException("用户 报名信息不存在");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | -		MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
 | 
	
		
			
				|  |  | -				studentRegistration.getActualSubjectId());
 | 
	
		
			
				|  |  | -		if (musicGroupSubjectPlan == null) {
 | 
	
		
			
				|  |  | -			throw new BizException("声部课程费用设置找不到");
 | 
	
		
			
				|  |  | +		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
 | 
	
		
			
				|  |  | +		if (musicGroupStudentFee == null) {
 | 
	
		
			
				|  |  | +			MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
 | 
	
		
			
				|  |  | +					studentRegistration.getActualSubjectId());
 | 
	
		
			
				|  |  | +			if (musicGroupSubjectPlan == null) {
 | 
	
		
			
				|  |  | +				throw new BizException("声部课程费用设置找不到");
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 | 
	
		
			
				|  |  | +		} else {
 | 
	
		
			
				|  |  | +			params.put("courseFee", musicGroupStudentFee.getTemporaryCourseFee().doubleValue() > 0 ? musicGroupStudentFee.getTemporaryCourseFee().doubleValue()
 | 
	
		
			
				|  |  | +					: musicGroupStudentFee.getCourseFee().doubleValue());
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | -		params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		// 收费形式
 | 
	
		
			
				|  |  |  		List<MusicGroupPaymentCalender> calenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
 | 
	
	
		
			
				|  | @@ -327,12 +338,18 @@ public class ContractServiceImpl implements ContractService {
 | 
	
		
			
				|  |  |  		if (studentRegistration == null) {
 | 
	
		
			
				|  |  |  			throw new BizException("用户 报名信息不存在");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | -		MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
 | 
	
		
			
				|  |  | -				studentRegistration.getActualSubjectId());
 | 
	
		
			
				|  |  | -		if (musicGroupSubjectPlan == null) {
 | 
	
		
			
				|  |  | -			throw new BizException("声部课程费用设置找不到");
 | 
	
		
			
				|  |  | +		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
 | 
	
		
			
				|  |  | +		if (musicGroupStudentFee == null) {
 | 
	
		
			
				|  |  | +			MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
 | 
	
		
			
				|  |  | +					studentRegistration.getActualSubjectId());
 | 
	
		
			
				|  |  | +			if (musicGroupSubjectPlan == null) {
 | 
	
		
			
				|  |  | +				throw new BizException("声部课程费用设置找不到");
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 | 
	
		
			
				|  |  | +		} else {
 | 
	
		
			
				|  |  | +			params.put("courseFee", musicGroupStudentFee.getTemporaryCourseFee().doubleValue() > 0 ? musicGroupStudentFee.getTemporaryCourseFee().doubleValue()
 | 
	
		
			
				|  |  | +					: musicGroupStudentFee.getCourseFee().doubleValue());
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | -		params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		// 收费形式
 | 
	
		
			
				|  |  |  		List<MusicGroupPaymentCalender> calenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
 |