diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java index 9d180895a..3172fd663 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java @@ -241,7 +241,12 @@ public interface RabbitConstant { String AFTERSALES_OVER_TIME_ROUTING = "aftersales_over_time_routing" + ModuleNameConstant.DEVAUTH; - + /** + * 更新订单信息 + */ + String ORDER_INFO_UPDATE_QUEUE = "order_info_update_queue" + ModuleNameConstant.DEVAUTH; + String ORDER_INFO_UPDATE_EXCHANGE = "order_info_update_exchange" + ModuleNameConstant.DEVAUTH; + String ORDER_INFO_UPDATE_ROUTING = "order_info_update_routing" + ModuleNameConstant.DEVAUTH; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderInfoUpdateHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderInfoUpdateHandler.java new file mode 100644 index 000000000..bf4e07cdd --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderInfoUpdateHandler.java @@ -0,0 +1,41 @@ +package com.logpm.distribution.receiver; + +import cn.hutool.json.JSONUtil; +import com.logpm.distribution.entity.DistributionStockArticleEntity; +import com.logpm.distribution.service.IDistributionStockArticleService; +import com.rabbitmq.client.Channel; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.RabbitConstant; +import org.springblade.common.constant.factorydata.FactoryDataConstants; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.amqp.core.ExchangeTypes; +import org.springframework.amqp.rabbit.annotation.Exchange; +import org.springframework.amqp.rabbit.annotation.Queue; +import org.springframework.amqp.rabbit.annotation.QueueBinding; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.stereotype.Component; + +@Slf4j +@Component +@AllArgsConstructor +public class OrderInfoUpdateHandler { + + private final IDistributionStockArticleService distributionStockArticleService; + + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = RabbitConstant.ORDER_INFO_UPDATE_QUEUE, durable = "true"), + exchange = @Exchange(name = RabbitConstant.ORDER_INFO_UPDATE_EXCHANGE, + type = ExchangeTypes.DIRECT, + delayed = FactoryDataConstants.Mq.DELAYED) + )) + public void updateOrderInfo(String msg, Channel channel) { + if(StringUtil.isNotBlank(msg)){ + DistributionStockArticleEntity bean = JSONUtil.toBean(msg, DistributionStockArticleEntity.class); + + distributionStockArticleService.updateOrderInfoByDistributionStockArticleEntity(bean); + + } + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java index 822b352ea..c6379fae2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java @@ -332,4 +332,6 @@ public interface IDistributionStockArticleService extends BaseService pageListOweNew(IPage page, Map distributionStockArticle); + + void updateOrderInfoByDistributionStockArticleEntity(DistributionStockArticleEntity bean); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 4f34d6a7e..8a3c4f443 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -51,6 +51,8 @@ import com.logpm.distribution.vo.app.queryOrderVO; import com.logpm.distribution.wrapper.DistributionParcelListWrapper; import com.logpm.distribution.wrapper.DistributionStockArticleNewWrapper; import com.logpm.distribution.wrapper.DistributionStockArticleWrapper; +import com.logpm.factorydata.feign.IFactoryDataClient; +import com.logpm.factorydata.vo.SendMsg; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient; import com.logpm.warehouse.entity.WarehouseWayBillDetail; @@ -60,6 +62,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DictBizConstant; +import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.loading.LoadingStatusConstant; import org.springblade.common.constant.order.OrderReservationStatusConstant; @@ -140,6 +143,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl selectDistributionStockArticlePage(IPage page, DistributionStockArticleVO distributionStockArticle) { @@ -1502,6 +1506,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl>>>> T updateOrdersInfo end"); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml index 7ec900ffb..cde4b100b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml @@ -12,6 +12,7 @@