Browse Source

feat(all): 配送模块

1 修改商配推送逻辑
dev
zhaoqiaobo 4 days ago
parent
commit
ac0ee9960f
  1. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java

12
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<ReportService> 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());

Loading…
Cancel
Save