Authored by tanling

订单详情显示鉴定中心

package com.yohoufo.order.model.response;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Builder;
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AppraiseAddressInfo {
String addressName;
String mobile;
String address;
}
... ...
... ... @@ -42,6 +42,11 @@ public class OrderDetailInfo {
* 卖家:寄回地址
*/
private AddressInfo userAddress;
/**
* 卖家指定的鉴定中心地址
*/
AppraiseAddressInfo appraiseAddress;
/**
* 按钮显示
*/
... ... @@ -102,6 +107,7 @@ public class OrderDetailInfo {
private Integer attributes;
@Builder
@Data
@AllArgsConstructor
... ...
... ... @@ -20,6 +20,7 @@ import com.yohoufo.order.constants.ViewType;
import com.yohoufo.order.convert.GoodsInfoConvertor;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohoufo.order.model.response.AppraiseAddressInfo;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.service.IExpressInfoService;
import com.yohoufo.order.service.IOrderDetailService;
... ... @@ -57,6 +58,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
abstract ExpressInfoDetail getExpressInfoDetail(OrderStatus orderStatus, long orderCode);
abstract AppraiseAddressInfo getAppraiseAddress(Integer depotNo, String areaCode);
abstract AddressInfo getHiddenAddressInfo(int uid, long orderCode, int skup);
... ... @@ -135,6 +137,8 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
OrderDetailInfo orderDetailInfo = buildOrderDetail(buildNode, actor);
orderDetailInfo.setAppraiseAddress(getAppraiseAddress(sellerOrderGoods.getDepotNo(), userAddress.getAreaCode()));
return orderDetailInfo;
}
... ...
... ... @@ -19,6 +19,7 @@ import com.yohoufo.dal.order.model.BuyerOrderMeta;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.common.ActionStatusHold;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.model.response.AppraiseAddressInfo;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.service.IOrderDetailService;
import com.yohoufo.order.service.handler.BuyerOrderButtonsHandler;
... ... @@ -103,6 +104,12 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
}
@Override
AppraiseAddressInfo getAppraiseAddress(Integer depotNo, String areaCode) {
return null;
}
@Override
AddressInfo getHiddenAddressInfo(int uid, long orderCode, int skup) {
BuyerOrderMeta buyerOrderMeta = getBuyerOrderMeta(uid,
orderCode, MetaKey.BUYER_DELIVERY_HIDDEN_ADDRESS);
... ...
... ... @@ -21,6 +21,8 @@ import com.yohoufo.order.convert.GoodsInfoConvertor;
import com.yohoufo.order.convert.SellerOrderConvertor;
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.AppraiseAddressInfo;
import com.yohoufo.order.model.response.AppraiseAddressResp;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.service.AbsSellerOrderViewService;
... ... @@ -42,6 +44,8 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* Created by chenchao on 2018/9/20.
... ... @@ -90,6 +94,47 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
@Autowired
private OrderOverTimeService orderOverTimeService;
@Autowired
private AppraiseAddressService appraiseAddressService;
/**
* 根据指定的鉴定中心返回地址详情
* @param areaCode
* @return
*/
public AppraiseAddressInfo getAppraiseAddress(Integer depotno, String areaCode){
// 卖家已经发货选定了鉴定中心
if (depotno != null){
List<AppraiseAddressResp> addressRespList = appraiseAddressService.queryAddressInfoList();
Map<Integer, AppraiseAddressResp> addressRespMap = addressRespList.stream()
.collect(Collectors.toMap(AppraiseAddressResp::getType, Function.identity(), (key1, key2)-> key1));
AppraiseAddressResp addressResp = addressRespMap.get(depotno);
if (addressResp != null){
return AppraiseAddressInfo.builder()
.address(addressResp.getAddress())
.addressName(addressResp.getAddressName())
.mobile(addressResp.getMobile()).build();
}
}
// 卖家未发货的情况,根据寄回地址就近选中一个鉴定中心
if (StringUtils.isNoneBlank(areaCode)){
AppraiseAddressResp addressResp = appraiseAddressService.queryAddressByAreaCode(areaCode);
if (addressResp != null){
return AppraiseAddressInfo.builder()
.address(addressResp.getAddress())
.addressName(addressResp.getAddressName())
.mobile(addressResp.getMobile()).build();
}
}
return null;
}
... ...