From a64f8ad2a5abc2ddf99d8d077ca96b595d65882d Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 20 Feb 2025 15:44:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=8A=A8=E6=8F=90?= =?UTF-8?q?=E7=8E=B0=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1;=20=E5=8E=9F?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=88=86=E8=B4=A6=E4=BB=BB=E5=8A=A1=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E7=94=9F=E6=88=90=E8=BF=90=E8=90=A5=E5=95=86=E6=97=A5?= =?UTF-8?q?=E6=8A=A5=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jsowell/quartz/task/JsowellTask.java | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java index c30332f8f..ca95f61a7 100644 --- a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java +++ b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java @@ -1,6 +1,5 @@ package com.jsowell.quartz.task; -import com.huifu.adapay.core.exception.BaseAdaPayException; import com.jsowell.adapay.dto.WithdrawDTO; import com.jsowell.adapay.service.AdapayService; import com.jsowell.common.constant.CacheConstants; @@ -215,33 +214,39 @@ public class JsowellTask { } // 调分账方法 - // pileMerchantInfos.parallelStream().forEach(merchant -> { - // try { - // orderBasicInfoService.orderSplittingOperations(merchant.getId() + "", yesterday.toString()); - // } catch (Exception e) { - // log.error("处理订单分账异常, merchantId:{}", merchant.getId(), e); - // } - // }); - - - // 换为实时分账后, 此方法改为 自动提现并计算前一天的分账信息 pileMerchantInfos.parallelStream().forEach(merchant -> { - automaticPayouts(merchant.getId() + ""); + try { + // orderBasicInfoService.orderSplittingOperations(merchant.getId() + "", yesterday.toString()); + orderBasicInfoService.generateMerchantBill(merchant.getId() + "", yesterday.toString()); + } catch (Exception e) { + log.error("生成运营商日报异常, merchantId:{}", merchant.getId(), e); + } }); } /** - * 自动提现并计算前一天的分账信息 - * automaticPayouts + * 定时任务,自动提现 + * jsowellTask.automaticPayouts() */ - private void automaticPayouts(String merchantId) { - WithdrawDTO dto = new WithdrawDTO(); - dto.setMerchantId(merchantId); - dto.setFeeAmt("0"); - try { - adapayService.drawCash(dto); - } catch (BaseAdaPayException e) { - throw new RuntimeException(e); + public void automaticPayouts() { + // TODO 查询开启自动提现运营商列表 + List pileMerchantInfos = pileMerchantInfoService.selectPileMerchantInfoList(null); + if (CollectionUtils.isEmpty(pileMerchantInfos)) { + log.info("定时任务,自动提现, 未查询到运营商列表,直接返回"); + return; } + + // 调提现方法 + pileMerchantInfos.parallelStream().forEach(merchant -> { + try { + WithdrawDTO dto = new WithdrawDTO(); + dto.setMerchantId(merchant.getId() + ""); + dto.setFeeAmt("0"); + adapayService.drawCash(dto); + } catch (Exception e) { + log.error("生成运营商日报异常, merchantId:{}", merchant.getId(), e); + } + }); } + }