+21
-21
@@ -847,27 +847,27 @@ class CommonDatautils {
|
||||
}
|
||||
|
||||
|
||||
public static def findAllDistrictByCity(def city, def cat, def fields){
|
||||
|
||||
DBObject q = new BasicDBObject();
|
||||
q.put("status",0)
|
||||
q.put("cat", cat);
|
||||
q.put("city", city);
|
||||
// q.put("name","万达华府一期")
|
||||
|
||||
DBObject keys = new BasicDBObject();
|
||||
if(fields){
|
||||
for(def field : fields){
|
||||
keys.put(field, 1);
|
||||
}
|
||||
}
|
||||
def dbsour = SEAWEED_COLL.find(q, keys).batchSize(2000)
|
||||
def rets = []
|
||||
for(def d : dbsour){
|
||||
rets << d
|
||||
}
|
||||
return rets;
|
||||
}
|
||||
// public static def findAllDistrictByCity(def city, def cat, def fields){
|
||||
//
|
||||
// DBObject q = new BasicDBObject();
|
||||
// q.put("status",0)
|
||||
// q.put("cat", cat);
|
||||
// q.put("city", city);
|
||||
//// q.put("name","万达华府一期")
|
||||
//
|
||||
// DBObject keys = new BasicDBObject();
|
||||
// if(fields){
|
||||
// for(def field : fields){
|
||||
// keys.put(field, 1);
|
||||
// }
|
||||
// }
|
||||
// def dbsour = SEAWEED_COLL.find(q, keys).batchSize(2000)
|
||||
// def rets = []
|
||||
// for(def d : dbsour){
|
||||
// rets << d
|
||||
// }
|
||||
// return rets;
|
||||
// }
|
||||
|
||||
public static def findDistrictByCityAndRegions(def city, def cat, def regions, def fields){
|
||||
|
||||
|
||||
+26
-3
@@ -14,15 +14,17 @@ class MsbPocTest {
|
||||
}
|
||||
def run(){
|
||||
// def inputfile = "D:\\数据\\美术宝\\美术宝测试数据(小区、城市均价).xlsx"
|
||||
def inputfile = "D:\\数据\\美术宝\\美术宝测试数据(匹配V2).xlsx"//美术宝测试数据(匹配).xlsx
|
||||
// def inputfile = "D:\\数据\\美术宝\\美术宝测试数据(匹配V2).xlsx"//美术宝测试数据(匹配).xlsx
|
||||
// standard(inputfile)
|
||||
match(inputfile)
|
||||
// match(inputfile)
|
||||
// matchOld(inputfile)
|
||||
// addPrice("D:\\数据\\美术宝\\美术宝测试数据(价格).xlsx")
|
||||
// test("D:\\数据\\美术宝\\test2.xlsx")
|
||||
|
||||
// cityPrice()
|
||||
mergeMatchPrice("D:\\数据\\美术宝\\美术宝-新接口价格.xlsx")
|
||||
// mergeMatchPrice("D:\\数据\\美术宝\\美术宝-新接口价格.xlsx")
|
||||
|
||||
addCCBPrice("C:\\Users\\gaojuan\\Desktop\\合肥科技农商行测试.xlsx")
|
||||
}
|
||||
|
||||
def cityPrice(){
|
||||
@@ -169,6 +171,27 @@ class MsbPocTest {
|
||||
})
|
||||
}
|
||||
|
||||
def addCCBPrice(path){
|
||||
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
|
||||
ExcelUtils.multiThreadingModify(path, { row ->
|
||||
if(!row['M']){
|
||||
def dist = CommonDatautils.findDistrict(row['E'], row['H'], row['I'], "district")
|
||||
if(dist){
|
||||
def d = CommonDatautils.findDistrictById(dist._id.toString())
|
||||
if(d){
|
||||
def cityId = cityCodeDataMap.get(d.city)
|
||||
def map = CcbCommonUtils.findAvgPrice(dist._id.toString(), cityId)
|
||||
if(map){
|
||||
row['M'] = map.avg_price
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
def addPrice(path){
|
||||
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
|
||||
ExcelUtils.multiThreadingModify(path, { row ->
|
||||
|
||||
+21
-11
@@ -56,6 +56,8 @@ class GaoDePoiDataProcess extends BaseBatch{
|
||||
|
||||
static DBCollection TOWN_POLYLINECOLL = MongoUtils.getCollectionByAuth20190102("fangjia_crawl", "town_polyline")
|
||||
|
||||
def fullCityMap = null
|
||||
|
||||
|
||||
static main(args) {
|
||||
runBatch(new GaoDePoiDataProcess(), args)
|
||||
@@ -117,17 +119,25 @@ class GaoDePoiDataProcess extends BaseBatch{
|
||||
}
|
||||
|
||||
def synchMapPoi(){
|
||||
//三明市,"宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市","重庆市" //厦门
|
||||
//"上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市" //上海信用卡
|
||||
def citys = ["杭州市","宁波市","温州市","嘉兴市","台州市","湖州市","绍兴市","金华市","舟山市","衢州市","丽水市"]
|
||||
for(def city : citys){
|
||||
def townMap = findTownRange(city)
|
||||
// def results = CommonDatautils.findAmapDetailBySql(city)
|
||||
def results = CommonDatautils.findNewAmapDetailBySql(city)
|
||||
println "city: "+city +" town: "+townMap.size()+" poi:"+results.size()
|
||||
def rows = running(city, results, "map", townMap)
|
||||
// save(city, rows)
|
||||
saveToMG(city, rows)
|
||||
def runedCity = ["三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市","重庆市","上海市","深圳市","北京市","广州市","杭州市","苏州市","成都市" , "杭州市","宁波市","温州市","嘉兴市","台州市","湖州市","绍兴市","金华市","舟山市","衢州市","丽水市"]
|
||||
fullCityMap = CommonDatautils.queryFullNameCity()
|
||||
|
||||
def citys = CommonDatautils.findAllCity();
|
||||
for(def sampleCity : citys){
|
||||
def cityObj = fullCityMap.get(sampleCity);
|
||||
def city = null
|
||||
if(cityObj){
|
||||
city = cityObj.city
|
||||
}
|
||||
if(city && !runedCity.contains(city)){
|
||||
def townMap = findTownRange(city)
|
||||
//// def results = CommonDatautils.findAmapDetailBySql(city)
|
||||
def results = CommonDatautils.findNewAmapDetailBySql(city)
|
||||
println "city: "+city +" town: "+townMap.size()+" poi:"+results.size()
|
||||
def rows = running(city, results, "map", townMap)
|
||||
//// save(city, rows)
|
||||
saveToMG(city, rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user