diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/AnjukeDistrictMatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/AnjukeDistrictMatch.groovy index 21816be71..8ba85525b 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/AnjukeDistrictMatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/AnjukeDistrictMatch.groovy @@ -46,7 +46,9 @@ class AnjukeDistrictMatch { // task.findAliasDatas("淮安","水沐未来印象花园")//模糊查找Es别名数据 // task.repeatDistByAlias()//根据第三方网站别名查找重复数据 - task.matchCommunityByCsv() +// task.matchCommunityByCsv() +// task.updteBuildAreaFieldByCsv() + task.updadteAllAreaFieldByCsv() } def updateCredit(){ @@ -207,7 +209,7 @@ class AnjukeDistrictMatch { map.put(row[0]+"#"+row[1]+"#"+row[2], row[24]+"#"+row[25]+"#"+row[26]+"#"+row[27]+"#"+row[28]) } - def datas1 = readTxt("D:\\数据\\建行\\二期\\第三方小区字段补充\\第三方网站建筑面积.csv") + def datas1 = readTxt("D:\\数据\\建行\\二期\\第三方小区字段补充\\第三方网站占地面积.csv") def lastRets = [] for(def i=0;i=0.9))){ + def dist = CommonDatautils.findSeaweedById(row[17], ["build_area"]) + if(dist && !dist.build_area){ + def val = row[8] + + if(!val){ + val = row[7] + } + if(!val){ + val = row[9] + } + if(!val){ + val = row[14] + } + + if(!val){ + val = row[15] + } + if(!val){ + val = row[12] + } + + if(!val){ + val = row[5] + } + if(!val){ + val = row[6] + } + + if(!val){ + val = row[3] + } + if(!val){ + val = row[13] + } + + if(!val){ + val = row[4] + } + + if(!val){ + val = row[10] + } + + if(!val){ + val = row[11] + } + + + if(val){ + if(val.toString().toDouble().toInteger()==val.toString().toDouble()){ + val = val.toString().toDouble().toInteger() + } + def udata = new BasicDBObject() + udata.put("build_area", val.toString()) + udata.put("m_date",new Date()) + + def q = new BasicDBObject() + q.put("_id", new ObjectId(dist._id.toString())) + DbUtils.seaweed.update(q, new BasicDBObject('$set', udata)) + println row[17] +" "+val.toString() + } + } + } + } + } + + def updadteAllAreaFieldByCsv(){ + def datas = readTxt("D:\\数据\\建行\\二期\\第三方小区字段补充\\第三方网站占地面积(匹配).csv") + for(def i=0;i=0.9))){ + def dist = CommonDatautils.findSeaweedById(row[13], ["all_area"]) + if(dist && !dist.all_area){ + def val = row[3] + + if(!val){ + val = row[4] + } + if(!val){ + val = row[5] + } + + if(!val){ + val = row[8] + } + + if(!val){ + val = row[9] + } + if(!val){ + val = row[10] + } + + if(!val){ + val = row[11] + } + if(!val){ + val = row[6] + } + + if(!val){ + val = row[7] + } + if(val){ + if(val.toString().toDouble().toInteger()==val.toString().toDouble()){ + val = val.toString().toDouble().toInteger() + } + def udata = new BasicDBObject() + udata.put("all_area", val.toString()) + udata.put("m_date",new Date()) + + def q = new BasicDBObject() + q.put("_id", new ObjectId(dist._id.toString())) + DbUtils.seaweed.update(q, new BasicDBObject('$set', udata)) + println row[13] +" "+val.toString() + } + } + } + } + } + // def run1(){ // def regionPointsMap = findRegionRange("重庆") // def flag = isInArea(dist.lng/10000000000.0, dist.lat/10000000000.0, regionPointsMap.get(dist.region)) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/FzDataUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/FzDataUtils.groovy index bcc75b6a0..8a9325c9b 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/FzDataUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/FzDataUtils.groovy @@ -31,7 +31,13 @@ class FzDataUtils { map.cat = "district"; // 楼盘名称 map.name = dist.name - map.alias = dist.alias + def alias = dist.alias + if(alias){ + if(alias.size()>5){ + alias = alias[0..4] + } + map.alias = alias + } map.build_date = getBuildDate(dist); //附属属性 map.build_type = dist.build_type