diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCitypriceBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCitypriceBatch.groovy index d0b68ab96..80e99bd54 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCitypriceBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCitypriceBatch.groovy @@ -33,6 +33,7 @@ class BigdataCitypriceBatch extends BaseBatch{ @Override void process(Object args) { + // def citys = ["杭州","宁波","温州","嘉兴","湖州","绍兴","金华","台州"]//CcbCommonUtils.getRunningCitys(args) def startDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(),-1), "yyyyMMdd").toInteger(); def endDate = DateUtils.formatDateByPattern(DateUtils.getLastDayOfMonth(new Date(),-1), "yyyyMMdd").toInteger(); @@ -174,11 +175,11 @@ class BigdataCitypriceBatch extends BaseBatch{ if(!sellMap || (sellMap && sellMap.avg_price.size()<3)){ sellDataType = 3 sellStartDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(), -3), "yyyyMMdd").toInteger(); - sellMap = findHouses(dist.city, dist.region, "sell", startDate, endDate, dist.name, dist.alias, dist.estate_type2) + sellMap = findHouses(dist.city, dist.region, "sell", sellStartDate, endDate, dist.name, dist.alias, dist.estate_type2) if(!sellMap || (sellMap && sellMap.avg_price.size()<3)){ sellDataType = 6 sellStartDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(), -6), "yyyyMMdd").toInteger(); - sellMap = findHouses(dist.city, dist.region, "sell", startDate, endDate, dist.name, dist.alias, dist.estate_type2) + sellMap = findHouses(dist.city, dist.region, "sell", sellStartDate, endDate, dist.name, dist.alias, dist.estate_type2) } } if(sellMap){ @@ -189,6 +190,7 @@ class BigdataCitypriceBatch extends BaseBatch{ sell_avg_total = avgValue(sellMap.total_price) }else{ sell_count = 0 + sellDataType = null } } @@ -201,11 +203,11 @@ class BigdataCitypriceBatch extends BaseBatch{ if(!rentMap || (rentMap && rentMap.avg_price.size()<3)){ rentDataType = 3 rentStartDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(), -3), "yyyyMMdd").toInteger(); - rentMap = findHouses(dist.city, dist.region, "rent", startDate, endDate, dist.name, dist.alias, dist.estate_type2) + rentMap = findHouses(dist.city, dist.region, "rent", rentStartDate, endDate, dist.name, dist.alias, dist.estate_type2) if(!rentMap || (rentMap && rentMap.avg_price.size()<3)){ rentDataType = 6 rentStartDate = DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date(), -6), "yyyyMMdd").toInteger(); - rentMap = findHouses(dist.city, dist.region, "rent", startDate, endDate, dist.name, dist.alias, dist.estate_type2) + rentMap = findHouses(dist.city, dist.region, "rent", rentStartDate, endDate, dist.name, dist.alias, dist.estate_type2) } } if(rentMap){ @@ -216,6 +218,7 @@ class BigdataCitypriceBatch extends BaseBatch{ rent_avg_total = avgValue(rentMap.total_price) }else{ rent_count = 0 + rentDataType = null } } if (sell_avg_price || rent_avg_price) { @@ -263,9 +266,24 @@ class BigdataCitypriceBatch extends BaseBatch{ } else { row << '' } - row << '11' - row << sellDataType - row << rentDataType + if(dist.estate_type2 && dist.estate_type2=="商住"){ + row << '11' + }else{ + row << '13' + } + + if(sellDataType){ + row << sellDataType + }else{ + row << '' + } + + if(rentDataType){ + row << rentDataType + }else{ + row << '' + } + row << 1 row << 'FJW' return row