Merge branch 'script_gj' into 'master'

update

See merge request !1195
This commit is contained in:
2025-11-24 11:33:50 +08:00
@@ -1,25 +1,19 @@
package com.fangjia.script.house
import com.fangjia.core.util.DateUtil
import com.fangjia.datastore.driver.DSCollection
import com.fangjia.datastore.driver.DataStore
import com.fangjia.script.BaseBatch
import com.fangjia.script.BatchOwner
import com.fangjia.script.Watcher
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.CommonUtils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.Bytes
import com.mongodb.DBCollection
import com.mongodb.DBObject
import com.mongodb.QueryOperators
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
@BatchOwner(Watcher.GaoJuan)
class DistrictSellHouseStatBatch extends BaseBatch{
@@ -48,14 +42,17 @@ class DistrictSellHouseStatBatch extends BaseBatch{
for(def city : citys){
index ++ ;
def districts = CommonDatautils.getAllDistrictBaseInfo(city, "district")
def sellRet = houseStatCount(districts, startDate, endDate, sDate);
String start = DateUtils.formatDateByPattern(startDate, "yyyyMMdd")
def sellRet = houseStatCount(districts, start.toInteger(), sDate);
saveResult(city, sDate, sellRet);
println "[${city} ${index}/${citys.size()}]" +new Date().toString();
}
}
def houseStatCount(def districts, def startDate, def endDate, def sDate){
def houseStatCount(def districts, def startDate, def sDate){
def index = 0;
@@ -75,8 +72,12 @@ class DistrictSellHouseStatBatch extends BaseBatch{
void run() {
index++;
def map = [:];
map.sell_count = findHouseCount(dist, "sell", startDate, endDate);
map.rent_count = findHouseCount(dist, "rent", startDate, endDate);
// map.sell_count = findHouseCount(dist, "sell", startDate, endDate);
// map.rent_count = findHouseCount(dist, "rent", startDate, endDate);
map.sell_count = CommonDatautils.findHouseCountByDate(dist.city, dist.region, dist.name, dist.alias, "sell", startDate)
map.rent_count = CommonDatautils.findHouseCountByDate(dist.city, dist.region, dist.name, dist.alias, "rent", startDate)
map.city = dist.city;
map.region = dist.region;
map.name = dist.name;