From ac0ee9960fe1632507bc8e5a29e10e5b831cbad9 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Wed, 15 Jan 2025 14:29:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E9=85=8D=E9=80=81=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改商配推送逻辑 --- .../distribution/receiver/report/ReportListener.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java index 7e927d1f3..bf8ffe6d4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java @@ -6,6 +6,8 @@ import cn.hutool.json.JSONArray; import cn.hutool.json.JSONUtil; import com.logpm.distribution.pros.DistributionProperties; import com.logpm.distribution.service.IQualityDeliverService; +import com.logpm.factorydata.feign.IFactoryDataClient; +import com.logpm.factorydata.vo.SendMsg; import com.rabbitmq.client.Channel; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -39,6 +41,7 @@ public class ReportListener { private final DistributionProperties destinationProperties; private final List reportServices; private final IQualityDeliverService qualityDeliverService; + private final IFactoryDataClient factoryDataClient; @RabbitListener(bindings = @QueueBinding( value = @Queue(name = FanoutConstants.DeliveryOfPickup.BillPlan.QUEUE.REPORT, durable = "true"), @@ -251,7 +254,14 @@ public class ReportListener { } if (flag) { try { - selectReportService(PlanReportListener.class).buildReport(msg); + // selectReportService(PlanReportListener.class).buildReport(msg); + // 延迟发送消息 延迟5秒 解决商配任务预约单未处理完的情况 + factoryDataClient.sendMessage(SendMsg.builder() + .exchange(FanoutConstants.distribution.DeliveryAndPlan.EXCHANGE_DELAY) + .routingKey(null) + .message(msg) + .delay(5000) + .build()); } catch (Exception e) { e.printStackTrace(); log.error("配送计划生成明细报表失败: {}", e.getMessage());