Authored by qinchao

物流返回增加 发货方描述

package com.yohoufo.common.constant;
import com.google.common.collect.Lists;
import java.util.List;
/**
* 物流发货方
*/
public enum EnumExpressSender {
seller("卖家物流", Lists.newArrayList(ExpressInfoConstant.EXPRESS_TYPE_1.intValue())),
yoho("有货平台物流", Lists.newArrayList(ExpressInfoConstant.EXPRESS_TYPE_2.intValue(),ExpressInfoConstant.EXPRESS_TYPE_3.intValue()));
private String name;
private List<Integer> containsExpressType;
EnumExpressSender(String name,List<Integer> containsExpressType){
this.name = name;
this.containsExpressType = containsExpressType;
}
public static String getSenderName(Integer type){
for(EnumExpressSender sender:EnumExpressSender.values()){
if(sender.containsExpressType.contains(type)){
return sender.name;
}
}
return "";
}
}
... ...
... ... @@ -8,6 +8,7 @@ import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
import com.yohobuy.ufo.model.order.resp.ExpressInfoRespBo;
import com.yohoufo.common.constant.EnumExpressSender;
import com.yohoufo.common.constant.ExpressInfoConstant;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.*;
... ... @@ -277,6 +278,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
expressInfoRespBo.setExpressInfoDetailList(expressInfoDetailList);
// 快递单号
expressInfoRespBo.setWayBillCode(expressInfoList.get(0).getWaybillCode());
//物流类型
expressInfoRespBo.setExpressType(expressInfoList.get(0).getExpressType());
//物流发货方
expressInfoRespBo.setExpressSender(EnumExpressSender.getSenderName(expressInfoRespBo.getExpressType().intValue()));
// 快递公司名称
expressInfoRespBo.setExpressCompanyName(expressCompanyService.getExpressName(expressInfoList.get(0).getLogisticsType()));
}
... ...