update
This commit is contained in:
+15
-12
@@ -26,18 +26,21 @@ class SynchDealPriceToEs {
|
|||||||
def run(){
|
def run(){
|
||||||
def batchsize = 2000
|
def batchsize = 2000
|
||||||
def citys = getCityCount()
|
def citys = getCityCount()
|
||||||
citys.each{city,count->
|
citys.each{city,count->
|
||||||
for(def year = 1999;year<=2025;year++){
|
if(city instanceof String){
|
||||||
def q = new BasicDBObject("city", city)
|
for(def year = 1999;year<=2025;year++){
|
||||||
q.put("trade_date", new BasicDBObject('$gte', DateUtils.parseFromTightByPattern(year+"-01-01", "yyyy-MM-dd")).append('$lte', DateUtils.parseFromTightByPattern(year+1+"-01-01", "yyyy-MM-dd")))
|
def q = new BasicDBObject("city", city)
|
||||||
def dbcursor = dealPriceConn.find(q).batchSize(batchsize)
|
q.put("trade_date", new BasicDBObject('$gte', DateUtils.parseFromTightByPattern(year+"-01-01", "yyyy-MM-dd")).append('$lte', DateUtils.parseFromTightByPattern(year+1+"-01-01", "yyyy-MM-dd")))
|
||||||
println city +" "+ dbcursor.count()
|
def dbcursor = dealPriceConn.find(q).batchSize(batchsize)
|
||||||
def ret = []
|
println city +" "+ dbcursor.count()
|
||||||
for(def o : dbcursor){
|
def ret = []
|
||||||
ret << o
|
for(def o : dbcursor){
|
||||||
}
|
ret << o
|
||||||
save(ret)
|
}
|
||||||
}
|
save(ret)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// def index = 0
|
// def index = 0
|
||||||
// for(def d : dbcursor){
|
// for(def d : dbcursor){
|
||||||
// ret << d
|
// ret << d
|
||||||
|
|||||||
Reference in New Issue
Block a user