Browse Source

1.推送皮阿诺开单数据逻辑修改

dev-warehouse
zhenghaoyu 2 years ago
parent
commit
e604971b28
  1. 52
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java

52
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);
}
}
}
}

Loading…
Cancel
Save