From 2cea6c4190c3db222915d7c3a14cfdc3d0c6b43a Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Mon, 21 Feb 2022 11:56:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=89=8D=E6=B5=B7=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/temp/shenjian/qianhai/QianhaiTest.groovy | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/qianhai/QianhaiTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/qianhai/QianhaiTest.groovy index 7c92e5a3e..6994cf1dc 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/qianhai/QianhaiTest.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/qianhai/QianhaiTest.groovy @@ -8,7 +8,7 @@ import com.fangjia.script.xingyebank.CityUtil import net.sf.json.JSONObject import org.apache.commons.lang.StringUtils -ExcelUtils.multiThreadingModify("D:\\数据\\前海\\前海征信测试数据test.xlsx",{List item-> +ExcelUtils.multiThreadingModify("D:\\数据\\前海\\前海征信测试数据.xlsx",{List item-> if(StringUtils.isBlank(item['B'])){ return; @@ -20,6 +20,11 @@ ExcelUtils.multiThreadingModify("D:\\ params["token"] = "F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB" JSONObject json = request.getJsonContent("http://open.fangjia.com/qhzx/propertyDetail", params, "UTF-8") + if((!json || !json.result) && StringUtils.isNotBlank(item['G'])){ + params["address"] = item['G'] + json = request.getJsonContent("http://open.fangjia.com/qhzx/propertyDetail", params, "UTF-8") + } + if(json.code == 200 && json.result){ JSONObject result = json.result item['C'] = CityUtil.getProvinceByCity(result.city) @@ -28,8 +33,6 @@ ExcelUtils.multiThreadingModify("D:\\ item['F'] = result.name if (result.name) { item['O'] = '住宅地址' - } else { - item['O'] = '非住宅地址' } item['G'] = result.address item['H'] = result.lng @@ -51,6 +54,9 @@ ExcelUtils.multiThreadingModify("D:\\ item['J'] = json.getJSONObject("result").averagePrice } } + if (!item['O']) { + item['O'] = '非住宅地址' + } params.clear() params["city"] = getCityFormAddress(item['B']) params["address"] = item['B']