江南行修改
This commit is contained in:
+27
@@ -832,6 +832,33 @@ class CommonDatautils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static def findNewUpdateDistricts(def city, def cat, def fields){
|
||||||
|
|
||||||
|
def startDate = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd")
|
||||||
|
DBObject q = new BasicDBObject();
|
||||||
|
q.put("status",0)
|
||||||
|
// q.put("status",new BasicDBObject('$ne', 0))
|
||||||
|
q.put("cat", cat);
|
||||||
|
q.put("city", city)
|
||||||
|
q.put("m_date", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD(startDate)))
|
||||||
|
// q.put("loop_line_info",new BasicDBObject('$exists',false))
|
||||||
|
// q.put("name","扬州北街8号")
|
||||||
|
|
||||||
|
DBObject keys = new BasicDBObject();
|
||||||
|
if(fields){
|
||||||
|
for(def field : fields){
|
||||||
|
keys.put(field, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
def dbsour = SEAWEED_COLL.find(q, keys).batchSize(5000)
|
||||||
|
def rets = []
|
||||||
|
for(def d : dbsour){
|
||||||
|
rets << d
|
||||||
|
}
|
||||||
|
return rets;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static def findAllRegionDistricts(def city, def region, def cat, def fields){
|
public static def findAllRegionDistricts(def city, def region, def cat, def fields){
|
||||||
|
|
||||||
DBObject q = new BasicDBObject();
|
DBObject q = new BasicDBObject();
|
||||||
|
|||||||
+16
-4
@@ -17,6 +17,7 @@ import org.bson.types.ObjectId
|
|||||||
import java.util.concurrent.CountDownLatch
|
import java.util.concurrent.CountDownLatch
|
||||||
import java.util.concurrent.ExecutorService
|
import java.util.concurrent.ExecutorService
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import java.util.concurrent.atomic.AtomicLong
|
import java.util.concurrent.atomic.AtomicLong
|
||||||
/**
|
/**
|
||||||
* Created by gaojuan on 2017/12/11.
|
* Created by gaojuan on 2017/12/11.
|
||||||
@@ -40,6 +41,8 @@ class CZDataBatch extends BaseBatch{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void process(Object args) {
|
void process(Object args) {
|
||||||
|
println "args 参数:"+args.toString()
|
||||||
|
|
||||||
def citys = CommonDatautils.findAllCity();
|
def citys = CommonDatautils.findAllCity();
|
||||||
|
|
||||||
citys.remove("常州");
|
citys.remove("常州");
|
||||||
@@ -50,12 +53,21 @@ class CZDataBatch extends BaseBatch{
|
|||||||
def statMap = CommonDatautils.queryAllDistrictPriceByWeekend(city, weekend)
|
def statMap = CommonDatautils.queryAllDistrictPriceByWeekend(city, weekend)
|
||||||
def commids = findAllJnBankDatas(city)
|
def commids = findAllJnBankDatas(city)
|
||||||
//
|
//
|
||||||
def districts = converList(CommonDatautils.findAllDistricts(city, "district", fields));
|
def districts = null;
|
||||||
FzDataUtils.removeNoUpdate(city, districts)
|
def shops = null;
|
||||||
|
if(args && args[0]== "all"){
|
||||||
|
districts = converList(CommonDatautils.findAllDistricts(city, "district", fields));
|
||||||
|
FzDataUtils.removeNoUpdate(city, districts)
|
||||||
|
}else{
|
||||||
|
districts = converList(CommonDatautils.findNewUpdateDistricts(city, "district", fields));
|
||||||
|
}
|
||||||
districtRun(districts, statMap, commids);
|
districtRun(districts, statMap, commids);
|
||||||
|
|
||||||
|
if(args && args[0]== "all"){
|
||||||
def shops = CommonDatautils.findAllDistricts(city, "shop", fields);
|
shops = CommonDatautils.findAllDistricts(city, "shop", fields);
|
||||||
|
}else{
|
||||||
|
shops = CommonDatautils.findNewUpdateDistricts(city, "shop", fields);
|
||||||
|
}
|
||||||
shops = mergeShop(shops);
|
shops = mergeShop(shops);
|
||||||
shopRun(shops);
|
shopRun(shops);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user