TASK:订阅到期通知或续订通知(暂时关闭邮件发送)

This commit is contained in:
2025-12-03 13:55:52 +08:00
parent fc0867d9b1
commit bd69793a72
3 changed files with 34 additions and 20 deletions

View File

@@ -20,6 +20,7 @@ import com.ai.da.model.enums.Language;
import com.ai.da.model.vo.CheckCouponsVO;
import com.ai.da.service.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
@@ -1075,7 +1076,7 @@ public class StripeServiceImpl implements StripeService {
String key = RedisUtil.SUBSCRIPTION_SENT_EMAIL_TYPE + subscriptionInfo.getId();
// 先判断当前订单 这个类型的邮件是否已发送过
Boolean elementExistsInSet = redisUtil.isElementExistsInSet(key, type);
if (!type.startsWith("reminder") && !type.equals("cancel") && paymentInfo.getNotified() == 1 && elementExistsInSet){
if (/*!type.startsWith("reminder") && */!type.equals("cancel") && paymentInfo.getNotified() == 1 && elementExistsInSet){
// 已经邮件通知过,直接返回
log.info("不发送邮件原因【type为{}order_no为{},已经进行邮件通知】", type, orderNo);
return true;
@@ -1099,9 +1100,10 @@ public class StripeServiceImpl implements StripeService {
emailParamsDTO.setEndOfPrepaidTerm(DateUtil.changeTimeStampFormat(subscriptionInfo.getCurrentPeriodEnd(), "seconds", CommonConstant.TIME_FORMAT_MMM_dd_yyyy));
setSubscriptionParams(paymentInfo, subscriptionInfo, orderByOrderNo, emailParamsDTO, language);
boolean b = SendEmailUtil.subscriptionEmailReminder(type, emailParamsDTO, language, account.getUserEmail());
log.info("SEND EMAIL: type={}, params={}, language={}, receiver={}", type, JSONObject.toJSON(emailParamsDTO), language, account.getUserEmail());
// boolean b = SendEmailUtil.subscriptionEmailReminder(type, emailParamsDTO, language, account.getUserEmail());
// boolean b = emailService.subscriptionEmailReminder(type, emailParamsDTO, language, account.getUserEmail());
if (!b) return false;
// if (!b) return false;
// 邮件通知成功后,更新标志
if (!type.startsWith("reminder") && !type.equals("cancel")){