浏览代码

update:乐团续费推送

yonge 4 年之前
父节点
当前提交
f0ce5d448c

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

@@ -131,7 +131,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 				}
 				MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 				String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-				String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + musicGroupId;
+				String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+calender.getId()+"&id=" + calender.getMusicGroupId();
 				// 发送续费通知
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push, null, 0, memo,"STUDENT",musicGroup.getName());
 			}
@@ -169,7 +169,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			}
 			MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
 			String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-			String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + calender.getMusicGroupId();
+			String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+calender.getId()+"&id=" + calender.getMusicGroupId();
 			// 发送续费通知
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push, null, 0, memo,"STUDENT",musicGroup.getName());
 		}

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -1111,7 +1111,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				push.put(userId, userId + "");
 			}
 			String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-			String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + musicGroup.getId();
+			String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+calenderId+"&id=" + musicGroup.getId();
 			// 发送续费通知
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,
 					null, 0, memo, "STUDENT", musicGroup.getName());
@@ -1220,7 +1220,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 				MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
 				String configValue = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-				String memo = "4?" + configValue + "/#/renew?musicGroupId=" + musicGroup.getId();
+				String memo = "4?" + configValue + "/#/musicGroupRenew?calenderId="+calender.getId()+"&id=" + calender.getMusicGroupId();
 				// 发送续费通知
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,
 						null, 0, memo, "STUDENT", musicGroup.getName());
@@ -1311,7 +1311,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 				MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 				String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-				String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + musicGroupId;
+				String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+id+"&id=" + musicGroupId;
 				// 发送续费通知
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,
 						null, 0, memo, "STUDENT", musicGroup.getName());
@@ -1328,7 +1328,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 				MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
 				String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-				String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + calender.getMusicGroupId();
+				String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+calender.getId()+"&id=" + calender.getMusicGroupId();
 				// 发送续费通知
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,
 						null, 0, memo, "STUDENT", musicGroup.getName());

+ 7 - 46
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupStudentFeeServiceImpl.java

@@ -1,27 +1,22 @@
 package com.ym.mec.biz.service.impl;
 
+import java.math.BigDecimal;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.UpdateStudentFeeDto;
-import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.service.MusicGroupStudentFeeService;
-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;
-import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.math.BigDecimal;
-import java.util.*;
 
 @Service
 public class MusicGroupStudentFeeServiceImpl extends BaseServiceImpl<Long, MusicGroupStudentFee> implements MusicGroupStudentFeeService {
@@ -45,40 +40,6 @@ public class MusicGroupStudentFeeServiceImpl extends BaseServiceImpl<Long, Music
 
 	@Override
 	public boolean refreshPaymentFeeStatus() {
-
-		int days = Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.REFRESH_PAYMENT_STATUS_EARLY_DAYS));
-
-		Date date = new Date();
-
-		List<MusicGroupStudentFee> updateList = new ArrayList<MusicGroupStudentFee>();
-
-		List<MusicGroupStudentFee> musicGroupStudentFeeList = musicGroupStudentFeeDao.queryWillRenewList(days);
-		for (MusicGroupStudentFee musicGroupStudentFee : musicGroupStudentFeeList) {
-			//课程费用为空,或者课程费用为0,只更新下次缴费时间
-			if (musicGroupStudentFee.getPaymentStatus() == PaymentStatus.PAID_COMPLETED &&
-					(musicGroupStudentFee.getCourseFee() != null && musicGroupStudentFee.getCourseFee().doubleValue() > 0)) {
-				musicGroupStudentFee.setPaymentStatus(PaymentStatus.NON_PAYMENT);
-				musicGroupStudentFee.setUpdateTime(date);
-				updateList.add(musicGroupStudentFee);
-			}
-		}
-
-		if (updateList.size() > 0) {
-			musicGroupStudentFeeDao.batchUpdate(updateList);
-			MusicGroup musicGroup = musicGroupDao.get(updateList.get(0).getMusicGroupId());
-			Map<Integer, String> push = new HashMap<>();
-			for (MusicGroupStudentFee sf : updateList) {
-				push.put(sf.getUserId(), sf.getUserId() + "");
-			}
-			String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-			String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + musicGroup.getId();
-			// 发送续费通知
-			sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push, null, 0, memo,"STUDENT",musicGroup.getName());
-		}
-
-		// int i = DateUtil.daysBetween(new Date(), musicGroupStudentFee.getNextPaymentDate());
-		// e.setRenewStatus(i < 8 ? 0 : 1);
-
 		return true;
 	}