From c725f357787cf74e6545b640a33df202267c90d4 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Fri, 21 Feb 2025 15:50:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E8=BF=90=E8=90=A5=E5=95=86?= =?UTF-8?q?=E6=97=A5=E6=8A=A5=E8=A1=A8=20=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jsowell/quartz/task/JsowellTask.java | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 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 14d3ba4ef..40a8d87b8 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 @@ -192,7 +192,7 @@ public class JsowellTask { } /** - * 定时任务, 生成运营商日报方法 + * 定时任务, 订单分账 * jsowellTask.processOrderSplitting() */ public void processOrderSplitting() { @@ -206,17 +206,40 @@ public class JsowellTask { LocalDate yesterday = LocalDate.now().plusDays(-1); // 设置挡板,8月1号之后的订单按照实际进行分账 - LocalDateTime now = LocalDateTime.now(); - LocalDateTime dateTime = LocalDateTime.of(2023, 8, 2, 0, 0, 0); - if (now.isBefore(dateTime)) { - log.info("当前时间:{}早于:{}, 不进行分账处理", DateUtils.formatDateTime(now), DateUtils.formatDateTime(dateTime)); - return; - } + // LocalDateTime now = LocalDateTime.now(); + // LocalDateTime dateTime = LocalDateTime.of(2023, 8, 2, 0, 0, 0); + // if (now.isBefore(dateTime)) { + // log.info("当前时间:{}早于:{}, 不进行分账处理", DateUtils.formatDateTime(now), DateUtils.formatDateTime(dateTime)); + // return; + // } + + // 调生成运营商日报方法 + pileMerchantInfos.parallelStream().forEach(merchant -> { + try { + orderBasicInfoService.orderSplittingOperations(merchant.getId() + "", yesterday.toString()); + } catch (Exception e) { + log.error("生成运营商日报异常, merchantId:{}", merchant.getId(), e); + } + }); + } + + /** + * 生成运营商日报表 + * jsowellTask.generateMerchantBill() + */ + public void generateMerchantBill() { + // 查询运营商列表 + List pileMerchantInfos = pileMerchantInfoService.selectPileMerchantInfoList(null); + if (CollectionUtils.isEmpty(pileMerchantInfos)) { + log.info("定时任务,处理订单分账, 未查询到运营商列表,直接返回"); + return; + } + // 获取日期 + LocalDate yesterday = LocalDate.now().plusDays(-1); // 调生成运营商日报方法 pileMerchantInfos.parallelStream().forEach(merchant -> { try { - // orderBasicInfoService.orderSplittingOperations(merchant.getId() + "", yesterday.toString()); orderBasicInfoService.generateMerchantBill(merchant.getId() + "", yesterday.toString()); } catch (Exception e) { log.error("生成运营商日报异常, merchantId:{}", merchant.getId(), e);