修改样本统计脚本
This commit is contained in:
+11
@@ -3,6 +3,7 @@ package com.fangjia.script.district
|
|||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
|
|
||||||
import com.mongodb.DBCursor
|
import com.mongodb.DBCursor
|
||||||
|
import org.apache.commons.lang3.StringUtils
|
||||||
|
|
||||||
import java.util.List
|
import java.util.List
|
||||||
|
|
||||||
@@ -55,6 +56,15 @@ class DistrictHouseBatch extends BaseBatch {
|
|||||||
String key = district.get("name").toString().trim() + "_" + district.get("region") + "_" + district.get("city")
|
String key = district.get("name").toString().trim() + "_" + district.get("region") + "_" + district.get("city")
|
||||||
long sellCount = sellCountMap.get(key) ? sellCountMap.get(key) : 0
|
long sellCount = sellCountMap.get(key) ? sellCountMap.get(key) : 0
|
||||||
long rentCount = rentCountMap.get(key) ? rentCountMap.get(key) : 0
|
long rentCount = rentCountMap.get(key) ? rentCountMap.get(key) : 0
|
||||||
|
if(district.alias != null){
|
||||||
|
for(String alia: district.alias){
|
||||||
|
if(StringUtils.isNotBlank(alia)){
|
||||||
|
key = alia.trim() + "_" + district.get("region") + "_" + district.get("city")
|
||||||
|
sellCount = sellCount + (sellCountMap.get(key)? sellCountMap.get(key) : 0)
|
||||||
|
rentCount = rentCount + (rentCountMap.get(key)? rentCountMap.get(key) : 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
saveToDistrictHouse(district.get('city'), district.get("region"), district.get("name"), sellCount, rentCount, sn)
|
saveToDistrictHouse(district.get('city'), district.get("region"), district.get("name"), sellCount, rentCount, sn)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +119,7 @@ class DistrictHouseBatch extends BaseBatch {
|
|||||||
fields.put("city", 1)
|
fields.put("city", 1)
|
||||||
fields.put("region", 1)
|
fields.put("region", 1)
|
||||||
fields.put("name", 1)
|
fields.put("name", 1)
|
||||||
|
fields.put("alias", 1)
|
||||||
|
|
||||||
def ret = []
|
def ret = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user