From 55be38fb5eec9e14dc0c3b74aba7ff36f922cc4b Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Fri, 24 May 2024 17:00:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E5=A2=9E=E5=8A=A0=E7=9A=AE?= =?UTF-8?q?=E9=98=BF=E8=AF=BA=E7=AD=BE=E6=94=B6=E6=95=B0=E6=8D=AE=E5=9B=9E?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DistributionAsyncServiceImpl.java | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index 0bc8e7664..5ff0481fc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -2,6 +2,7 @@ package com.logpm.distribution.service.impl; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; @@ -43,6 +44,7 @@ import org.springblade.common.constant.DistributionTypeConstant; import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; import org.springblade.common.constant.Inventory.InventoryPackageStatusConstant; import org.springblade.common.constant.Inventory.InventorySigningStatusConstant; +import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.WorkNodeEnums; import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant; @@ -62,6 +64,7 @@ import org.springblade.common.constant.stockup.StockupTypeConstant; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.secure.BladeUser; import org.springblade.core.tool.utils.Func; +import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; @@ -118,6 +121,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { private final ITrunklineWaybillTrackClient trunklineWaybillTrackClient; private final IWarehouseWaybillClient waybillClient; private final FactoryDataMessageSender factoryDataMessageSender; + private final RabbitTemplate rabbitTemplate; // private final @@ -1440,7 +1444,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { @Transactional(rollbackFor = Exception.class) @LogpmAsync("asyncExecutor") public void sendReviewFactory(Long signingId, String warehouseName, Long warehouseId) { - String brands = "梦天,欧派,志邦";//可追加 + String brands = "梦天,欧派,志邦,皮阿诺";//可追加 log.info(">>>>>>>>>>> 签收推送 对象 {}", "signingId:=" + signingId + "warehouseName:=" + warehouseName + "warehouseId:=" + warehouseId); //查询签收信息 DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(signingId); @@ -1565,6 +1569,28 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { factoryDataMessageSender.sendNodeDataByBrand(msg); } + if (Func.isNotEmpty(brand.get("皮阿诺"))) { + List zb = brand.get("皮阿诺"); + if (CollUtil.isNotEmpty(zb)) { + for (MtReceiveContentDTO mtReceiveContentDTO : zb) { + try { + // 发送入库消息 + com.logpm.distribution.dto.OrderStatusDTO orderStatusDTO = new com.logpm.distribution.dto.OrderStatusDTO(); + // 通过包件id 查询包件 + orderStatusDTO.setUnitNo(mtReceiveContentDTO.getUnitNo()); + orderStatusDTO.setOrderNo(mtReceiveContentDTO.getOrderCode()); + orderStatusDTO.setStatus("7"); + orderStatusDTO.setOperationTime(DateUtil.now()); + orderStatusDTO.setCurrentWarehouse(warehouseId.toString()); + Map map = new HashMap<>(); + map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO)); + rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map); + } catch (Exception e) { + log.error("入库推送失败:{}", e); + } + } + } + } //....工厂 } catch (Exception e) {