Authored by LUOXC

添加买家寄存召回场景

... ... @@ -51,17 +51,19 @@ public class ExpressInfoController {
* tabType 为后加的属性,为兼容老版本,故设置为非必须,但是新版本要求必须传。。 20181207
*
* @param orderCode
* @param scene 1:寄回阶段物流信息
* @return
*/
@RequestMapping(params = "method=ufo.order.expressDetailInfo")
public ApiResponse queryExpressDetailInfo(@RequestParam("uid") Integer uid,
@RequestParam("orderCode") Long orderCode,
@RequestParam(value = "tabType",required = false) String tabType) {
@RequestParam(value = "tabType",required = false) String tabType,
@RequestParam(value = "scene",required = false) Integer scene) {
TabType actor = null;
if(StringUtils.isNotBlank(tabType)){
actor = TabType.getTabType(tabType);
}
ExpressInfoRespBo expressInfoRespBo = expressInfoService.queryExpressDetailInfo(uid,orderCode,actor);
ExpressInfoRespBo expressInfoRespBo = expressInfoService.queryExpressDetailInfo(uid,orderCode,actor,scene);
return new ApiResponse.ApiResponseBuilder().code(200).data(expressInfoRespBo).build();
}
... ...
... ... @@ -87,7 +87,7 @@ public interface IExpressInfoService {
* @param orderCode
* @return
*/
ExpressInfoRespBo queryExpressDetailInfo(Integer uid, Long orderCode, TabType actor);
ExpressInfoRespBo queryExpressDetailInfo(Integer uid, Long orderCode, TabType actor,Integer scene);
/**
* 根据用户默认地址的省份定位到鉴定中心的地址返回
... ...
... ... @@ -394,7 +394,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
* @return
*/
@Override
public ExpressInfoRespBo queryExpressDetailInfo(Integer uid,Long orderCode,TabType actor) {
public ExpressInfoRespBo queryExpressDetailInfo(Integer uid,Long orderCode,TabType actor,Integer scene) {
LOGGER.info("queryExpressDetailInfo uid={}, orderCode = {},actor = {} ",uid, orderCode,actor);
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
if (buyerOrder == null){
... ... @@ -492,8 +492,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
constructSupplementExpress( actor,orderCode,expressTypeList.get(0),expressInfoRespBo);
}
//5.设定三个阶段的信息
buildExpressStage(actor,buyerOrder.getStatus(), expressInfoRespBo);
//5.设定阶段的信息
expressInfoRespBo.setStage(new ExpressStageBuilder(actor, buyerOrder.getStatus())
.scene(scene)
.expressInfoRespBo(expressInfoRespBo)
.build());
//鉴定阶段的物流仍然属于卖家
if(expressInfoRespBo.getExpressType()!=null&&EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode()==expressInfoRespBo.getExpressType().intValue()){
... ... @@ -510,50 +513,6 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
return expressInfoRespBo;
}
private void buildExpressStage(TabType actor,int status,ExpressInfoRespBo expressInfoRespBo ){
// 1 卖家发货 -- 平台鉴定 -- 交易成功 ,其中卖家发货点亮
// 2 卖家发货 == 平台鉴定 -- 交易成功 ,其中卖家发货和平台鉴定点亮
// 3 卖家发货 == 平台鉴定 == 交易成功 ,全部点亮
// 4 卖家发货 == 平台鉴定 == 交易失败 ,全部点亮
//5 卖家发货 == 交易关闭 ,全部点亮
expressInfoRespBo.setStage(1);
if(OrderStatus.PLATFORM_RECEIVE.getCode()==status
||OrderStatus.PLATFORM_CHECKING.getCode()==status
||OrderStatus.MINI_FAULT_WAITING.getCode()==status){
expressInfoRespBo.setStage(2);
}else if(OrderStatus.MINI_FAULT_ACCEPT.getCode()==status
||OrderStatus.JUDGE_PASS.getCode()==status
||OrderStatus.JUDGE_PASS_WAIT_WAREHOUSE.getCode()==status){
if(TabType.BUY==actor){
//买家
expressInfoRespBo.setStage(2);
}else{
//卖家
expressInfoRespBo.setStage(3);
}
}else if(OrderStatus.WAITING_RECEIVE.getCode()==status){
if(TabType.BUY==actor){
//买家
expressInfoRespBo.setStage(2);
}else{
//卖家
expressInfoRespBo.setStage(3);
}
}else if(OrderStatus.DONE.getCode()==status){
expressInfoRespBo.setStage(3);
}else if(OrderStatus.CHECKING_FAKE.getCode()==status
||OrderStatus.QUALITY_CHECK_FAKE.getCode()==status
||OrderStatus.MINI_FAULT_REJECT.getCode()==status
||OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode()==status
||OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()==status
||OrderStatus.PLATFORM_BLOWN_CUSTOMS_CLEARANCE.getCode()==status
||OrderStatus.BUYER_BLOWN_CUSTOMS_CLEARANCE.getCode()==status){
expressInfoRespBo.setStage(4);
}else if(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()==status){
expressInfoRespBo.setStage(5);
}
}
private void constructSupplementExpress(TabType actor,Long orderCode,Integer expressType,ExpressInfoRespBo expressInfoRespBo){
if(EnumExpressType.EXPRESS_TYPE_2.getCode().intValue()==expressType.intValue()
||EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().intValue()==expressType.intValue()){
... ... @@ -859,6 +818,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
expressInfoDetail.setAcceptRemark(expressInfo.getAcceptRemark());
expressInfoDetail.setCreateTimeStr(DateUtil.formatDate(expressInfo.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
expressInfoDetail.setState(expressInfo.getState());
//确认信息
... ...
package com.yohoufo.order.service.impl;
import com.google.common.collect.Lists;
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 lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import java.util.Objects;
@Setter
@Accessors(fluent = true)
public class ExpressStageBuilder {
final TabType actor;
final int status;
ExpressInfoRespBo expressInfoRespBo;
Integer scene;
public ExpressStageBuilder(TabType actor, int status) {
this.actor = actor;
this.status = status;
}
/**
* @return 物流所处阶段
* <p>
* 1 卖家发货 -- 平台鉴定 -- 交易成功 ,其中卖家发货点亮
* 2 卖家发货 == 平台鉴定 -- 交易成功 ,其中卖家发货和平台鉴定点亮
* 3 卖家发货 == 平台鉴定 == 交易成功 ,全部点亮
* 4 卖家发货 == 平台鉴定 == 交易失败 ,全部点亮
* 5 卖家发货 == 交易关闭 ,全部点亮
* 6 平台发货 == 交易成功 ,平台发货点亮
* 7 平台发货 == 交易成功 ,全部点亮
* </p>
*/
public int build() {
// 寄存召回
if (Integer.valueOf(1).equals(scene)) {
if (TabType.BUY == actor) {
expressInfoRespBo.setExpressInfoDetailTitle(StringUtils.EMPTY);
expressInfoRespBo.setJudgeExpressInfoDetailTitle(StringUtils.EMPTY);
expressInfoRespBo.setExpressInfoDetailList(Lists.newArrayList());
expressInfoRespBo.setJudgeExpressInfoDetailList(Lists.newArrayList());
boolean isDone = expressInfoRespBo.getSupplementExpressInfoDetailList()
.stream()
.map(ExpressInfoDetail::getState)
.filter(Objects::nonNull)
.filter(e -> e == ExpressInfoConstant.EXPRESS_STATUS_SIGN)
.findFirst()
.isPresent();
return isDone ? 7 : 6;
} else {
return 3;
}
}
if (OrderStatus.PLATFORM_RECEIVE.getCode() == status
|| OrderStatus.PLATFORM_CHECKING.getCode() == status
|| OrderStatus.MINI_FAULT_WAITING.getCode() == status) {
return 2;
} else if (OrderStatus.MINI_FAULT_ACCEPT.getCode() == status
|| OrderStatus.JUDGE_PASS.getCode() == status
|| OrderStatus.JUDGE_PASS_WAIT_WAREHOUSE.getCode() == status
|| OrderStatus.WAITING_RECEIVE.getCode() == status) {
return TabType.BUY == actor ? 2 : 3;
} else if (OrderStatus.DONE.getCode() == status) {
return 3;
} else if (OrderStatus.CHECKING_FAKE.getCode() == status
|| OrderStatus.QUALITY_CHECK_FAKE.getCode() == status
|| OrderStatus.MINI_FAULT_REJECT.getCode() == status
|| OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode() == status
|| OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode() == status
|| OrderStatus.PLATFORM_BLOWN_CUSTOMS_CLEARANCE.getCode() == status
|| OrderStatus.BUYER_BLOWN_CUSTOMS_CLEARANCE.getCode() == status) {
return 4;
} else if (OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode() == status) {
return 5;
} else {
return 1;
}
}
}
... ...