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);