Authored by LUOXC

鉴定中心地址只根据买家地址取

... ... @@ -219,36 +219,31 @@ public class AppraiseAddressService {
}
/**
* 根据指定的鉴定中心返回地址详情
* 根据地址,返回鉴定中心地址详情
* @param areaCode
* @return
*/
public AppraiseAddressInfo findAppraiseAddress(Integer depotno, String areaCode){
public AppraiseAddressInfo findAppraiseAddress(String areaCode){
AppraiseAddressResp addressResp = null;
if (areaCode!=null && areaCode.equals(String.valueOf(HK_AREA_CODE))){
addressResp = queryHKAppraiseAddress();
if(StringUtils.isBlank(areaCode)){
return null;
}
// 卖家已经发货选定了鉴定中心
if (addressResp==null && depotno != null){
List<AppraiseAddressResp> addressRespList = queryAddressInfoList();
Map<Integer, AppraiseAddressResp> addressRespMap = addressRespList.stream()
.collect(Collectors.toMap(AppraiseAddressResp::getType, Function.identity(), (key1, key2)-> key1));
addressResp = addressRespMap.get(depotno);
// 香港鉴定中心
if (areaCode.equals(String.valueOf(HK_AREA_CODE))){
addressResp = queryHKAppraiseAddress();
}
// 卖家未发货的情况,根据寄回地址就近选中一个鉴定中心
if (addressResp==null && StringUtils.isNoneBlank(areaCode)){
if (addressResp==null){
addressResp = queryAddressByAreaCode(areaCode);
}
if (addressResp != null){
return convert2AppraiseAddressInfo(addressResp);
} else {
return null;
}
return null;
}
... ...
... ... @@ -178,7 +178,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
// 收货地址 and 用户信息
if (Objects.nonNull(buildNode.userAddress)) {
//卖家订单详情里才会有,买家没有
aai = appraiseAddressService.findAppraiseAddress(sellerOrderGoods.getDepotNo(), buildNode.userAddress.getAreaCode());
aai = appraiseAddressService.findAppraiseAddress(buildNode.userAddress.getAreaCode());
}
}
orderDetailInfo.setAppraiseAddress(aai);
... ...