修改退款审核、退款环节,记录操作人ID,通过请求token获取用户ID(需要增加sa-token配置);修改定时任务配置,支付状态检查(12小时执行一次)、退款状态检查分开配置(半小时执行一次)
This commit is contained in:
parent
de701c4726
commit
4a30209d25
@ -2,9 +2,7 @@ package com.cdzy.payment.config;
|
||||
|
||||
import com.wechat.pay.java.core.Config;
|
||||
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.util.PemUtil;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiService;
|
||||
import com.wechat.pay.java.service.refund.RefundService;
|
||||
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.Configuration;
|
||||
|
||||
import java.security.PrivateKey;
|
||||
|
||||
/**
|
||||
* 微信支付配置参数
|
||||
*
|
||||
@ -67,10 +63,15 @@ public class WxPayConfig {
|
||||
*/
|
||||
private Integer expireMinute = 1440;
|
||||
/**
|
||||
* 定时任务执行表达式
|
||||
* 支付状态检查定时任务执行表达式
|
||||
* 默认每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
|
||||
public Config certificateConfig() {
|
||||
|
||||
@ -29,7 +29,9 @@ public class ScheduledTaskManager {
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
String CRON_EXPRESSION = wxPayConfig.getCronExpression();
|
||||
String CRON_EXPRESSION_PAY = wxPayConfig.getPaySchedule();
|
||||
String CRON_EXPRESSION_REFUND = wxPayConfig.getRefundSchedule();
|
||||
|
||||
// 启动定时任务
|
||||
// 1. 每隔30秒执行1次,查询创建未超过5分钟,并且未支付的订单
|
||||
threadPoolTaskScheduler.schedule(new Runnable() {
|
||||
@ -41,7 +43,7 @@ public class ScheduledTaskManager {
|
||||
log.error("checkOrderStatus 执行异常", e);
|
||||
}
|
||||
}
|
||||
}, new CronTrigger(CRON_EXPRESSION));
|
||||
}, new CronTrigger(CRON_EXPRESSION_PAY));
|
||||
|
||||
//========支付系统自动关闭,不主动关闭,每次发起请求的时候检测是否关闭========
|
||||
//// 2. 每隔30秒执行1次,查询创建超过5分钟,并且未支付的订单
|
||||
@ -66,7 +68,7 @@ public class ScheduledTaskManager {
|
||||
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
|
||||
refund-notify_url: http://192.168.2.156:10017/wxPayment/refund-notify
|
||||
expire-minutes: 1440
|
||||
cron-expression: 0 0 0,12 * * ?
|
||||
pay-schedule: 0 0 0/12 * * ?
|
||||
refund-schedule: 0 0/30 * * * ?
|
||||
task-scheduler-pool:
|
||||
poolSize: 100
|
||||
threadNamePrefix: task-scheduled-
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user