From adadf832e33b465512e6268bb9d0ba1d553bd444 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Apr 2022 17:29:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A02=E4=B8=AA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/gj/level/DistrictIndexBatch.groovy | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/level/DistrictIndexBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/level/DistrictIndexBatch.groovy index e6046e703..dc090f531 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/level/DistrictIndexBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/level/DistrictIndexBatch.groovy @@ -58,6 +58,8 @@ class DistrictIndexBatch extends BaseBatch{ def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.236:1521:orcl", "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") + static def month = DateUtils.formatDateByPattern(new Date(),"yyyy-MM") + static main(args) { runBatch(new DistrictIndexBatch(), args); } @@ -71,7 +73,7 @@ class DistrictIndexBatch extends BaseBatch{ def cityCodeDatas = CcbCommonUtils.findCityCodeValue() def citys = CommonDatautils.findAllCity(); for(def city : citys){ - def dists = CommonDatautils.findAllDistrictByCity(city, "district", ["city","alias","region","name", "finish_building_date","estate_charge","lat","lng","lng2","lat2"]) + def dists = CommonDatautils.findAllDistrictByCity(city, "district", ["city","alias","region","name", "finish_building_date","estate_charge","lat","lng","lng2","lat2","household_count"]) def code = cityCodeDatas.get(city) def city_avg_total_price = null if(city!="ΙΟΊ£"){ @@ -84,7 +86,7 @@ class DistrictIndexBatch extends BaseBatch{ city_avg_total_price = 531.2615913 } if(city_avg_total_price){ - calcute(city, dists, code, city_avg_total_price) + // calcute(city, dists, code, city_avg_total_price) calcuteIndex(city, dists, code, city_avg_total_price) } @@ -131,7 +133,7 @@ class DistrictIndexBatch extends BaseBatch{ map.total_price = total_price //map.comp_value = potentiality //map.avg_total_price = total_price_index - map.month = "2022-03" + map.month = month map.c_date = DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss").replace(" ","T") //datas << [d.city, d.region, d.name, total_price_index, avg_charge_index, rank_index, avg_cost_index,potentiality] @@ -229,7 +231,7 @@ class DistrictIndexBatch extends BaseBatch{ map.comp_value = potentiality map.avg_total_price = total_price_index - map.month = "2022-03" + map.month = month map.m_date = DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss").replace(" ","T") map.finish_date = year @@ -240,6 +242,15 @@ class DistrictIndexBatch extends BaseBatch{ if(rMap.sell_avg_price && sqmetre_rent){ map.price_to_rent = (rMap.sell_avg_price/sqmetre_rent).toInteger() } + if(d.household_count){ + map.household_ount = d.household_count + } + if(d.lat){ + def lMap = [:] + lMap.lon = d.lng/10000000000.0 + lMap.lat = d.lat/10000000000.0 + map.location = lMap + } def newUrl = targetUrl +"_doc/"+map.id httpSaveData(newUrl, map)