lighter 3 年 前
コミット
1555c3698f

+ 10 - 11
src/main/java/thyyxxk/wxservice_server/scheduled/QueryOrderStateTask.java

@@ -52,17 +52,16 @@ public class QueryOrderStateTask {
     public void queryOrderState() throws Exception {
         if (canScheduleRun && production) {
             List<TradeNo> tradeNos = dao.selectTradeNosForScheduleTask();
-            if (null == tradeNos || tradeNos.isEmpty()) {
-                return;
-            }
-            log.info("定时查询订单支付状态:{}", tradeNos);
-            for (TradeNo tradeNo : tradeNos) {
-                if (tradeNo.getQueryStateTimes() >= 20) {
-                    WxPayOrder order = new WxPayOrder();
-                    order.setTradeNo(tradeNo.getTradeNo());
-                    service.closeWxOrder(order);
-                } else {
-                    service.queryOrderState(tradeNo.getTradeNo(), QuerySource.SCHEDULE);
+            if (null != tradeNos && !tradeNos.isEmpty()) {
+                log.info("定时查询订单支付状态:{}", tradeNos);
+                for (TradeNo tradeNo : tradeNos) {
+                    if (tradeNo.getQueryStateTimes() >= 20) {
+                        WxPayOrder order = new WxPayOrder();
+                        order.setTradeNo(tradeNo.getTradeNo());
+                        service.closeWxOrder(order);
+                    } else {
+                        service.queryOrderState(tradeNo.getTradeNo(), QuerySource.SCHEDULE);
+                    }
                 }
             }
         }