|  | @@ -3,6 +3,7 @@ package com.ym.mec.biz.service.impl;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SCHOOL;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
 | 
	
		
			
				|  |  | +import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.REJECT;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.ADD_STUDENT;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
 | 
	
	
		
			
				|  | @@ -184,7 +185,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  			throw new BizException("请登录");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		// 所有缴费项目已完成排课才能创建下一个缴费项目
 | 
	
		
			
				|  |  | -		String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,null);
 | 
	
		
			
				|  |  | +		String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,musicGroupPaymentCalenderDto.getIgnoreBatchNoList());
 | 
	
		
			
				|  |  |  		if (StringUtils.isNoneBlank(orignBatchNo)) {
 | 
	
		
			
				|  |  |  			if(StringUtils.isEmpty(musicGroupPaymentCalenderDto.getBatchNo()) || !musicGroupPaymentCalenderDto.getBatchNo().equals(orignBatchNo)){
 | 
	
		
			
				|  |  |  				throw new BizException("当前乐团存在未排课的缴费项目,请先完成排课再操作");
 | 
	
	
		
			
				|  | @@ -202,12 +203,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  		PaymentCalenderStatusEnum status = PaymentCalenderStatusEnum.NO;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		Date date = new Date();
 | 
	
		
			
				|  |  | -		String batchNo;
 | 
	
		
			
				|  |  | -		if(StringUtils.isEmpty(musicGroupPaymentCalenderDto.getBatchNo())){
 | 
	
		
			
				|  |  | -			batchNo = idGeneratorService.generatorId() + "";
 | 
	
		
			
				|  |  | -		}else {
 | 
	
		
			
				|  |  | -			batchNo = musicGroupPaymentCalenderDto.getBatchNo();
 | 
	
		
			
				|  |  | -		}
 | 
	
		
			
				|  |  | +		String batchNo = idGeneratorService.generatorId() + "";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		// 获取设置的课程
 | 
	
		
			
				|  |  |  		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalenderDto
 | 
	
	
		
			
				|  | @@ -381,6 +377,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			// 设置批次号
 | 
	
		
			
				|  |  |  			musicGroupPaymentCalender.setBatchNo(batchNo);
 | 
	
		
			
				|  |  | +			musicGroupPaymentCalenderDto.setBatchNo(batchNo);
 | 
	
		
			
				|  |  |  			musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -403,7 +400,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  				// 如果是进行中加学生
 | 
	
		
			
				|  |  |  				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 | 
	
		
			
				|  |  |  					addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings);
 | 
	
		
			
				|  |  | -				}else if(StringUtils.isNotEmpty(musicGroupPaymentCalenderDto.getBatchNo())){
 | 
	
		
			
				|  |  | +				}else if(musicGroupPaymentCalenderDto.getMergeClassFlag()){
 | 
	
		
			
				|  |  |  					//缴费项目添加学员
 | 
	
		
			
				|  |  |  					int[] ints = Arrays.stream(musicGroupPaymentCalenderDto.getStudentIds().split(",")).mapToInt(Integer::parseInt).toArray();
 | 
	
		
			
				|  |  |  					List<Integer> list2 = Arrays.stream(ints).boxed().collect(Collectors.toList());
 | 
	
	
		
			
				|  | @@ -909,9 +906,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  		if(musicGroupStudentClassAdjust == null){
 | 
	
		
			
				|  |  |  			return;
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | +		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(musicGroupStudentClassAdjust.getBatchNo());
 | 
	
		
			
				|  |  | +		for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
 | 
	
		
			
				|  |  | +			if(musicGroupPaymentCalender.getStatus() == AUDITING || musicGroupPaymentCalender.getStatus() == REJECT){
 | 
	
		
			
				|  |  | +				return;
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  |  		List<ClassGroup4MixDto> classGroup4MixDtos = JSON.parseArray(musicGroupStudentClassAdjust.getNewClassGroupJson(), ClassGroup4MixDto.class);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
 | 
	
		
			
				|  |  |  		for (MusicGroupPaymentCalender calender : musicGroupPaymentCalenders) {
 | 
	
		
			
				|  |  |  			//缴费项目添加学员
 | 
	
		
			
				|  |  |  			int[] ints = Arrays.stream(calender.getStudentIds().split(",")).mapToInt(Integer::parseInt).toArray();
 |