...
|
...
|
@@ -30,6 +30,8 @@ import java.util.stream.Collectors; |
|
|
public class AppraiseAddressService {
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(AppraiseAddressService.class);
|
|
|
|
|
|
public static final int HK_AREA_CODE = 852;
|
|
|
|
|
|
private final static String CACHE_KEY="appraiseAddress_cache",
|
|
|
MAP_CACHE_KEY = "appraiseAddress_map",
|
|
|
LIST_CACHE_KEY = "appraiseAddress_list";
|
...
|
...
|
@@ -73,7 +75,7 @@ public class AppraiseAddressService { |
|
|
}
|
|
|
|
|
|
public AppraiseAddressResp queryHKAppraiseAddress() {
|
|
|
Integer provinceCode = 852;
|
|
|
final Integer provinceCode = HK_AREA_CODE;
|
|
|
Map<Integer, AppraiseAddress> map = buildCodeAppraiseAddressMap();
|
|
|
AppraiseAddress address = map.get(provinceCode);
|
|
|
if (Objects.nonNull(address)){
|
...
|
...
|
@@ -206,8 +208,13 @@ public class AppraiseAddressService { |
|
|
*/
|
|
|
public AppraiseAddressInfo findAppraiseAddress(Integer depotno, String areaCode){
|
|
|
AppraiseAddressResp addressResp = null;
|
|
|
|
|
|
if (areaCode!=null && areaCode.equals(String.valueOf(HK_AREA_CODE))){
|
|
|
addressResp = queryHKAppraiseAddress();
|
|
|
}
|
|
|
|
|
|
// 卖家已经发货选定了鉴定中心
|
|
|
if (depotno != 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));
|
...
|
...
|
@@ -216,7 +223,7 @@ public class AppraiseAddressService { |
|
|
}
|
|
|
|
|
|
// 卖家未发货的情况,根据寄回地址就近选中一个鉴定中心
|
|
|
if (StringUtils.isNoneBlank(areaCode)){
|
|
|
if (addressResp==null && StringUtils.isNoneBlank(areaCode)){
|
|
|
addressResp = queryAddressByAreaCode(areaCode);
|
|
|
}
|
|
|
|
...
|
...
|
|