写字楼统计修改

This commit is contained in:
2023-04-17 16:34:45 +08:00
parent b5fc0aecc5
commit 6abf0257ed
@@ -66,20 +66,26 @@ class CityInfoAnaBatch extends BaseBatch {
alias:'alias',addr_alias:'addrAlias','main_type_area':'mainTypeArea'
]
public static final def OFFICE_FIELDS_MAP = [
name :'name',region :'region',block :'block',address :'address',estate_type2 :'estateType2',household_count :'householdCount',open_date :'openDate',live_date :'liveDate',
all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany',cubage_percent :'cubagePercent',virescence_percent :'virescencePercent',
car_site :'carSite',estate_charge :'estateCharge',finish_building_date :'finishBuildingDate',start_building_date :'startBuildingDate',build_structure :'buildStructure',
facilities : 'facilities',characteristic:'characteristic',car_site_count :'carSiteCount',bed_kind:'bedKind',
lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', out_pics : 'outPics', pics : 'pics'
name :'name',region :'region',block :'block',address :'address',estate_type2 :'estateType2',household_count :'householdCount',open_date :'openDate',live_date :'liveDate',
all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany',cubage_percent :'cubagePercent',virescence_percent :'virescencePercent',
car_site :'carSite',estate_charge :'estateCharge',finish_building_date :'finishBuildingDate',start_building_date :'startBuildingDate',build_structure :'buildStructure',
facilities : 'facilities',characteristic:'characteristic',car_site_count :'carSiteCount',bed_kind:'bedKind',alias:'alias',
lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', out_pics : 'outPics', pics : 'pics',addr_alias:'addrAlias',business_quarter:'businessQuarter',loop_line_info:'loopLineInfo',licence:'licence',
sideset:'sideset',real_use_percent:'realUsePercent',build_designer:'buildDesigner',cons_company:'consCompany',estate_charge:'estateCharge',
floor_info:'floorInfo',underground_car_site:'undergroundCarSite',land_car_site:'landCarSite',parking_fee:'parkingFee',sight:'sight',property_life:'propertyLife',
conditioner_time:'conditionerTime',elevators_count:'elevatorsCount',person_elevators_count:'personElevatorsCount',
goods_elevator_count:'goodsElevatorCount',network_way:'networkWay',fitment_level:'fitmentLevel',standard_height:'standardHeight',clear_height:'clearHeight',standard_area:'standardArea',
is_foreign:'foreign',is_register:'register',lighting_ventilation:'lightingVentilation',lobby_height:'lobbyHeight'
]
public static final def SHOP_FIELDS_MAP = [
name :'name',region :'region',block :'block',address :'address',estate_type2 :'estateType2',open_date :'openDate',live_date :'liveDate',
all_area :'allArea',build_area :'buildArea',build_type :'buildType',developer :'developer',estate_company :'estateCompany',
rent_type :'rentType',lease_term :'leaseTerm',car_site :'carSite',estate_charge :'estateCharge',divisible :'divisible',floor :'floor',
finish_building_date :'finishBuildingDate',business_quarter :'businessQuarter',start_building_date :'startBuildingDate',
bay_area :'bayArea', property_life :'propertyLife',unified_manage :'unifiedManage',licence :'licence',business_status :'businessStatus',
lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', out_pics : 'outPics', pics : 'pics',bed_kind:'bedKind',floor_info:'floorInfo',car_site_count :'carSiteCount',
lat : 'lat',lng : 'lng',lat2 : 'lat2',lng2 : 'lng2', out_pics : 'outPics', pics : 'pics'
]
public static CITY_GRADE_MAP = [1000: "一线" , 1500 : "新一线" , 2000 : "二线" , 3000:"三线" ,4000 : "四线" ,5000 : "五线"]
@@ -91,8 +97,7 @@ class CityInfoAnaBatch extends BaseBatch {
* 统计结果接收邮箱列表
*/
final static def receivers = [
"puxueli@fangjia.com",
"wangchencen@fangjia.com",
"gaojuan@fangjia.com",
"caoyuyan@fangjia.com",
"muliangshu@fangjia.com"
]
@@ -118,9 +123,9 @@ class CityInfoAnaBatch extends BaseBatch {
SERVER_AREA_CONN.find(cityQuery).each { allCitys.put(it.display, it); }
allCitys.each {k,v ->
if(k.toString()=="上海"){
// if(["上海","深圳","北京","广州","杭州","苏州","重庆","成都"].contains(k.toString())){
CITYS << k.toString();
}
// }
}
// 所有城市的人口信息
@@ -150,7 +155,7 @@ class CityInfoAnaBatch extends BaseBatch {
allCityDisCount.put(it.name, it.count.intValue());
}
}
// 城市新盘数
def allCityNewDisCount = [:];
disQuery = new BasicDBObject();
@@ -166,7 +171,7 @@ class CityInfoAnaBatch extends BaseBatch {
allCityNewDisCount.put(it.name, it.count.intValue());
}
}
// 城市写字楼数
def allCityOfficeCount = [:];
disQuery = new BasicDBObject();
@@ -182,8 +187,8 @@ class CityInfoAnaBatch extends BaseBatch {
allCityOfficeCount.put(it.name, it.count.intValue());
}
}
// 城市商铺数
def allCityShopCount = [:];
disQuery = new BasicDBObject();
@@ -507,7 +512,7 @@ class CityInfoAnaBatch extends BaseBatch {
entity.put('official_population', curInfo.official_population);
entity.put('district_avg_population', curInfo.district_avg_population);
entity.put('rate', curInfo.rate);
removeCurInfo(cityName, weekend);
} else {
def cityHouseStat = allHouseStats.get(cityName);
@@ -517,13 +522,13 @@ class CityInfoAnaBatch extends BaseBatch {
} else if (cityHouseStat && cityHouseStat.standard_people_count) {
entity.put('official_population', cityHouseStat.standard_people_count);
}
if (lastInfo && lastInfo.district_avg_population) {
entity.put('district_avg_population', lastInfo.district_avg_population);
} else if (cityHouseStat && cityHouseStat.district_avg_population) {
entity.put('district_avg_population', cityHouseStat.district_avg_population);
}
if (lastInfo && lastInfo.rate) {
entity.put('rate', lastInfo.rate.toDouble());
} else if (cityHouseStat) {
@@ -1252,7 +1257,7 @@ class CityInfoAnaBatch extends BaseBatch {
DBObject query = new BasicDBObject();
query.put('city', cityName);
query.put('cat', 'office');
query.put('visible', 0);
query.put('status', 0);
DBObject fields = new BasicDBObject()
OFFICE_FIELDS_MAP.each() {key,skey->
@@ -1262,7 +1267,7 @@ class CityInfoAnaBatch extends BaseBatch {
DSCursor cur = SEAWEED.find(query, fields).batchSize(2000)
Iterator<DBObject> iter = cur.iterator()
def countMap = [:]
println cur.count()
while(iter.hasNext()) {
def dbo = iter.next()
OFFICE_FIELDS_MAP.each() {key,skey->