mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-17 12:35:07 +08:00
优化支付通知的逻辑,解决并发的问题。
同时,收到支付结果时,立马回调业务,避免延迟
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.adminserver.modules.pay.job.notify;
|
||||
|
||||
import cn.iocoder.yudao.coreservice.modules.pay.service.notify.PayNotifyCoreService;
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 支付通知 Job
|
||||
* 通过不断扫描待通知的 PayNotifyTaskDO 记录,回调业务线的回调接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class PayNotifyJob implements JobHandler {
|
||||
|
||||
@Resource
|
||||
private PayNotifyCoreService payNotifyCoreService;
|
||||
|
||||
@Override
|
||||
public String execute(String param) throws Exception {
|
||||
int notifyCount = payNotifyCoreService.executeNotify();
|
||||
return String.format("执行支付通知 %s 个", notifyCount);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
package cn.iocoder.yudao.adminserver.modules.pay.job;
|
@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.adminserver.modules.system.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
import javafx.beans.binding.MapExpression;
|
||||
|
||||
/**
|
||||
* System 错误码枚举类
|
||||
|
@ -166,6 +166,9 @@ yudao:
|
||||
exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
|
||||
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
||||
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
||||
pay:
|
||||
pay-notify-url: http://niubi.natapp1.cc/api/pay/order/notify
|
||||
refund-notify-url: http://niubi.natapp1.cc/api/pay/refund/notify
|
||||
demo: false # 关闭演示模式
|
||||
|
||||
justauth:
|
||||
|
Reference in New Issue
Block a user