From 6a511eff5a70f9318e27551266aa553ff7da35cb Mon Sep 17 00:00:00 2001 From: "wangwenyan@fangjia.com" Date: Thu, 12 May 2022 22:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E5=BC=80=E5=B0=8F=E5=8C=BA=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E8=B4=A6=E5=8F=B7=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/service/address/processor/CityProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/address/processor/CityProcessor.java b/projects/fangjia-service/src/main/java/com/fangjia/service/address/processor/CityProcessor.java index 6f88c20ef..6ae746ab5 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/address/processor/CityProcessor.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/address/processor/CityProcessor.java @@ -52,8 +52,8 @@ public class CityProcessor extends AbstractAddressProcessor { } if(StringUtils.isNotBlank(city) && CityStatus.SURE != address.getCityStatus() ){ String formatCity = RegionData.formatCity(city); - String possibleCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) ? parseCityFromAddress(orgAddress, address) : null; - String confirmCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) ? null : formatCity; + String possibleCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) || address.getAddressParserGoal() == null ? parseCityFromAddress(orgAddress, address) : null; + String confirmCity = AddressParserGoal.Match.equals(address.getAddressParserGoal()) || address.getAddressParserGoal() == null? null : formatCity; /**如果省份和城市信息相互矛盾 则用区域推断城市*/ if(StringUtils.isNotBlank(address.getProvince()) && !ProvinceData.belongTo(formatCity, address.getProvince())){ List possibleCities = speculateCityNameByRegion(address, city);