| 
					
				 | 
			
			
				@@ -17,6 +17,7 @@ import com.ym.mec.biz.dal.enums.CourseViewTypeEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.event.source.GroupEventSource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ym.mec.biz.service.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.common.page.PageInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.common.page.QueryInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.enums.YesOrNoEnum; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -31,10 +32,6 @@ import com.ym.mec.biz.dal.dto.SimpleUserDto; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.enums.MessageTypeEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.ym.mec.biz.service.MusicGroupPaymentCalenderService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.ym.mec.biz.service.SysConfigService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.ym.mec.biz.service.SysMessageService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.common.dal.BaseDAO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.common.exception.BizException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.common.service.impl.BaseServiceImpl; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -69,6 +66,8 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl< 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private SysMessageService sysMessageService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private GroupEventSource groupEventSource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private StudentService studentService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	public BaseDAO<Long, MusicGroupPaymentCalenderDetail> getDAO() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -97,7 +96,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl< 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		//为了解决学员欠费数量的问题,只要学员没有缴费就可以修改金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		Set<Integer> studentIds = new HashSet<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				calenderDetails.forEach(e->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		calenderDetails.forEach(e->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				throw new BizException("修改失败:缴费状态不匹配"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			} 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -108,6 +107,10 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl< 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					studentIds.add(e.getUserId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			}else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				// 添加会员有效时长 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				if(calender.getMemberRankSettingId() != null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					studentService.updateMemberRank(e.getUserId(),calender.getMemberRankSettingId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				calender.setActualNum((calender.getActualNum()==null?0:calender.getActualNum()) + 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				e.setPaymentStatus(PAID_COMPLETED); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -251,6 +254,10 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl< 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		musicGroupPaymentCalenderDetail.setCreateTime(date); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if (musicGroupPaymentCalenderDetail.getExpectAmount().compareTo(totalPrice) == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			// 添加会员有效时长 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			if(calender.getMemberRankSettingId() != null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				studentService.updateMemberRank(userId,calender.getMemberRankSettingId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			musicGroupPaymentCalenderDetail.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		} else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			musicGroupPaymentCalenderDetail.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.NON_PAYMENT); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -261,7 +268,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl< 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(calender.getDeadlinePaymentDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		musicGroupPaymentCalenderDetail.setResponsibleUserId(calender.getOperator()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		for (MusicGroupPaymentCalenderCourseSettings courseSettings : courseSettingsList) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -502,6 +509,10 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl< 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				musicGroupPaymentCalenderDetail.setCreateTime(date); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				if (musicGroupPaymentCalenderDetail.getExpectAmount().compareTo(new BigDecimal(0)) == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					// 添加会员有效时长 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					if(musicGroupPaymentCalender.getMemberRankSettingId() != null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						studentService.updateMemberRank(studentId,musicGroupPaymentCalender.getMemberRankSettingId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					paymentNum++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				} else { 
			 |