zouxuan 4 lat temu
rodzic
commit
65e61d11a8

+ 11 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -152,7 +152,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 //		Date deadlinePaymentDate = calender.getDeadlinePaymentDate();
 		int length = ids.split(",").length;
 		Date date = new Date();
-		Iterator<MusicGroupPaymentCalenderDetail> iterator = calenderDetails.iterator();
+		/*Iterator<MusicGroupPaymentCalenderDetail> iterator = calenderDetails.iterator();
 		MusicGroupPaymentCalenderDetail next;
 		while(iterator.hasNext()){
 			next = iterator.next();
@@ -160,16 +160,17 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			if(countOpenPayment > 0){
 				iterator.remove();
 			}
-			/*int count1 = musicGroupPaymentCalenderDao.queryIntersectionByPaymentDate(next.getMusicGroupId(),startPaymentDate,deadlinePaymentDate);
+			*//*int count1 = musicGroupPaymentCalenderDao.queryIntersectionByPaymentDate(next.getMusicGroupId(),startPaymentDate,deadlinePaymentDate);
 			int count = musicGroupPaymentCalenderDetailDao.queryIntersectionByPaymentDate(next.getMusicGroupId(),next.getUserId());
 			if(count > 0 || count1 > 0){
 				iterator.remove();
-			}*/
-		}
-		if(calenderDetails.size() == 0){
+			}*//*
+		}*/
+		/*if(calenderDetails.size() == 0){
 			return "操作失败,学员有未完成的订单";
-		}
-		String musicGroupId = calenderDetails.get(0).getMusicGroupId();
+		}*/
+		Long calenderId = calenderDetails.get(0).getMusicGroupPaymentCalenderId();
+		MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(calenderId);
 		calenderDetails.forEach(e->{
 			e.setUpdateTime(date);
 			e.setOpen(1);
@@ -179,7 +180,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		});
 		musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
 		//修改学员缴费状态为未缴费
-		musicGroupStudentFeeDao.setNoPayment(calenderDetails);
+//		musicGroupStudentFeeDao.setNoPayment(calenderDetails);
 		Set<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
 		//推送消息
 		if (studentIds.size() > 0) {
@@ -187,9 +188,9 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			for (Integer userId : studentIds) {
 				push.put(userId, userId + "");
 			}
-			MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+			MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
 			String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-			String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + musicGroupId;
+			String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + calender.getMusicGroupId();
 			// 发送续费通知
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push, null, 0, memo,"STUDENT",musicGroup.getName());
 		}

+ 2 - 6
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -274,12 +274,8 @@
 		ORDER BY mgpc.start_payment_date_ DESC LIMIT 1
 	</select>
 	<select id="queryCanOpenList" resultMap="MusicGroupPaymentCalenderDetail">
-		SELECT mgpcd.*,mgpc.music_group_id_ FROM music_group_payment_calender_detail mgpcd
-		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
-		LEFT JOIN student_registration sr ON sr.music_group_id_ = mgpc.music_group_id_
-		WHERE mgpcd.payment_status_ = 'NON_PAYMENT' AND (mgpcd.open_ = 0 OR mgpcd.open_ IS NULL) AND sr.music_group_status_ != 'QUIT' AND mgpc.status_ = 'OVER'
-		AND FIND_IN_SET(mgpcd.id_,#{ids})
-		GROUP BY mgpcd.id_
+		SELECT * FROM music_group_payment_calender_detail
+		WHERE FIND_IN_SET(id_,#{ids}) AND payment_status_ = 'NON_PAYMENT'
 	</select>
 	<select id="queryIntersectionByPaymentDate" resultType="java.lang.Integer">
 		SELECT COUNT(mgpcd.id_) FROM music_group_payment_calender_detail mgpcd