From 2c9fc58b80d9edb558fd26a40c2f280e25a5e04d Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 10 Oct 2023 13:25:52 +0800 Subject: [PATCH] update --- .../fangjia/script/gj/xiamen/PoiWash.groovy | 49 +++++++++++++------ 1 file changed, 35 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 90539d547..5b97942a3 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 @@ -32,11 +32,11 @@ class PoiWash { static main(args) { def task = new PoiWash() // task.updateId() - task.run() +// task.run() // task.synch() - task.check() +// task.check() -// task.checkSpecialSymbols() + task.checkSpecialSymbols() } def updateId(){ @@ -98,7 +98,19 @@ class PoiWash { } + + def checkSpecialSymbols(){ + //"三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市", + def citys = ["重庆市","三明市","上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"] + for(def city : citys){ + def datas = findAllFieldPois(city) + specialSymbols(city, datas) + println city +" 完成" + } + } + + def specialSymbols(city, results){ def totalCount = new AtomicLong() def updateTotalCount = new AtomicLong() final CountDownLatch latch = new CountDownLatch(results.size()) @@ -106,25 +118,34 @@ class PoiWash { def count = results.size() for(def i=0;i + if(columns.contains(k)){ + if(v instanceof Double){ + udata.put(k, "") + } + } } - println updateTotalCount.get()+" / "+totalCount.get()+" "+count +" "+city + if(udata){ + updateTotalCount.addAndGet(1) + MAPPOI_CONN.update(new BasicDBObject('_id',map.id),new BasicDBObject('$set', udata)) + println updateTotalCount.get()+" / "+totalCount.get()+" "+count +" "+city + } + } catch (Exception e) { e.printStackTrace() } finally { latch.countDown() } -// } -// }); + } + }); } latch.await()