增加2个字段

This commit is contained in:
2022-04-22 17:29:00 +08:00
parent 73dcc7f14c
commit adadf832e3
@@ -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)