Authored by qinchao

获取辅助物流

@@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl; @@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl;
2 2
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
  5 +import com.google.common.collect.Lists;
5 import com.yoho.core.rabbitmq.YhProducer; 6 import com.yoho.core.rabbitmq.YhProducer;
6 import com.yoho.error.ServiceError; 7 import com.yoho.error.ServiceError;
7 import com.yoho.error.exception.ServiceException; 8 import com.yoho.error.exception.ServiceException;
@@ -255,6 +256,21 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -255,6 +256,21 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
255 LOGGER.info("getExpressType result = {}", expressType); 256 LOGGER.info("getExpressType result = {}", expressType);
256 List<ExpressInfo> expressInfoList = expressInfoMapper.selectAllExpressInfo(uid, orderCode, expressType); 257 List<ExpressInfo> expressInfoList = expressInfoMapper.selectAllExpressInfo(uid, orderCode, expressType);
257 processExpressInfo(expressInfoList, expressInfoRespBo); 258 processExpressInfo(expressInfoList, expressInfoRespBo);
  259 + //获取上一阶段的辅助物流信息
  260 + List<ExpressInfoDetail> supplementExpressInfoDetailList = Lists.newArrayList();
  261 + expressInfoRespBo.setSupplementExpressInfoDetailList(supplementExpressInfoDetailList);
  262 + if(expressType.intValue()!=0&&ExpressInfoConstant.EXPRESS_TYPE_1.intValue()!=expressType.intValue()){
  263 + if(ExpressInfoConstant.EXPRESS_TYPE_2.intValue()==expressType.intValue()){
  264 + //买家这个时候需要看买家的物流
  265 + List<ExpressInfo> previousExpressInfoList = expressInfoMapper.selectAllExpressInfo(buyerOrder.getSellerUid(), orderCode, ExpressInfoConstant.EXPRESS_TYPE_1);
  266 + constructExpressInfo(previousExpressInfoList, supplementExpressInfoDetailList);
  267 + }else if(ExpressInfoConstant.EXPRESS_TYPE_3.intValue()==expressType.intValue()
  268 + ||ExpressInfoConstant.EXPRESS_TYPE_REBACK.intValue()==expressType.intValue()){
  269 + //卖家这个时候看自己上一阶段的物流
  270 + List<ExpressInfo> previousExpressInfoList = expressInfoMapper.selectAllExpressInfo(uid, orderCode, ExpressInfoConstant.EXPRESS_TYPE_1);
  271 + constructExpressInfo(previousExpressInfoList, supplementExpressInfoDetailList);
  272 + }
  273 + }
258 LOGGER.info("queryExpressDetailInfo result = {}", JSON.toJSONString(expressInfoRespBo)); 274 LOGGER.info("queryExpressDetailInfo result = {}", JSON.toJSONString(expressInfoRespBo));
259 return expressInfoRespBo; 275 return expressInfoRespBo;
260 } 276 }
@@ -305,6 +321,22 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -305,6 +321,22 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
305 } 321 }
306 } 322 }
307 323
  324 +
  325 + private void constructExpressInfo(List<ExpressInfo> expressInfoList, List<ExpressInfoDetail> supplementExpressInfoDetailList) {
  326 + if (CollectionUtils.isNotEmpty(expressInfoList)) {
  327 + ExpressInfoDetail expressInfoDetail;
  328 + for (ExpressInfo expressInfo : expressInfoList) {
  329 + expressInfoDetail = new ExpressInfoDetail();
  330 + // 运单接收地
  331 + expressInfoDetail.setAcceptAddress(expressInfo.getAcceptAddress());
  332 + // 运单信息
  333 + expressInfoDetail.setAcceptRemark(expressInfo.getAcceptRemark());
  334 + expressInfoDetail.setCreateTimeStr(DateUtil.formatDate(expressInfo.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
  335 + supplementExpressInfoDetailList.add(expressInfoDetail);
  336 + }
  337 + }
  338 + }
  339 +
308 /** 340 /**
309 * orderCode 一定是买家订单号 341 * orderCode 一定是买家订单号
310 * @return 342 * @return