|  | @@ -20,6 +20,8 @@ import org.springframework.util.CollectionUtils;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.math.BigDecimal;
 | 
	
		
			
				|  |  |  import java.util.*;
 | 
	
		
			
				|  |  | +import java.util.function.BiFunction;
 | 
	
		
			
				|  |  | +import java.util.function.BinaryOperator;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
 | 
	
	
		
			
				|  | @@ -171,7 +173,33 @@ public class MusicGroupPaymentCalenderCourseSettingsServiceImpl extends BaseServ
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Override
 | 
	
		
			
				|  |  |  	public BigDecimal getCurrentAmount(MusicGroupPaymentBaseCalender baseCalender) {
 | 
	
		
			
				|  |  | -		return this.getActualAmount(baseCalender);
 | 
	
		
			
				|  |  | +		BigDecimal totalAmount = BigDecimal.ZERO;
 | 
	
		
			
				|  |  | +		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = baseCalender.getMusicGroupPaymentCalenderCourseSettingsList();
 | 
	
		
			
				|  |  | +		if(musicGroupPaymentCalenderCourseSettingsList != null && musicGroupPaymentCalenderCourseSettingsList.size() > 0){
 | 
	
		
			
				|  |  | +			if (baseCalender.getPaymentType() == MUSIC_APPLY || baseCalender.getPaymentType() == MUSIC_RENEW) {
 | 
	
		
			
				|  |  | +				List<MusicGroupOrganizationCourseSettingsDetail> musicGroupOrganizationCourseSettingsDetails = musicGroupOrganizationCourseSettingsDetailDao
 | 
	
		
			
				|  |  | +						.queryByMusicGroupOrganizationCourseSettingsId(baseCalender.getMusicGroupOrganizationCourseSettingId());
 | 
	
		
			
				|  |  | +				for (MusicGroupOrganizationCourseSettingsDetail detail : musicGroupOrganizationCourseSettingsDetails) {
 | 
	
		
			
				|  |  | +					totalAmount = detail.getUnitPrice().multiply(detail.getCourseCurrentPrice());
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +				return totalAmount;
 | 
	
		
			
				|  |  | +			} else if (baseCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_COURSE) {
 | 
	
		
			
				|  |  | +				MusicGroup musicGroup = baseCalender.getMusicGroup();
 | 
	
		
			
				|  |  | +				// 如果是课程收费,判断是否审核
 | 
	
		
			
				|  |  | +				for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
 | 
	
		
			
				|  |  | +					OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
 | 
	
		
			
				|  |  | +							musicGroup.getOrganId(), courseSettings.getCourseType(), musicGroup.getChargeTypeId());
 | 
	
		
			
				|  |  | +					if (defaultUnitPrice == null) {
 | 
	
		
			
				|  |  | +						throw new BizException("请先设置分部课程类型单价");
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +					totalAmount = defaultUnitPrice.getUnitPrice().multiply(new BigDecimal(courseSettings.getCourseTotalMinuties()));
 | 
	
		
			
				|  |  | +					return totalAmount;
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}else {
 | 
	
		
			
				|  |  | +				throw new BizException("错误的缴费类型");
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		return totalAmount;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Override
 |