From fa677dec1c55db004a31beefb1e346e18c7858c2 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 20 二月 2025 18:41:29 +0800
Subject: [PATCH] bug修改

---
 src/main/java/com/taoke/autopay/task/KeyOrderDistributeTask.java |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/taoke/autopay/task/KeyOrderDistributeTask.java b/src/main/java/com/taoke/autopay/task/KeyOrderDistributeTask.java
index e6626bc..1ade385 100644
--- a/src/main/java/com/taoke/autopay/task/KeyOrderDistributeTask.java
+++ b/src/main/java/com/taoke/autopay/task/KeyOrderDistributeTask.java
@@ -4,7 +4,9 @@
 import com.taoke.autopay.dto.DYOrderDto;
 import com.taoke.autopay.entity.KeyOrder;
 import com.taoke.autopay.exception.KeyOrderException;
+import com.taoke.autopay.manager.OrderPayFailProcessor;
 import com.taoke.autopay.service.KeyOrderService;
+import com.taoke.autopay.utils.Constant;
 import com.taoke.autopay.utils.StringUtil;
 import com.taoke.autopay.utils.order.DYOrderApi;
 import org.springframework.context.annotation.Configuration;
@@ -31,7 +33,7 @@
                     if (order.getDistributeClientUid() != null) {
                         continue;
                     }
-                    Long uid = keyOrderService.getCanDistributeUid();
+                    Long uid = keyOrderService.getCanDistributeUid(Constant.MAX_PAY_ACCOUNT_QUEUE_SIZE);
                     if (uid != null) {
                         KeyOrder orderUpdate = new KeyOrder();
                         orderUpdate.setId(order.getId());
@@ -103,4 +105,21 @@
         }
     }
 
+
+    @Resource
+    private OrderPayFailProcessor orderPayFailProcessor;
+
+    @Scheduled(cron = "0/5 * * * * ? ")
+    private void processPayFail(){
+        for(int i=0;i<10;i++) {
+            // 涓�娆℃渶澶氬鐞�10鏉℃暟鎹�
+            orderPayFailProcessor.processFromQueue();
+        }
+    }
+
+    @Scheduled(cron = "0 0 3 * * ? ")
+    private void clearProcessPayFailCache(){
+        orderPayFailProcessor.clearCacheData();
+    }
+
 }

--
Gitblit v1.8.0