liujc 1 год назад
Родитель
Сommit
47c9f20ae8

+ 6 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserPaymentCoreServiceImpl.java

@@ -34,6 +34,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
 import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -110,6 +111,10 @@ public class UserPaymentCoreServiceImpl implements UserPaymentCoreService {
     @Autowired
     private StudentService studentService;
 
+
+    @Autowired
+    ApplicationContext applicationContext;
+
     @Autowired
     private VideoLessonGroupService videoLessonGroupService;
 
@@ -1107,7 +1112,7 @@ public class UserPaymentCoreServiceImpl implements UserPaymentCoreService {
                             try {
                                 log.info("scanPaymentTimeoutOrderRecord WAIT_PAY, userId={}, orderNo={}", item.getUserId(), item.getOrderNo());
                                 // 关闭待支付、超时订单
-                                SpringContextHolder.getBean(UserPaymentCoreService.class).cancelPayment(userInfo, item.getOrderNo());
+                                applicationContext.getBean(UserPaymentCoreService.class).cancelPayment(userInfo, item.getOrderNo());
                             } catch (Exception e) {
                                 log.error("scanPaymentTimeoutOrderRecord WAIT_PAY, userId={}, orderNo={}", item.getUserId(), item.getOrderNo(), e);
                             }