From 4041af57cda45d7a6afbbda6a746f4ab877cc5e7 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 10 Oct 2023 09:39:32 +0800 Subject: [PATCH] update --- .../fangjia/script/gj/xiamen/PoiWash.groovy | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 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 a04a8b93e..27314734c 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 @@ -17,7 +17,10 @@ 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_8", MAP_POI_URL) + DBCollection MAPPOI_CONN = 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) public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20) @@ -27,12 +30,35 @@ class PoiWash { static main(args) { def task = new PoiWash() - task.run() -// task.check() +// task.run() + task.check() // def s = "002乡道与767县道交叉口东北约60米 " // def s1 = DataUtil.toDBCcase(s) // println s1 +// task.synch() + + } + + def synch(){ + def rets = [] + def citys = ["上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"] + for(def city : citys){ + def datas = findPois(city) + println city +" "+datas.size() + for(def d : datas){ + rets << d + if(rets.size()%10000==0){ + MAPPOI_CONN2.insert(rets) + rets.clear() + } + } + } + + if(rets.size()>0){ + MAPPOI_CONN2.insert(rets) + rets.clear() + } } @@ -250,7 +276,7 @@ class PoiWash { def check(){ - def citys = ["三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市","重庆市","三明市"] + def citys = ["三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市","重庆市","三明市","上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"] for(def city : citys){ def datas = findPois(city) processUpdate(city, datas)