空值判断
This commit is contained in:
+12
-7
@@ -20,15 +20,20 @@ class AddCityRegionPrice {
|
|||||||
for(def r : regions){
|
for(def r : regions){
|
||||||
def startObj = CommonDatautils.queryCityOrRegionPrice(c, r, 1)
|
def startObj = CommonDatautils.queryCityOrRegionPrice(c, r, 1)
|
||||||
def endObj = CommonDatautils.queryCityOrRegionPrice(c, r, -1)
|
def endObj = CommonDatautils.queryCityOrRegionPrice(c, r, -1)
|
||||||
def betweenDates = DateUtil.getWeekendBetweenDates(startObj.weekend, endObj.weekend);
|
if(startObj && endObj){
|
||||||
for(def weekend : betweenDates ){
|
def betweenDates = DateUtil.getWeekendBetweenDates(startObj.weekend, endObj.weekend);
|
||||||
def price = CommonDatautils.findCityOrRegionPrice(c, r, weekend)
|
for(def weekend : betweenDates ){
|
||||||
if(!price){
|
def price = CommonDatautils.findCityOrRegionPrice(c, r, weekend)
|
||||||
add++
|
if(!price){
|
||||||
insertBatch.saveCityCalcCommand(c,r,null, weekend, "fangjia-priceanalysis-0")
|
add++
|
||||||
println "[add] ${add} "+c+" "+r+" "+DateUtil.formatByPattern(weekend, "yyyy-MM-dd")
|
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