|  | @@ -6,15 +6,7 @@ import static com.ym.mec.biz.dal.enums.DealStatusEnum.SUCCESS;
 | 
	
		
			
				|  |  |  import java.io.IOException;
 | 
	
		
			
				|  |  |  import java.math.BigDecimal;
 | 
	
		
			
				|  |  |  import java.text.SimpleDateFormat;
 | 
	
		
			
				|  |  | -import java.util.ArrayList;
 | 
	
		
			
				|  |  | -import java.util.Arrays;
 | 
	
		
			
				|  |  | -import java.util.Collections;
 | 
	
		
			
				|  |  | -import java.util.Date;
 | 
	
		
			
				|  |  | -import java.util.HashMap;
 | 
	
		
			
				|  |  | -import java.util.HashSet;
 | 
	
		
			
				|  |  | -import java.util.List;
 | 
	
		
			
				|  |  | -import java.util.Map;
 | 
	
		
			
				|  |  | -import java.util.Set;
 | 
	
		
			
				|  |  | +import java.util.*;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
	
		
			
				|  | @@ -1613,8 +1605,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |              
 | 
	
		
			
				|  |  |              //操作人
 | 
	
		
			
				|  |  |              SysUser operator = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            BigDecimal price = courseScheduleStudentPaymentDao.countFinishCoursePriceWithMusicGroup(musicGroupId, GroupType.MUSIC);
 | 
	
		
			
				|  |  | +            BigDecimal amount = studentRegistration.getSurplusCourseFee();
 | 
	
		
			
				|  |  | +            if(Objects.isNull(price)){
 | 
	
		
			
				|  |  | +                price = new BigDecimal(0);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            amount = amount.subtract(price);
 | 
	
		
			
				|  |  |              
 | 
	
		
			
				|  |  | -            studentRegistrationService.updateUserSurplusCourseFee(userId, musicGroupId, studentRegistration.getSurplusCourseFee().negate(), reason, operator.getId());
 | 
	
		
			
				|  |  | +            studentRegistrationService.updateUserSurplusCourseFee(userId, musicGroupId, amount.negate(), reason, operator.getId());
 | 
	
		
			
				|  |  |              
 | 
	
		
			
				|  |  |              
 | 
	
		
			
				|  |  |              //更新服务指标、运营指标
 | 
	
	
		
			
				|  | @@ -1756,8 +1755,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          //操作人
 | 
	
		
			
				|  |  |          SysUser operator = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  | -        studentRegistrationService.updateUserSurplusCourseFee(userId, musicGroupId, studentRegistration.getSurplusCourseFee().negate(), reason, operator.getId());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        BigDecimal price = courseScheduleStudentPaymentDao.countFinishCoursePriceWithMusicGroup(musicGroupId, GroupType.MUSIC);
 | 
	
		
			
				|  |  | +        BigDecimal amount = studentRegistration.getSurplusCourseFee();
 | 
	
		
			
				|  |  | +        if(Objects.isNull(price)){
 | 
	
		
			
				|  |  | +            price = new BigDecimal(0);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        amount = amount.subtract(price);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        studentRegistrationService.updateUserSurplusCourseFee(userId, musicGroupId, amount.negate(), reason, operator.getId());
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          //更新服务指标、运营指标
 | 
	
		
			
				|  |  |          int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
 |