From abcba9c17a2114c4b0d120049bfe889fb39ed06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Sun, 26 Sep 2021 16:33:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=95=87=E5=88=86=E8=AF=8D?= =?UTF-8?q?=E7=BB=8F=E7=BA=AC=E5=BA=A6=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../temp/shenjian/poi/CommitteeLatLng.groovy | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/CommitteeLatLng.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/CommitteeLatLng.groovy index 15c0b3f66..acd13cff0 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/CommitteeLatLng.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/CommitteeLatLng.groovy @@ -20,10 +20,12 @@ import java.util.concurrent.Executors class CommitteeLatLng { static DBCollection villagesConn = MongoUtils.getCollectionByName("fangjia", "villages", "192.168.0.43", 28017) - static ExecutorService executorService = Executors.newFixedThreadPool(20) + static ExecutorService executorService = Executors.newFixedThreadPool(1) static void main(String[] args) { - dealPoi(new BasicDBObject("status_location", new BasicDBObject('$ne', 0))) + dealPoi(new BasicDBObject("status_location", new BasicDBObject('$ne', 0)) + .append("province_name", '江苏省') + ) //dealLocation() executorService.shutdown() } @@ -38,6 +40,11 @@ class CommitteeLatLng { def city = obj.city_name def area = obj.area_name def name = obj.name + +// if (!name.contains("社区居委会")) { +// return ; +// } + if (city == "市辖区") { city = obj.province_name } else if (city == "省直辖县级行政区划" || city == "自治区直辖县级行政区划") { @@ -50,11 +57,12 @@ class CommitteeLatLng { if (obj.name.contains("虚拟生活区") || obj.name.contains("管理区") || obj.name.contains("虚拟社区")) { name = obj.street_name } - if (!obj.name.contains("虚拟社区")) { - return ; + if (name.contains("社区居委会")) { + name = name.replace("居委会", "") } - String address = province_name + city + area + obj.street_name + name; + String address = province_name + city + area + " " + obj.street_name + " " + name; + //String address = province_name + city + area + name List amapPoi = GaoDeUtils.searchPoi(city, address, area, "130106|130105|130104") if (amapPoi && amapPoi.size() > 0) { def poi = amapPoi[0]