空值判断
This commit is contained in:
+12
-7
@@ -20,15 +20,20 @@ class AddCityRegionPrice {
|
||||
for(def r : regions){
|
||||
def startObj = CommonDatautils.queryCityOrRegionPrice(c, r, 1)
|
||||
def endObj = CommonDatautils.queryCityOrRegionPrice(c, r, -1)
|
||||
def betweenDates = DateUtil.getWeekendBetweenDates(startObj.weekend, endObj.weekend);
|
||||
for(def weekend : betweenDates ){
|
||||
def price = CommonDatautils.findCityOrRegionPrice(c, r, weekend)
|
||||
if(!price){
|
||||
add++
|
||||
insertBatch.saveCityCalcCommand(c,r,null, weekend, "fangjia-priceanalysis-0")
|
||||
println "[add] ${add} "+c+" "+r+" "+DateUtil.formatByPattern(weekend, "yyyy-MM-dd")
|
||||
if(startObj && endObj){
|
||||
def betweenDates = DateUtil.getWeekendBetweenDates(startObj.weekend, endObj.weekend);
|
||||
for(def weekend : betweenDates ){
|
||||
def price = CommonDatautils.findCityOrRegionPrice(c, r, weekend)
|
||||
if(!price){
|
||||
add++
|
||||
insertBatch.saveCityCalcCommand(c,r,null, weekend, "fangjia-priceanalysis-0")
|
||||
println "[add] ${add} "+c+" "+r+" "+DateUtil.formatByPattern(weekend, "yyyy-MM-dd")
|
||||
}
|
||||
}
|
||||
}else{
|
||||
println c+" "+r+" ÓпÕÖµ"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user