diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy index dbc92b4dd..fea372b37 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy @@ -69,7 +69,7 @@ class DistrictHouseBatch extends BaseBatch { for(DBObject district : districts) { def names = [] names << district.name - if(district.alias && districts.size()>0){ + if(district.alias && district.alias.size()>0){ for(def name : district.alias){ if(!names.contains(name)){ names << name @@ -81,14 +81,9 @@ class DistrictHouseBatch extends BaseBatch { long rentCount = 0 for(def name : names){ String key = name.toString().trim() + "_" + district.get("region") + "_" + district.get("city") - if(!sellCount){ - sellCount = sellCountMap.get(key) ? sellCountMap.get(key) : 0 - } - if(!rentCount){ - rentCount = rentCountMap.get(key) ? rentCountMap.get(key) : 0 - } + 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) } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/test/Test1.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/test/Test1.groovy index e6c27c934..ce4d04b65 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/test/Test1.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/test/Test1.groovy @@ -5,7 +5,11 @@ import com.fangjia.datastore.driver.DataStore import com.fangjia.script.util.DbUtils import com.mongodb.BasicDBObject -DSCollection seabird = new DataStore("192.168.0.38", 27007).getCollection("fangjia.seaweed") -seabird.find(DbUtils.buildSeaweedQuery("常州", "溧阳", "吾悦广场").append("if_sell", 1)).each { - println(it) +//、DSCollection seabird = new DataStore("192.168.0.38", 27007).getCollection("fangjia.seaweed") +//seabird.find(DbUtils.buildSeaweedQuery("常州", "溧阳", "吾悦广场").append("if_sell", 1)).each { +// println(it) +//} +long l = 0 +if(!l){ + println(l) } \ No newline at end of file