From e97f28e23965fd13bf8942046682b083eab006e4 Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Wed, 1 Jun 2022 10:24:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shenjian/didata/MatchFromExcel.groovy | 26 +++++++++++++++++++ .../temp/shenjian/poi/GetPoiFromExcel.groovy | 6 ++--- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/didata/MatchFromExcel.groovy diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/didata/MatchFromExcel.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/didata/MatchFromExcel.groovy new file mode 100644 index 000000000..20de59c5f --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/didata/MatchFromExcel.groovy @@ -0,0 +1,26 @@ +package com.fangjia.script.temp.shenjian.didata + +import com.fangjia.script.util.ExcelUtils +import com.fangjia.script.util.OpenApiClient + +/** + * 从excel中匹配出 + */ +ExcelUtils.multiThreadingModify("D:\\Users\\Domi\\Documents\\知识库\\地数\\数据建设\\待审核小区(地图匹配).xlsx", { row -> + def city = row['A'] + def region = row['B'] + def district_name = row['C'] + + def gaodeRegion = row['H'] + def gaodeName = row['I'] + + def jsonObject = OpenApiClient.addressMatch(city, null, "district", false, region, district_name, "strict") + if (jsonObject != null && jsonObject.precise != -1) { + row['D'] = jsonObject.get("name") + } + + def jsonObject2 = OpenApiClient.addressMatch(city, null, "district", false, gaodeRegion, gaodeName, "strict") + if (jsonObject != null && jsonObject.precise != -1) { + row['J'] = jsonObject.get("name") + } +}); diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoiFromExcel.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoiFromExcel.groovy index f9b073743..235d779e4 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoiFromExcel.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/GetPoiFromExcel.groovy @@ -32,9 +32,9 @@ class GetPoiFromExcel { executorService.submit(new Runnable() { @Override void run() { - String city = info.get(1) - String region = info.get(2) - String seaweedName = info.get(3) + String city = info.get(0) + String region = info.get(1) + String seaweedName = info.get(2) List pois = GaoDeUtils.searchPoi(city, seaweedName, region, typecodes); if (CollectionUtils.isNotEmpty(pois)) { List detailList = CommonDtoUtils.transformListV(AmapPoiDetail.class, pois);