diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/AddCityRegionPrice.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/AddCityRegionPrice.groovy index 6fc2eae33..816bf86c9 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/AddCityRegionPrice.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/AddCityRegionPrice.groovy @@ -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+" ÓпÕÖµ" } + } }