@ -18,6 +18,7 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.stereotype.Component ;
import java.util.List ;
import java.util.Map ;
import java.util.Objects ;
@ -57,34 +58,40 @@ public class OpenOrderHandler {
}
//通过订单自编号去查询该条订单是属于哪个工厂
String orderSelfNum = orderNo ;
AdvanceEntity advanceEntity = advanceClient . getQueryDataOne ( orderSelfNum ) ;
if ( Objects . isNull ( advanceEntity ) ) {
// 汇通运单号
String logiBillNo = orderInfoDTO . getLogiBillNo ( ) ;
List < AdvanceEntity > advanceEntitys = advanceClient . findAdvanceEntityByLogiBillNoAndOrderCode ( logiBillNo , orderSelfNum ) ;
if ( Objects . isNull ( advanceEntitys ) ) {
log . info ( "##################openOrderStatusHandler: 未找到对应订单 orderNo={}" , orderNo ) ;
// channel.basicAck(deliveryTag,true);
return ;
}
String type = advanceEntity . getType ( ) ; //品牌
for ( AdvanceEntity advanceEntity : advanceEntitys ) {
String type = advanceEntity . getType ( ) ; //品牌
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 ;
orderInfoDTO . setOrderNo ( orderNo ) ;
orderInfoDTO . setDeliveryNumber ( advanceEntity . getMctsTruckNo ( ) ) ;
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 ) ;
} 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);
}
}
}