From be273c5f7ce0d50cc92742f613e2ad70c19be8ec Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Sun, 29 Sep 2024 14:08:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E5=80=BC=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gj/data_handle/AddCityRegionPrice.groovy | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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+" ÓпÕÖµ" } + } }