Authored by chenchao

fix bug 5123

... ... @@ -34,6 +34,7 @@ public class ActionStatusHold {
SHOW_BUYER_DELIVER_EXPRESS_STATUS_LIST = Arrays.asList(
OrderStatus.SELLER_SEND_OUT.getCode(),
OrderStatus.PLATFORM_CHECKING.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()
);
}
... ... @@ -65,7 +66,7 @@ public class ActionStatusHold {
return BuyerASH.SHOW_EXPRESS_STATUS_LIST;
}
public static boolean buyerCanShowBuyerDeliverExpressStatusList(Integer status){
public static boolean buyerCanShowSellerDeliverExpressStatusList(Integer status){
return BuyerASH.SHOW_BUYER_DELIVER_EXPRESS_STATUS_LIST.contains(status);
}
... ...
... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service;
import com.yohobuy.ufo.model.order.common.OrderStatus;
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.ExpressInfoConstant;
import com.yohoufo.order.common.ActionStatusHold;
... ... @@ -85,6 +86,7 @@ public interface IExpressInfoService {
ExpressInfoRespBo queryLastExpressDetailInfo(Long orderCode,int type);
ExpressInfoDetail getLastExpressInfoDetail(TabType actor,int status, Long orderCode);
/**
* orderCode 一定是买家订单号
* @return
... ... @@ -144,10 +146,10 @@ public interface IExpressInfoService {
return types;
}
default Integer getExpressTypeBuyer(Integer status){
if (ActionStatusHold.buyerCanShowBuyerDeliverExpressStatusList(status)){
return ExpressInfoConstant.EXPRESS_TYPE_1;
default List<Integer> getExpressType4Buyer(Integer status){
if (ActionStatusHold.buyerCanShowSellerDeliverExpressStatusList(status)){
return Arrays.asList(ExpressInfoConstant.EXPRESS_TYPE_1);
}
return ExpressInfoConstant.EXPRESS_TYPE_2;
return Arrays.asList(ExpressInfoConstant.EXPRESS_TYPE_2,ExpressInfoConstant.EXPRESS_TYPE_1);
}
}
... ...
... ... @@ -88,17 +88,8 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
if (!ActionStatusHold.getBuyerShowExpressStatusList().contains(orderStatus.getCode())){
return null;
}
Integer type = expressInfoService.getExpressTypeBuyer(orderStatus.getCode());
ExpressInfoDetail lastEID = null;
ExpressInfoRespBo expressInfoResp = expressInfoService.queryLastExpressDetailInfo(orderCode, type);
List<ExpressInfoDetail> eidList;
if (Objects.nonNull(expressInfoResp)
&& Objects.nonNull(eidList=expressInfoResp.getExpressInfoDetailList())
&& eidList.size() > 0
){
lastEID = eidList.get(0);
}
ExpressInfoDetail lastEID = expressInfoService.getLastExpressInfoDetail(TabType.BUY, orderStatus.getCode(),
orderCode);
return lastEID;
}
... ...
... ... @@ -38,6 +38,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author kun.wang
... ... @@ -338,6 +339,35 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
return expressInfoRespBo;
}
@Override
public ExpressInfoDetail getLastExpressInfoDetail(TabType actor, int status, Long orderCode) {
List<Integer> types = null;
if(actor == TabType.SELL){
types = getExpressTypes4Seller(status);
}
if (actor == TabType.BUY){
types = getExpressType4Buyer(status);
}
if (CollectionUtils.isEmpty(types)){
return null;
}
//from big 2 small
List<Integer> sortedTypes = types.stream().sorted((o1,o2)-> o2-o1).collect(Collectors.toList());
ExpressInfoDetail lastEID = null;
for(Integer type : sortedTypes){
ExpressInfoRespBo expressInfoResp = queryLastExpressDetailInfo(orderCode, type);
List<ExpressInfoDetail> eidList;
if (Objects.nonNull(expressInfoResp)
&& Objects.nonNull(eidList=expressInfoResp.getExpressInfoDetailList())
&& eidList.size() > 0
){
lastEID = eidList.get(0);
break;
}
}
return lastEID;
}
/**
* @param expressInfoList
... ...
... ... @@ -183,24 +183,8 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
if (!ActionStatusHold.getSellerShowExpressStatusList().contains(orderStatus.getCode())){
return null;
}
List<Integer> types = expressInfoService.getExpressTypes4Seller(orderStatus.getCode());
if (CollectionUtils.isEmpty(types)){
return null;
}
//from big 2 small
List<Integer> sortedTypes = types.stream().sorted((o1,o2)-> o2-o1).collect(Collectors.toList());
ExpressInfoDetail lastEID = null;
for(Integer type : sortedTypes){
ExpressInfoRespBo expressInfoResp = expressInfoService.queryLastExpressDetailInfo(orderCode, type);
List<ExpressInfoDetail> eidList;
if (Objects.nonNull(expressInfoResp)
&& Objects.nonNull(eidList=expressInfoResp.getExpressInfoDetailList())
&& eidList.size() > 0
){
lastEID = eidList.get(0);
break;
}
}
ExpressInfoDetail lastEID = expressInfoService.getLastExpressInfoDetail(TabType.SELL,orderStatus.getCode(),
orderCode);
return lastEID;
}
... ...