From fcdf5a6ee029ee7f8894216d62720f784fda2ea3 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 10 Oct 2023 11:02:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9id,=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/gj/xiamen/PoiWash.groovy | 110 +++++++++++++++--- 1 file changed, 96 insertions(+), 14 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/PoiWash.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/PoiWash.groovy index 27314734c..45d30a6ab 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/PoiWash.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/PoiWash.groovy @@ -7,6 +7,7 @@ import com.fangjia.script.xingyebank.Data import com.mongodb.BasicDBObject import com.mongodb.DBCollection import com.rabbitmq.client.impl.AMQImpl +import org.bson.types.ObjectId import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.CountDownLatch @@ -17,9 +18,9 @@ import java.util.concurrent.atomic.AtomicLong class PoiWash { def MAP_POI_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; - DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi_all", MAP_POI_URL) + DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi_all_8", MAP_POI_URL) -// DBCollection MAPPOI_CONN2 = MongoUtils.getCollectionByName2("fangjia", "map_poi_all", MAP_POI_URL) + DBCollection MAPPOI_CONN2 = MongoUtils.getCollectionByName2("fangjia", "map_poi_all", MAP_POI_URL) DBCollection TOWNSHIP_CONN = MongoUtils.getCollectionByName2("fangjia", "township", MAP_POI_URL) @@ -30,22 +31,56 @@ class PoiWash { static main(args) { def task = new PoiWash() + task.updateId() // task.run() - task.check() +// task.checkSpecialSymbols() + task.synch() +// task.check() + } -// def s = "002乡道与767县道交叉口东北约60米 " -// def s1 = DataUtil.toDBCcase(s) -// println s1 -// task.synch() + def updateId(){ + def citys = ["上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"] + for(def city : citys){ + def datas = findPois(city) + update(datas) + } + } + def update(datas){ + def totalCount = new AtomicLong() + def updateTotalCount = new AtomicLong() + final CountDownLatch latch = new CountDownLatch(datas.size()) + + def count = datas.size() + for(def i=0;i