|  | @@ -25,6 +25,7 @@ import java.util.Set;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.*;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.GroupType;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.*;
 | 
	
	
		
			
				|  | @@ -45,25 +46,11 @@ import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.ClassGroup;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroup;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.Organization;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 | 
	
	
		
			
				|  | @@ -839,6 +826,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  		return true;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +	@Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | +	@Override
 | 
	
		
			
				|  |  |  	public void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList){
 | 
	
		
			
				|  |  |  		//如果是进行中加学生
 | 
	
		
			
				|  |  |  		Date date = new Date();
 | 
	
	
		
			
				|  | @@ -866,6 +855,22 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  				musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  				musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
 | 
	
		
			
				|  |  | +				//如果是0元那么更新fee表和studentRegistration表
 | 
	
		
			
				|  |  | +				if(totalPrice.doubleValue() == 0d){
 | 
	
		
			
				|  |  | +					MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(Integer.parseInt(studentId), musicGroupPaymentCalender.getMusicGroupId());
 | 
	
		
			
				|  |  | +					if (musicGroupStudentFee != null) {
 | 
	
		
			
				|  |  | +						musicGroupStudentFee.setUpdateTime(date);
 | 
	
		
			
				|  |  | +						musicGroupStudentFee.setLatestPaidTime(date);
 | 
	
		
			
				|  |  | +						musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
 | 
	
		
			
				|  |  | +						musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
 | 
	
		
			
				|  |  | +						musicGroupStudentFeeDao.update(musicGroupStudentFee);
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +					//如果是进行中加学员
 | 
	
		
			
				|  |  | +					StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(Integer.parseInt(studentId), musicGroupPaymentCalender.getMusicGroupId());
 | 
	
		
			
				|  |  | +					studentRegistration.setPaymentStatus(YES);
 | 
	
		
			
				|  |  | +					studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
 | 
	
		
			
				|  |  | +					studentRegistrationDao.update(studentRegistration);
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  				// 学生加课程明细
 | 
	
		
			
				|  |  |  				for(MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList){
 | 
	
	
		
			
				|  | @@ -1088,9 +1093,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  				List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
 | 
	
		
			
				|  |  |  				addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  | -			//将0元未缴费学员缴费状态更新为已缴费
 | 
	
		
			
				|  |  | -			int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
 | 
	
		
			
				|  |  | -			musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
 | 
	
		
			
				|  |  |  		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
 | 
	
	
		
			
				|  | @@ -1175,7 +1177,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	//推送待续费通知
 | 
	
		
			
				|  |  |  	public void pushWaitRenewMessage(Long calenderId,MusicGroup musicGroup,Set<Integer> studentIds){
 | 
	
		
			
				|  |  | -		if(studentIds == null){
 | 
	
		
			
				|  |  | +		/*if(studentIds == null){
 | 
	
		
			
				|  |  |  			studentIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentStudentIds(calenderId);
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		if (studentIds.size() > 0) {
 | 
	
	
		
			
				|  | @@ -1195,7 +1197,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 | 
	
		
			
				|  |  |  				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
 | 
	
		
			
				|  |  |  						null, 0, memo, null, musicGroup.getName());
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  | -		}
 | 
	
		
			
				|  |  | +		}*/
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 |