增加样本过滤阀值
This commit is contained in:
+2
-2
@@ -434,8 +434,8 @@ public class HouseController {
|
||||
Integer minPrice = null;
|
||||
Integer maxPrice = null;
|
||||
if(bo.getDistrictStat()!=null){
|
||||
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.9);
|
||||
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.1);
|
||||
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8);
|
||||
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2);
|
||||
}
|
||||
List<String> names = new ArrayList<String>();
|
||||
names.add(district.getName());
|
||||
|
||||
@@ -45,6 +45,9 @@ import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
import net.sf.json.JSONObject
|
||||
import org.apache.commons.lang.StringUtils
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder
|
||||
import org.elasticsearch.index.query.QueryBuilders
|
||||
|
||||
//DBCollection SEAWEED_TOWNSHIP = MongoUtils.getCollectionByName("fangjia_base", "seaweed_township", "192.168.0.235", 27018)
|
||||
//def count = 0
|
||||
//List<List<String>> data = Collections.synchronizedList([])
|
||||
@@ -145,9 +148,41 @@ import org.apache.commons.lang.StringUtils
|
||||
// }
|
||||
//},sheetIndex = 1)
|
||||
|
||||
//ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Downloads\\moban (3).xls",{List item->
|
||||
// item["B"] = RegionData.formatRegion(item["A"], item["B"])
|
||||
// println(item)
|
||||
//})
|
||||
DbUtils.seaweed.save(DbUtils.seaweed.findById("62ce26483705890001dfa166"))
|
||||
//DbUtils.seaweed.remove(new BasicDBObject("_id", "62ce3eda3705890001dfa16a"))
|
||||
ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Desktop\\小区字段补充.xlsx",{List item->
|
||||
BasicDBObject seaweed = DbUtils.seaweed.findById(item["A"])
|
||||
if(StringUtils.isBlank(seaweed.create_year)){
|
||||
def names = []
|
||||
names.add(seaweed.name)
|
||||
if(seaweed.alias){
|
||||
for(def it in seaweed.alias){
|
||||
if(StringUtils.isNotBlank(it) && !names.contains(it)){
|
||||
names.add(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery()
|
||||
boolQueryBuilder.must(QueryBuilders.termQuery("city", seaweed.city))
|
||||
boolQueryBuilder.must(QueryBuilders.termQuery("region", seaweed.region))
|
||||
boolQueryBuilder.must(QueryBuilders.termsQuery("name", names));
|
||||
item["B"] = seaweed.city
|
||||
item["C"] = seaweed.region
|
||||
item["D"] = seaweed.name
|
||||
List result = ElasticUtils.executeSimpleQuery("192.168.0.206", "community", boolQueryBuilder)
|
||||
def buildYears = []
|
||||
result.each {
|
||||
if(StringUtils.isNotBlank(it.build_year) && !StringUtils.containsAny(it.build_year,"无")){
|
||||
String build_year = it.build_year
|
||||
build_year = build_year.replaceAll("((|\\().*()|\\))", "")
|
||||
build_year = build_year.replaceAll("[年建]", "")
|
||||
// property_fee = property_fee.replace("元/㎡·月", "元/平米/月")
|
||||
buildYears.add(build_year)
|
||||
}
|
||||
}
|
||||
buildYears = buildYears.unique()
|
||||
if(buildYears.size() > 0){
|
||||
DbUtils.seaweed.update(new BasicDBObject("_id", seaweed._id), new BasicDBObject('$set', new BasicDBObject('create_year', buildYears[0])))
|
||||
println(item)
|
||||
println(buildYears)
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user