Authored by qinchao

物流

1 package com.yohoufo.common.constant; 1 package com.yohoufo.common.constant;
2 2
3 -import com.google.common.collect.Lists;  
4 -  
5 -import java.util.List;  
6 -  
7 /** 3 /**
8 * 物流发货方 4 * 物流发货方
9 */ 5 */
10 public enum EnumExpressSender { 6 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())); 7 + seller("卖家物流", ExpressInfoConstant.EXPRESS_TYPE_1.intValue()),
  8 + yoho_to_buyer("有货平台物流", ExpressInfoConstant.EXPRESS_TYPE_2.intValue()),
  9 + yoho_to_seller_appraise_fail("有货平台物流", ExpressInfoConstant.EXPRESS_TYPE_3.intValue()),
  10 + yoho_to_seller_return_back("有货平台物流", ExpressInfoConstant.EXPRESS_TYPE_REBACK.intValue()),;
  11 +
13 12
14 private String name; 13 private String name;
15 - private List<Integer> containsExpressType; 14 + private int expressType;
16 15
17 - EnumExpressSender(String name,List<Integer> containsExpressType){ 16 + EnumExpressSender(String name,int expressType){
18 this.name = name; 17 this.name = name;
19 - this.containsExpressType = containsExpressType; 18 + this.expressType = expressType;
20 } 19 }
21 20
22 - public static String getSenderName(Integer type){ 21 + public static String getSenderName(int type){
23 for(EnumExpressSender sender:EnumExpressSender.values()){ 22 for(EnumExpressSender sender:EnumExpressSender.values()){
24 - if(sender.containsExpressType.contains(type)){ 23 + if(sender.expressType==type){
25 return sender.name; 24 return sender.name;
26 } 25 }
27 } 26 }
@@ -27,6 +27,7 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder; @@ -27,6 +27,7 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder;
27 import com.yohoufo.order.service.proxy.InBoxFacade; 27 import com.yohoufo.order.service.proxy.InBoxFacade;
28 import com.yohoufo.order.service.proxy.ProductProxyService; 28 import com.yohoufo.order.service.proxy.ProductProxyService;
29 import org.apache.commons.collections.CollectionUtils; 29 import org.apache.commons.collections.CollectionUtils;
  30 +import org.apache.commons.lang3.StringUtils;
30 import org.slf4j.Logger; 31 import org.slf4j.Logger;
31 import org.slf4j.LoggerFactory; 32 import org.slf4j.LoggerFactory;
32 import org.springframework.beans.factory.annotation.Autowired; 33 import org.springframework.beans.factory.annotation.Autowired;
@@ -300,7 +301,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -300,7 +301,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
300 expressInfoRespBo.setSupplementExpressInfoDetailList(supplementExpressInfoDetailList); 301 expressInfoRespBo.setSupplementExpressInfoDetailList(supplementExpressInfoDetailList);
301 if(expressType.intValue()!=0&&ExpressInfoConstant.EXPRESS_TYPE_1.intValue()!=expressType.intValue()){ 302 if(expressType.intValue()!=0&&ExpressInfoConstant.EXPRESS_TYPE_1.intValue()!=expressType.intValue()){
302 if(ExpressInfoConstant.EXPRESS_TYPE_2.intValue()==expressType.intValue()){ 303 if(ExpressInfoConstant.EXPRESS_TYPE_2.intValue()==expressType.intValue()){
303 - //买家这个时候需要看买家的物流 304 + //买家这个时候需要看卖家的物流
  305 + //设置物流提示头信息
  306 + if(StringUtils.isBlank(expressInfoRespBo.getExpressSender())){
  307 + expressInfoRespBo.setExpressSender(EnumExpressSender.getSenderName(ExpressInfoConstant.EXPRESS_TYPE_1.intValue()));
  308 + }
  309 + //卖家物流详细
304 List<ExpressInfo> previousExpressInfoList = expressInfoMapper.selectAllExpressInfo(buyerOrder.getSellerUid(), orderCode, ExpressInfoConstant.EXPRESS_TYPE_1); 310 List<ExpressInfo> previousExpressInfoList = expressInfoMapper.selectAllExpressInfo(buyerOrder.getSellerUid(), orderCode, ExpressInfoConstant.EXPRESS_TYPE_1);
305 constructExpressInfo(previousExpressInfoList, supplementExpressInfoDetailList); 311 constructExpressInfo(previousExpressInfoList, supplementExpressInfoDetailList);
306 }else if(ExpressInfoConstant.EXPRESS_TYPE_3.intValue()==expressType.intValue() 312 }else if(ExpressInfoConstant.EXPRESS_TYPE_3.intValue()==expressType.intValue()