Authored by qinchao

物流返回增加 发货方描述

  1 +package com.yohoufo.common.constant;
  2 +
  3 +import com.google.common.collect.Lists;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 物流发货方
  9 + */
  10 +public enum EnumExpressSender {
  11 + seller("卖家物流", Lists.newArrayList(ExpressInfoConstant.EXPRESS_TYPE_1.intValue())),
  12 + yoho("有货平台物流", Lists.newArrayList(ExpressInfoConstant.EXPRESS_TYPE_2.intValue(),ExpressInfoConstant.EXPRESS_TYPE_3.intValue()));
  13 +
  14 + private String name;
  15 + private List<Integer> containsExpressType;
  16 +
  17 + EnumExpressSender(String name,List<Integer> containsExpressType){
  18 + this.name = name;
  19 + this.containsExpressType = containsExpressType;
  20 + }
  21 +
  22 + public static String getSenderName(Integer type){
  23 + for(EnumExpressSender sender:EnumExpressSender.values()){
  24 + if(sender.containsExpressType.contains(type)){
  25 + return sender.name;
  26 + }
  27 + }
  28 + return "";
  29 + }
  30 +}
@@ -8,6 +8,7 @@ import com.yoho.error.exception.ServiceException; @@ -8,6 +8,7 @@ import com.yoho.error.exception.ServiceException;
8 import com.yohobuy.ufo.model.order.common.TabType; 8 import com.yohobuy.ufo.model.order.common.TabType;
9 import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail; 9 import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
10 import com.yohobuy.ufo.model.order.resp.ExpressInfoRespBo; 10 import com.yohobuy.ufo.model.order.resp.ExpressInfoRespBo;
  11 +import com.yohoufo.common.constant.EnumExpressSender;
11 import com.yohoufo.common.constant.ExpressInfoConstant; 12 import com.yohoufo.common.constant.ExpressInfoConstant;
12 import com.yohoufo.common.utils.DateUtil; 13 import com.yohoufo.common.utils.DateUtil;
13 import com.yohoufo.dal.order.*; 14 import com.yohoufo.dal.order.*;
@@ -277,6 +278,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -277,6 +278,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
277 expressInfoRespBo.setExpressInfoDetailList(expressInfoDetailList); 278 expressInfoRespBo.setExpressInfoDetailList(expressInfoDetailList);
278 // 快递单号 279 // 快递单号
279 expressInfoRespBo.setWayBillCode(expressInfoList.get(0).getWaybillCode()); 280 expressInfoRespBo.setWayBillCode(expressInfoList.get(0).getWaybillCode());
  281 + //物流类型
  282 + expressInfoRespBo.setExpressType(expressInfoList.get(0).getExpressType());
  283 + //物流发货方
  284 + expressInfoRespBo.setExpressSender(EnumExpressSender.getSenderName(expressInfoRespBo.getExpressType().intValue()));
280 // 快递公司名称 285 // 快递公司名称
281 expressInfoRespBo.setExpressCompanyName(expressCompanyService.getExpressName(expressInfoList.get(0).getLogisticsType())); 286 expressInfoRespBo.setExpressCompanyName(expressCompanyService.getExpressName(expressInfoList.get(0).getLogisticsType()));
282 } 287 }