FengChaoYu il y a 2 semaines
Parent
commit
55c3f109a9

+ 8 - 1
src/main/java/com/gree/mall/manager/schedule/OverOrderSchedule.java

@@ -1,5 +1,6 @@
 package com.gree.mall.manager.schedule;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gree.mall.manager.enums.OrderShareStatusEnum;
@@ -125,12 +126,18 @@ public class OverOrderSchedule {
 
     @Scheduled(cron = "0 */5 8-22 * * ?")
     public void orderShareQueryTask() {
-        log.info("开始分账结果查询");
+
         List<OrderShare> orderShares = orderShareService.lambdaQuery()
                 .eq(OrderShare::getStatus, OrderShareStatusEnum.OVER.toString())
                 .eq(OrderShare::getShareStatus, WXShareStatusEnum.PROCESSING.toString())
                 .list();
 
+        if (CollectionUtil.isEmpty(orderShares)) {
+            return;
+        }
+
+        log.info("开始分账结果查询");
+
         for (OrderShare share : orderShares) {
             try {
                 orderShareLogic.queryShareResult(share);