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()));
seller("卖家物流", ExpressInfoConstant.EXPRESS_TYPE_1.intValue()),
yoho_to_buyer("有货平台物流", ExpressInfoConstant.EXPRESS_TYPE_2.intValue()),
yoho_to_seller_appraise_fail("有货平台物流", ExpressInfoConstant.EXPRESS_TYPE_3.intValue()),
yoho_to_seller_return_back("有货平台物流", ExpressInfoConstant.EXPRESS_TYPE_REBACK.intValue()),;
private String name;
private List<Integer> containsExpressType;
private int expressType;
EnumExpressSender(String name,List<Integer> containsExpressType){
EnumExpressSender(String name,int expressType){
this.name = name;
this.containsExpressType = containsExpressType;
this.expressType = expressType;
}
public static String getSenderName(Integer type){
public static String getSenderName(int type){
for(EnumExpressSender sender:EnumExpressSender.values()){
if(sender.containsExpressType.contains(type)){
if(sender.expressType==type){
return sender.name;
}
}
... ...
... ... @@ -27,6 +27,7 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.ProductProxyService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -300,7 +301,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
expressInfoRespBo.setSupplementExpressInfoDetailList(supplementExpressInfoDetailList);
if(expressType.intValue()!=0&&ExpressInfoConstant.EXPRESS_TYPE_1.intValue()!=expressType.intValue()){
if(ExpressInfoConstant.EXPRESS_TYPE_2.intValue()==expressType.intValue()){
//买家这个时候需要看买家的物流
//买家这个时候需要看卖家的物流
//设置物流提示头信息
if(StringUtils.isBlank(expressInfoRespBo.getExpressSender())){
expressInfoRespBo.setExpressSender(EnumExpressSender.getSenderName(ExpressInfoConstant.EXPRESS_TYPE_1.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()
... ...