Authored by qinchao

获取辅助物流

... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.yoho.core.rabbitmq.YhProducer;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
... ... @@ -255,6 +256,21 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
LOGGER.info("getExpressType result = {}", expressType);
List<ExpressInfo> expressInfoList = expressInfoMapper.selectAllExpressInfo(uid, orderCode, expressType);
processExpressInfo(expressInfoList, expressInfoRespBo);
//获取上一阶段的辅助物流信息
List<ExpressInfoDetail> supplementExpressInfoDetailList = Lists.newArrayList();
expressInfoRespBo.setSupplementExpressInfoDetailList(supplementExpressInfoDetailList);
if(expressType.intValue()!=0&&ExpressInfoConstant.EXPRESS_TYPE_1.intValue()!=expressType.intValue()){
if(ExpressInfoConstant.EXPRESS_TYPE_2.intValue()==expressType.intValue()){
//买家这个时候需要看买家的物流
List<ExpressInfo> previousExpressInfoList = expressInfoMapper.selectAllExpressInfo(buyerOrder.getSellerUid(), orderCode, ExpressInfoConstant.EXPRESS_TYPE_1);
constructExpressInfo(previousExpressInfoList, supplementExpressInfoDetailList);
}else if(ExpressInfoConstant.EXPRESS_TYPE_3.intValue()==expressType.intValue()
||ExpressInfoConstant.EXPRESS_TYPE_REBACK.intValue()==expressType.intValue()){
//卖家这个时候看自己上一阶段的物流
List<ExpressInfo> previousExpressInfoList = expressInfoMapper.selectAllExpressInfo(uid, orderCode, ExpressInfoConstant.EXPRESS_TYPE_1);
constructExpressInfo(previousExpressInfoList, supplementExpressInfoDetailList);
}
}
LOGGER.info("queryExpressDetailInfo result = {}", JSON.toJSONString(expressInfoRespBo));
return expressInfoRespBo;
}
... ... @@ -305,6 +321,22 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
}
}
private void constructExpressInfo(List<ExpressInfo> expressInfoList, List<ExpressInfoDetail> supplementExpressInfoDetailList) {
if (CollectionUtils.isNotEmpty(expressInfoList)) {
ExpressInfoDetail expressInfoDetail;
for (ExpressInfo expressInfo : expressInfoList) {
expressInfoDetail = new ExpressInfoDetail();
// 运单接收地
expressInfoDetail.setAcceptAddress(expressInfo.getAcceptAddress());
// 运单信息
expressInfoDetail.setAcceptRemark(expressInfo.getAcceptRemark());
expressInfoDetail.setCreateTimeStr(DateUtil.formatDate(expressInfo.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
supplementExpressInfoDetailList.add(expressInfoDetail);
}
}
}
/**
* orderCode 一定是买家订单号
* @return
... ...