优化seaweed
This commit is contained in:
@@ -1,6 +1,39 @@
|
||||
package com.fangjia.script.wenyan
|
||||
|
||||
//ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Downloads\\国信达级联价格-上海.xlsx",{List item->
|
||||
// if(item["AB"]){
|
||||
// return
|
||||
// }
|
||||
// String region = null
|
||||
// String name = item["F"]
|
||||
// if(name.endsWith("小区")){
|
||||
// name = name.replaceAll("小区\$", "")
|
||||
// }
|
||||
// region = RegionData.formatRegion(item["B"], item["D"])
|
||||
// def results = []
|
||||
// DbUtils.seaweed.find(DbUtils.buildSeaweedQuery(item["B"], region, name)).each {
|
||||
// if(!results.contains(it)){
|
||||
// results.add(it)
|
||||
// }
|
||||
// }
|
||||
// DbUtils.seaweed.find(DbUtils.buildSeaweedQuery(item["B"], region).append("alias", name)).each {
|
||||
// if(!results.contains(it)){
|
||||
// results.add(it)
|
||||
// }
|
||||
// }
|
||||
// if(results.size() == 1){
|
||||
// item["Z"] = results[0]._id.toString()
|
||||
// item["AA"] = results[0].region
|
||||
// item["AB"] = results[0].name
|
||||
// println(item)
|
||||
// }
|
||||
//})
|
||||
|
||||
|
||||
|
||||
|
||||
import com.fangjia.core.ProvinceData
|
||||
import com.fangjia.core.RegionData
|
||||
import com.fangjia.script.util.CommonUtils
|
||||
import com.fangjia.script.util.DataUtil
|
||||
import com.fangjia.script.util.DbUtils
|
||||
@@ -76,7 +109,48 @@ import org.apache.commons.lang.StringUtils
|
||||
// }, new BasicDBObject("township", 1))
|
||||
//}
|
||||
//println(count)
|
||||
//def GXD_CCB = [:]
|
||||
//def CCB_FJW = [:]
|
||||
//ExcelUtils.read("D:\\Users\\wenyan\\Downloads\\4月级联待优化小区_3个城市.xlsx",sheetIndex = 1).each {List item->
|
||||
// if(item["V"] == "级联"){
|
||||
// if(item["Y"] == "国信达"){
|
||||
// GXD_CCB[item['J']] = item["E"]
|
||||
// }else if(item["Y"] == "房价网"){
|
||||
// CCB_FJW[item['E']] = item["J"]
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Downloads\\4月级联待优化小区_3个城市.xlsx",{List item->
|
||||
// if(item["V"] == "级联" && item["Y"] == "国信达"){
|
||||
// def ccbId = GXD_CCB.get(item['J'], null)
|
||||
// def fjwId = CCB_FJW.get(ccbId, null)
|
||||
// if(fjwId != null){
|
||||
// item["AB"] = fjwId
|
||||
//// BasicDBObject seaweed = DbUtils.seaweed.findById(fjwId)
|
||||
//// List results = DbUtils.findAroundDistrict(seaweed)
|
||||
//// long total = 0
|
||||
//// long count = 0
|
||||
//// for(BasicDBObject s : results){
|
||||
//// def avg = DbUtils.findDistrictAveragePrice(seaweed.city, seaweed.region, seaweed.name, Date.parse('yyyyMMdd', '20220619'), seaweed.estate_type2)
|
||||
//// if(avg){
|
||||
//// total += avg.avg_price
|
||||
//// count += 1
|
||||
//// }
|
||||
//// }
|
||||
//// if(count > 0){
|
||||
//// item['Z'] = (int)(total/count)
|
||||
//// println(item)
|
||||
//// }
|
||||
// }
|
||||
// }
|
||||
//},sheetIndex = 1)
|
||||
|
||||
ElasticUtils.executeSqlQuery("select count(*), p_date from seawater where p_date > 20210501 group by p_date",{
|
||||
println(it)
|
||||
})
|
||||
//ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Downloads\\moban (3).xls",{List item->
|
||||
// item["B"] = RegionData.formatRegion(item["A"], item["B"])
|
||||
// println(item)
|
||||
//})
|
||||
int count = 0
|
||||
DbUtils.seaweed.find(DbUtils.buildSeaweedQuery("东莞")).each {def a->
|
||||
count += 1
|
||||
}
|
||||
println(count)
|
||||
Reference in New Issue
Block a user