...
|
...
|
@@ -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;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
...
|
...
|
|