Authored by LUOXC

中通国际快递公司

package com.yohoufo.order.common;
import java.util.Objects;
public class LogisticsTypes {
/**
* 判断是否是中通国际快递公司
*
* @param logisticsType
* @return
*/
public static boolean isZtoInternational(Integer logisticsType) {
return Objects.isNull(logisticsType) ? false : logisticsType.intValue() == 76;
}
}
... ...
... ... @@ -14,6 +14,7 @@ import com.yohoufo.dal.order.ExpressRecordMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.ExpressInfo;
import com.yohoufo.dal.order.model.ExpressRecord;
import com.yohoufo.order.common.LogisticsTypes;
import com.yohoufo.order.model.bo.ErpExpressBo;
import com.yohoufo.order.mq.publisher.ConsumerExceptionPublisher;
import com.yohoufo.order.service.IBuyerOrderService;
... ... @@ -156,30 +157,9 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
expressInfo.setExpressType(initExpressType);
expressInfo.setState(state);
//清关失败和清关成功的物流信息,需要在OperateTransferCode记录下相应的code ,以便自动确认查询
if(ExpressInfoConstant.EXPRESS_CLEAR_SUCCESS.equals(state)){
//清关成功的纪录
// 中通国际快递公司,存在物流则表示清关成功
if (LogisticsTypes.isZtoInternational(logisticsType)) {
expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_success.getCode());
}else if(ExpressInfoConstant.EXPRESS_CLEAR_FAIL_CAUSE_PLATFORM.equals(state)){
//TODO 平台原因清关失败的信息记录下来,需要告诉order,退费
expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_fail_cause_platform.getCode());
/*暂时注释掉,等香港仓上线,中通物流返回信息未定
final CutomsClearanceFailType failType=CutomsClearanceFailType.PLATFORM;
LOGGER.info("call order clear fail interface,orderCode {},uid {},waybillCode {},state {} ,failType {}", orderCode,uid,waybillCode,state,failType);
executorService.execute(() -> {
buyerOrderCancelService.cancelOverseasOrder(orderCode, failType);
LOGGER.info("call order clear fail interface end,orderCode {},uid {},waybillCode {},state {},failType {} ", orderCode,uid,waybillCode,state,failType);
});*/
}else if(ExpressInfoConstant.EXPRESS_CLEAR_FAIL_CAUSE_BUYER.equals(state)){
//TODO 买家原因清关失败的信息记录下来,需要告诉order,退费
expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_fail_cause_buyer.getCode());
/*暂时注释掉,等香港仓上线,中通物流返回信息未定
final CutomsClearanceFailType failType=CutomsClearanceFailType.BUYER;
LOGGER.info("call order clear fail interface,orderCode {},uid {},waybillCode {},state {} ,failType {}", orderCode,uid,waybillCode,state,failType);
executorService.execute(() -> {
buyerOrderCancelService.cancelOverseasOrder(orderCode, failType);
LOGGER.info("call order clear fail interface end,orderCode {},uid {},waybillCode {},state {},failType {} ", orderCode,uid,waybillCode,state,failType);
});*/
}
expressInfoMapper.insert(expressInfo);
... ...