1、支付环境切换为prod

2、邮件通知对象添加Kim
3、打开定时任务
This commit is contained in:
2025-02-06 09:53:03 +08:00
parent 6a7c8b3d28
commit e587ad3ca1
5 changed files with 29 additions and 27 deletions

View File

@@ -31,14 +31,14 @@ public class AccountTask {
accountService.refreshCreditsWeekly();
}
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void getPaidUser() {
// 获取code-create 表中 指定日期之后 订单状态为wc-processing的订单
accountService.extendValidityForCC();
}
// 每天凌晨0点执行一次
// @Scheduled(cron = "0 0 0 * * ?")
@Scheduled(cron = "0 0 0 * * ?")
public void cancelActivityBenefits() {
// 1、查询当前所有参与了活动且过期的用户
List<Account> accountList = accountService.getExpiredUserBySystemUser(4);
@@ -51,7 +51,7 @@ public class AccountTask {
}
// 每天检测正式用户到期情况每天凌晨0点执行
// @Scheduled(cron = "0 0 0 * * ?")
@Scheduled(cron = "0 0 0 * * ?")
public void paidUserToVisitor() {
// 1、查询当前已过期正式用户或试用用户
List<Account> accountList = accountService.getExpiredUserBySystemUser(1);
@@ -68,7 +68,7 @@ public class AccountTask {
/**
* 将Code-Create上注册的用户添加为AiDA的游客
*/
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void registerUserToVisitor() {
accountService.registerUserToVisitor();
}

View File

@@ -45,7 +45,7 @@ public class PaymentTask {
@Resource
private PayPalCheckoutService payPalCheckoutService;
// @Scheduled(cron = "0/30 * * * * ?")
@Scheduled(cron = "0/30 * * * * ?")
public void orderConfirmForPaypal() throws SerializeException {
// log.info("PayPal orderConfirm 被执行......");

View File

@@ -635,8 +635,10 @@ public class SendEmailUtil {
SendEmailResponse resp = client.SendEmail(req);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail");
log.info("邮件发送至{} 发送失败###{}", receiverAddress, e.toString());
log.error(e.getMessage());
// 这里不再抛出异常 失败就不发,保证后续正常运行
// throw new BusinessException("failed.to.send.mail");
}
}
@@ -835,9 +837,9 @@ public class SendEmailUtil {
public static void subscriptionEmailReminder(String type, SubscriptionEmailParamsDTO subscriptionEmailParamsDTO, String language, String receiverAddress) {
try {
// String merchantEmail = "kimwong@code-create.com.hk";
String merchantEmail = "kimwong@code-create.com.hk";
String developer = "xupei3360@163.com";
String[] receiverEmail = {/*merchantEmail, */developer};
String[] receiverEmail = {merchantEmail, developer};
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();

View File

@@ -76,9 +76,9 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
affiliate.setPromotionMethod(promotionMethod);
baseMapper.insert(affiliate);
// 邮件通知审批者
// String merchantEmail = "kimwong@code-create.com.hk";
String merchantEmail = "kimwong@code-create.com.hk";
String developer = "xupei3360@163.com";
String[] receiverEmail = {/*merchantEmail, */developer};
String[] receiverEmail = {merchantEmail, developer};
SendEmailUtil.affiliateEmailReminder(receiverEmail, new AffiliateEmailParamsDTO(userHolder.getUsername(), promotionMethod), "new");
}else {
throw new BusinessException("You have registered an Affiliate", ResultEnum.PROMPT.getCode());
@@ -313,9 +313,9 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
affiliateEmailParamsDTO.setUnpaidEarnings(totalCommission.toString());
affiliateEmailParamsDTO.setPaidEarnings("0");
// String merchantEmail = "kimwong@code-create.com.hk";
String merchantEmail = "kimwong@code-create.com.hk";
String developer = "xupei3360@163.com";
String[] receiverEmail = {/*merchantEmail, */developer};
String[] receiverEmail = {merchantEmail, developer};
// 邮件通知
SendEmailUtil.affiliateEmailReminder(receiverEmail, affiliateEmailParamsDTO, "summary");
}