新增规则

This commit is contained in:
沈健
2021-05-16 19:29:35 +08:00
parent 3758069379
commit d0744e2df5
5 changed files with 81 additions and 11 deletions
@@ -30,12 +30,6 @@ class AroundExportByNewWay {
static def resultMap = new ConcurrentHashMap()
static ExecutorService executorService = Executors.newFixedThreadPool(30)
static Map<String, String> map = new HashedMap()
static {
map.put("")
}
static void main(String[] args) {
List<List<Object>> data = ExcelUtils.read("F:\\数据\\重庆农商行\\测试数据汇总_2021.xlsx", 9)
AtomicInteger count = new AtomicInteger(0)
@@ -119,6 +113,9 @@ class AroundExportByNewWay {
return false
}
if (name.indexOf("地铁口") == -1 && name.indexOf("公交站") == -1 && name.indexOf("支行") == -1) {
if (name.indexOf("栋") != -1) {
return false
}
if (name.indexOf("医院") != -1 && !name.endsWith("医院")) {
if (name.indexOf("分院") == -1) {
return false
@@ -25,9 +25,6 @@ class MarkUnNeedExport {
if (district.size() > 1) {
def type = district.get(0)
def status = district.get(1)
if (type == '交通设施服务;公交车站;公交车站相关') {
println(type)
}
if (status == 1.0) {
poiConn.update(new BasicDBObject("type", type), new BasicDBObject('$set', new BasicDBObject("status", 0)), false, true)
} else {
@@ -0,0 +1,61 @@
package com.fangjia.script.temp.shenjian.cqrcb
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import com.mongodb.DBObject
import java.util.regex.Pattern
/**
* POI清理规则
*
* @author shenjian
* @since 2021/5/16
*/
class POIRule {
static DBCollection poiConn = MongoUtils.getCollectionByName("address_analytics", "gaode_address_poi", "192.168.0.43", 28017)
static void main(String[] args) {
// 小学校转为学校
poiConn.find(new BasicDBObject("typecode", "141203").append("status", 0)).batchSize(1000).each {obj ->
if (obj.name.indexOf('小学校') != -1 ) {
def id = obj._id
def region = obj.region
def name = obj.name.replace("小学校", '小学')
if (poiConn.count(new BasicDBObject("region": region, "name": name)) > 0) {
poiConn.update(new BasicDBObject("_id", id), new BasicDBObject('$set', new BasicDBObject("status", 1)), false, true)
} else {
poiConn.update(new BasicDBObject("_id", id), new BasicDBObject('$set', new BasicDBObject("status", 0).append("name", name)), false, true)
}
}
}
}
static BasicDBObject getLikeStr(String findStr){
Pattern pattern = Pattern.compile('^.*' + findStr + '.*$', Pattern.CASE_INSENSITIVE);
return new BasicDBObject('$regex', pattern);
}
// 更新规则
// db.getCollection('gaode_address_poi').update({'name': /栋/, 'status': 0}, {$set: {'status': NumberInt(1), 'flag': '包含栋'}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /幢/, 'status': 0}, {$set: {'status': NumberInt(1), 'flag': '包含幢'}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /[ABCD]+馆/, 'typecode': {$in: ['060102', '060101']}, 'status': 0}, {$set: {'status': NumberInt(1), 'flag': '包含馆'}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /[ABCDE1234567890]+区/, 'typecode': {$nin: ['150700']}, 'status': 0}, {$set: {'status': NumberInt(1), 'flag': '包含区'}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /入口/, 'typecode': {$nin: ['150700']}, 'status': 0}, {$set: {'status': NumberInt(1), 'flag': '包含入口'}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'type': /医疗保健服务;专科医院;整形美容/}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'type': /科教文化服务;学校;职业技术学校/}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'type': /购物服务;商场;免税品店/}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'type': /医疗保健服务;专科医院;口腔医院/}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'type': /医疗保健服务;综合医院;卫生院/}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /[学]+楼/, 'status': 0}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /[教医光]+学中心/, 'status': 0}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'type': /科教文化服务;学校;学校/, 'status': 0}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /[1234]期/, 'status': 0}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /住院部/, 'status': 0}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /\//, 'status': 0}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /智能柜/, 'status': 0}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'name': /摄影/, 'status': 0}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
//db.getCollection('gaode_address_poi').update({'typecode': '141204', 'status': 0}, {$set: {'status': NumberInt(1)}}, {multi:true,upsert:false});
}
@@ -85,6 +85,9 @@ class SeaweedExport {
ret[0] = obj.developer
ret[1] = obj.estate_company
ret[2] = obj.cubage_percent
if (obj.developer == '重庆汇凯置业有限公司') {
println('重庆汇凯置业有限公司')
}
ret[3] = virescencePercentValidator(obj.virescence_percent)
if (obj.alias) {
@@ -145,7 +148,7 @@ class SeaweedExport {
if(value>=10 && value<=100){
return value;
} else if (value > 0 && value < 1) {
return value * 100
return com.fangjia.script.common.DataHandleUtils.getDoubleRound(2, Double.valueOf(value) * 100)
} else{
return "";
}
@@ -19,7 +19,19 @@ class GaoDeUtils {
def static codeNameMap = new HashMap<String, String>(){{
put("150500", "地铁");
put("1507", "公交");
put("医院", "090100|090101|090200|090202|090203|090204|090205|090206|090207|090208|090209|090210|090211");
put("090100", "医院")
put("090101", "医院")
put("090200", "医院")
put("090202", "医院")
put("090202", "医院")
put("090204", "医院")
put("090205", "医院")
put("090206", "医院")
put("090206", "医院")
put("090208", "医院")
put("090209", "医院")
put("090210", "医院")
put("090211", "医院")
put("141200", "学校")
put("141201", "学校")
put("141202", "学校")