统计图片数量
This commit is contained in:
+26
-3
@@ -7,11 +7,11 @@ import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.util.CommonUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ElasticUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.MongoUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
import org.bson.types.ObjectId
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder
|
||||
import org.elasticsearch.index.query.QueryBuilder
|
||||
import org.elasticsearch.index.query.QueryBuilders
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
/**
|
||||
* 更新小区图片
|
||||
*/
|
||||
@@ -33,7 +32,8 @@ class AddDistImagesBatch extends BaseBatch{
|
||||
public static final DBCollection seaweed_fs_coll = MongoUtils.getCollectionByName("fangjia_base", "seaweed_images", "mongo.db.fangjia.com")
|
||||
|
||||
static main(args) {
|
||||
runBatch(new AddDistImagesBatch(), args);
|
||||
// runBatch(new AddDistImagesBatch(), args);
|
||||
statImgCountByCity()
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -169,5 +169,28 @@ class AddDistImagesBatch extends BaseBatch{
|
||||
println floor_count
|
||||
}
|
||||
|
||||
static def statImgCountByCity(){
|
||||
def fullCityMap = CommonDatautils.queryFullNameByCity()
|
||||
ExcelUtils.multiThreadingModify("D:\\数据\\全国城市.xlsx",{d->
|
||||
// def data = fullCityMap.get(d['A'])
|
||||
// if(data){
|
||||
// def q = new BasicDBObject()
|
||||
// q.put("city", data.city)
|
||||
// def count = seaweed_fs_coll.count(q)
|
||||
// d['B'] = count
|
||||
// }
|
||||
def dists= CommonDatautils.findAllDistricts(d['A'], "district", ["car_site_count","household_count"])
|
||||
if(dists){
|
||||
def total = 0
|
||||
for(def dist : dists){
|
||||
if(dist.car_site_count && dist.household_count){
|
||||
total ++
|
||||
}
|
||||
}
|
||||
d['C'] = total
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user