From 3351881cb652e9307149bf053527d7d94bb676a6 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 17 Oct 2023 12:29:33 +0800 Subject: [PATCH] update --- .../fangjia/script/gj/xiamen/PoiWash.groovy | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 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 9773313c7..aad5b78fa 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 @@ -391,7 +391,8 @@ class PoiWash { def check(){ - def citys = ["三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市","重庆市","三明市","上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"] +// "漳州市","三明市","宁德市","泉州市","厦门市","福州市","南平市","龙岩市","莆田市","重庆市", + def citys = ["上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市"] for(def city : citys){ def datas = findPois(city) processUpdate(city, datas) @@ -449,12 +450,15 @@ class PoiWash { if(addr.contains("(") && addr.contains(")")){ s1 = addr.substring(addr.indexOf("("),addr.indexOf(")")+1 ) } - def new_addr = addr.replace(s1, "") - if(DataHandleUtils.isStandardRoad(new_addr)){ - udata.put("address", new_addr) - }else{ - if(DataHandleUtils.isStandardRoad(s1)){ - udata.put("address", s1.replace("(", "").replace(")", "")) + + if(s1){ + def new_addr = addr.replace(s1, "") + if(DataHandleUtils.isStandardRoad(new_addr)){ + udata.put("address", new_addr) + }else{ + if(DataHandleUtils.isStandardRoad(s1)){ + udata.put("address", s1.replace("(", "").replace(")", "")) + } } } } @@ -462,7 +466,7 @@ class PoiWash { if(udata){ updateTotalCount.addAndGet(1) MAPPOI_CONN.update(new BasicDBObject('_id',map.id),new BasicDBObject('$set', udata)) - println updateTotalCount.get()+" / "+totalCount.get()+" "+count +" "+city +// println updateTotalCount.get()+" / "+totalCount.get()+" "+count +" "+city }