From e604971b285e9a1b68a6e8576f22fe94b5e945f1 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 28 Jun 2023 16:43:02 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8E=A8=E9=80=81=E7=9A=AE=E9=98=BF=E8=AF=BA?= =?UTF-8?q?=E5=BC=80=E5=8D=95=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factory/receiver/OpenOrderHandler.java | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java index 40cfcaf17..9d3cf9380 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java @@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.RabbitConstant; import org.springblade.common.exception.CustomerException; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitListener; @@ -48,34 +49,43 @@ public class OpenOrderHandler { String msg = new String(message.getBody()); log.info("##################我进入这里了 retryCount={}",retryCount++); OrderInfoDTO orderInfoDTO = (OrderInfoDTO) map.get("messageData"); - String orderNo = orderInfoDTO.getOrderNo();//订单自编号 - //通过订单自编号去查询该条订单是属于哪个工厂 - AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderNo); - if(Objects.isNull(advanceEntity)){ - log.info("##################openOrderStatusHandler: 未找到对应订单 orderNo={}",orderNo); + String orderNoStr = orderInfoDTO.getOrderNo();//订单自编号 + String[] split = orderNoStr.split(","); + for (String orderNo:split){ + if(StringUtil.isBlank(orderNo)){ + continue; + } + //通过订单自编号去查询该条订单是属于哪个工厂 + AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderNo); + if(Objects.isNull(advanceEntity)){ + log.info("##################openOrderStatusHandler: 未找到对应订单 orderNo={}",orderNo); // channel.basicAck(deliveryTag,true); - return; - } - String type = advanceEntity.getType();//品牌 + return; + } + String type = advanceEntity.getType();//品牌 - R r = null; - switch (type){ - case FactoryConstant.PIANO: - r = panFactoryDataService.handleData(orderInfoDTO); - int code = r.getCode(); - if(code == 400 || code == 200){ - log.info("##################openOrderStatusHandler: 该条数据不用处理 orderNo={}",orderNo); + orderInfoDTO.setOrderNo(orderNo); + R r = null; + switch (type){ + case FactoryConstant.PIANO: + r = panFactoryDataService.handleData(orderInfoDTO); + int code = r.getCode(); + if(code == 400 || code == 200){ + log.info("##################openOrderStatusHandler: 该条数据不用处理 orderNo={}",orderNo); // channel.basicAck(deliveryTag,true); - }else{ - throw new CustomerException(code,r.getMsg()); - } - break; + }else{ + throw new CustomerException(code,r.getMsg()); + } + break; // case FactoryConstant.MENGT: // r = mtFactoryDataService.handleData(orderInfoDTO); // break; - default: - log.info("##################openOrderStatusHandler: 未知品牌 type={}",type); + default: + log.info("##################openOrderStatusHandler: 未知品牌 type={}",type); // channel.basicAck(deliveryTag,true); + } } + + } }