Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
79e0f5860e
@ -2,9 +2,7 @@ package com.cdzy.payment.config;
|
|||||||
|
|
||||||
import com.wechat.pay.java.core.Config;
|
import com.wechat.pay.java.core.Config;
|
||||||
import com.wechat.pay.java.core.RSAPublicKeyConfig;
|
import com.wechat.pay.java.core.RSAPublicKeyConfig;
|
||||||
import com.wechat.pay.java.core.cipher.RSASigner;
|
|
||||||
import com.wechat.pay.java.core.cipher.Signer;
|
import com.wechat.pay.java.core.cipher.Signer;
|
||||||
import com.wechat.pay.java.core.util.PemUtil;
|
|
||||||
import com.wechat.pay.java.service.payments.jsapi.JsapiService;
|
import com.wechat.pay.java.service.payments.jsapi.JsapiService;
|
||||||
import com.wechat.pay.java.service.refund.RefundService;
|
import com.wechat.pay.java.service.refund.RefundService;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -12,8 +10,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
import java.security.PrivateKey;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付配置参数
|
* 微信支付配置参数
|
||||||
*
|
*
|
||||||
@ -67,10 +63,15 @@ public class WxPayConfig {
|
|||||||
*/
|
*/
|
||||||
private Integer expireMinute = 1440;
|
private Integer expireMinute = 1440;
|
||||||
/**
|
/**
|
||||||
* 定时任务执行表达式
|
* 支付状态检查定时任务执行表达式
|
||||||
* 默认每12小时执行1次
|
* 默认每12小时执行1次
|
||||||
*/
|
*/
|
||||||
private String cronExpression = "0 0 0,12 * * ?";
|
private String paySchedule = "0 0 0/12 * * ?";
|
||||||
|
/**
|
||||||
|
* 退款状态检查定时任务执行表达式
|
||||||
|
* 默认每30分钟执行1次
|
||||||
|
*/
|
||||||
|
private String refundSchedule = "0 0/30 * * * ?";
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Config certificateConfig() {
|
public Config certificateConfig() {
|
||||||
|
|||||||
@ -29,7 +29,9 @@ public class ScheduledTaskManager {
|
|||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
String CRON_EXPRESSION = wxPayConfig.getCronExpression();
|
String CRON_EXPRESSION_PAY = wxPayConfig.getPaySchedule();
|
||||||
|
String CRON_EXPRESSION_REFUND = wxPayConfig.getRefundSchedule();
|
||||||
|
|
||||||
// 启动定时任务
|
// 启动定时任务
|
||||||
// 1. 每隔30秒执行1次,查询创建未超过5分钟,并且未支付的订单
|
// 1. 每隔30秒执行1次,查询创建未超过5分钟,并且未支付的订单
|
||||||
threadPoolTaskScheduler.schedule(new Runnable() {
|
threadPoolTaskScheduler.schedule(new Runnable() {
|
||||||
@ -41,7 +43,7 @@ public class ScheduledTaskManager {
|
|||||||
log.error("checkOrderStatus 执行异常", e);
|
log.error("checkOrderStatus 执行异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, new CronTrigger(CRON_EXPRESSION));
|
}, new CronTrigger(CRON_EXPRESSION_PAY));
|
||||||
|
|
||||||
//========支付系统自动关闭,不主动关闭,每次发起请求的时候检测是否关闭========
|
//========支付系统自动关闭,不主动关闭,每次发起请求的时候检测是否关闭========
|
||||||
//// 2. 每隔30秒执行1次,查询创建超过5分钟,并且未支付的订单
|
//// 2. 每隔30秒执行1次,查询创建超过5分钟,并且未支付的订单
|
||||||
@ -66,7 +68,7 @@ public class ScheduledTaskManager {
|
|||||||
log.error("checkRefundStatus 执行异常", e);
|
log.error("checkRefundStatus 执行异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, new CronTrigger(CRON_EXPRESSION));
|
}, new CronTrigger(CRON_EXPRESSION_REFUND));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,8 @@ payment:
|
|||||||
pay-notify_url: http://192.168.2.156:10017/wxPayment/pay-notify
|
pay-notify_url: http://192.168.2.156:10017/wxPayment/pay-notify
|
||||||
refund-notify_url: http://192.168.2.156:10017/wxPayment/refund-notify
|
refund-notify_url: http://192.168.2.156:10017/wxPayment/refund-notify
|
||||||
expire-minutes: 1440
|
expire-minutes: 1440
|
||||||
cron-expression: 0 0 0,12 * * ?
|
pay-schedule: 0 0 0/12 * * ?
|
||||||
|
refund-schedule: 0 0/30 * * * ?
|
||||||
task-scheduler-pool:
|
task-scheduler-pool:
|
||||||
poolSize: 100
|
poolSize: 100
|
||||||
threadNamePrefix: task-scheduled-
|
threadNamePrefix: task-scheduled-
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user