From 70514a0ac2779ca31708fa5d6f3b94665e32489c Mon Sep 17 00:00:00 2001 From: yuzhengwei <1030926372@qq.com> Date: Mon, 3 Apr 2023 14:00:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=90=8C=E4=B8=80=E4=B8=AA=E7=B1=BB?= =?UTF-8?q?=E4=B8=AD:A=E6=96=B9=E6=B3=95=EF=BC=88=E6=97=A0=E4=BA=8B?= =?UTF-8?q?=E5=8A=A1=EF=BC=89=E8=B0=83B=E6=96=B9=E6=B3=95=EF=BC=88?= =?UTF-8?q?=E6=9C=89=E4=BA=8B=E5=8A=A1=EF=BC=89,=E4=BA=8B=E5=8A=A1?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/pay/service/notify/PayNotifyServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/PayNotifyServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/PayNotifyServiceImpl.java index d0c525b90b..654603e687 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/PayNotifyServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/PayNotifyServiceImpl.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; +import cn.iocoder.yudao.framework.common.util.spring.SpringAopUtils; import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; import cn.iocoder.yudao.module.pay.dal.dataobject.notify.PayNotifyLogDO; import cn.iocoder.yudao.module.pay.dal.dataobject.notify.PayNotifyTaskDO; @@ -24,11 +25,13 @@ import cn.iocoder.yudao.module.pay.api.notify.dto.PayRefundNotifyReqDTO; import cn.iocoder.yudao.module.pay.service.order.PayOrderService; import cn.iocoder.yudao.module.pay.service.refund.PayRefundService; import lombok.extern.slf4j.Slf4j; +import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import javax.annotation.Resource; import javax.validation.Valid; @@ -85,6 +88,9 @@ public class PayNotifyServiceImpl implements PayNotifyService { @Lazy // 循环依赖(自己依赖自己),避免报错 private PayNotifyServiceImpl self; + @Resource + private ApplicationContext applicationContext; + @Override public void createPayNotifyTask(PayNotifyTaskCreateReqDTO reqDTO) { PayNotifyTaskDO task = new PayNotifyTaskDO(); @@ -178,7 +184,7 @@ public class PayNotifyServiceImpl implements PayNotifyService { } // 执行通知 - executeNotify(dbTask); + applicationContext.getBean(PayNotifyServiceImpl.class).executeNotify(dbTask); }); }