From 2da2fb9e4216b4c2a5b8a2abd649cef80d0b1492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Mon, 7 Jun 2021 13:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=85=88=E5=A4=84=E7=90=86=E9=87=8D?= =?UTF-8?q?=E5=BA=86=E5=86=9C=E5=95=86=E8=A1=8C=E6=8B=9B=E6=A0=87=E5=9F=8E?= =?UTF-8?q?=E5=B8=82POI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../temp/shenjian/poi/SeaweedAroundPoi.groovy | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/SeaweedAroundPoi.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/SeaweedAroundPoi.groovy index a0227abe4..addf2d9cf 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/SeaweedAroundPoi.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/poi/SeaweedAroundPoi.groovy @@ -33,7 +33,36 @@ class SeaweedAroundPoi { static void main(String[] args) { def types = listAllType() - DBObject query = new BasicDBObject() + dealSpecialSeaweedAround(types) + executorService.shutdown() + } + + /** + * 有限处理招标城市 + */ + static dealSpecialSeaweedAround(def types) { + def cities = ["重庆", "达州", "曲靖", "昆明", "大理", "迪庆州", "福安", "平潭", "三明", "石狮", "柳州", "苏州"] + for (def city : cities) { + DBObject q = new BasicDBObject(); + q.put("city", city); + if (city == "福安") { + city = "宁德" + q.put("city", city) + q.put("region", "福安") + } else if (city == "平潭") { + city = "福州" + q.put("city", city) + q.put("region", "平潭") + } else if (city == "石狮") { + city = "泉州" + q.put("city", city) + q.put("region", "石狮") + } + dealPoi(q, types) + } + } + + static dealPoi(DBObject query, def types) { query.put("status", 1) conn136.find(query).batchSize(5000).each {objTemp -> final def obj = objTemp @@ -55,7 +84,6 @@ class SeaweedAroundPoi { } }) } - executorService.shutdown() } static getNewSeaweed() {