This commit is contained in:
2023-07-10 17:59:34 +08:00
parent d6b63e1b94
commit f57632314f
3 changed files with 17 additions and 14 deletions
@@ -60,6 +60,7 @@ class DistrictSellStatBatch extends BaseBatch {
} }
def calcMonthlyPrice(){ def calcMonthlyPrice(){
//只有福州使用tob价格
def citys = CommonUtils.findAllCity() def citys = CommonUtils.findAllCity()
def keys = new BasicDBObject("city", 1).append("name", 1).append("region", 1).append("estate_type2", 1) def keys = new BasicDBObject("city", 1).append("name", 1).append("region", 1).append("estate_type2", 1)
@@ -142,17 +143,15 @@ class DistrictSellStatBatch extends BaseBatch {
if(weekendPriceObj.value_type!=1){ if(weekendPriceObj.value_type!=1){
if(dist.city == "福州"){ if(dist.city == "福州"){
if(Math.abs(mom)*100>3){ // if(Math.abs(mom)*100>3){
if(dist.region != "马尾"){ // def randMarkup = nextDouble(0, 3)
def randMarkup = nextDouble(0, 3) // if(mom < 0){
if(mom < 0){ // mom = DataUtil.roundDouble(randMarkup*(-1)/100, 4)
mom = DataUtil.roundDouble(randMarkup*(-1)/100, 4) // }else{
}else{ // mom = DataUtil.roundDouble(randMarkup/100, 4)
mom = DataUtil.roundDouble(randMarkup/100, 4) // }
} // curPrice = (int)(lastMonthPriceObj.avg_price*mom + lastMonthPriceObj.avg_price)
curPrice = (int)(lastMonthPriceObj.avg_price*mom + lastMonthPriceObj.avg_price) // }
}
}
}else{ }else{
if(Math.abs(mom)*100>10){ if(Math.abs(mom)*100>10){
def randMarkup = nextDouble(0, 10) def randMarkup = nextDouble(0, 10)
@@ -232,6 +231,11 @@ class DistrictSellStatBatch extends BaseBatch {
def dbcursor = DISTRICT_STAT.find(q) def dbcursor = DISTRICT_STAT.find(q)
def priceMap = [:] def priceMap = [:]
for(def d : dbcursor){ for(def d : dbcursor){
if(city == "福州"){
if(d.avg_price_2b){
d.avg_price = d.avg_price_2b
}
}
priceMap.put(d.region +"##"+d.district_name, d) priceMap.put(d.region +"##"+d.district_name, d)
} }
return priceMap return priceMap
@@ -33,7 +33,7 @@ class AddAvgpriceBatch {
// def districts = CommonDatautils.findDistrictByCityAndRegions("福州","district", ["马尾"], ["city","region","name", "estate_type2"]) // def districts = CommonDatautils.findDistrictByCityAndRegions("福州","district", ["马尾"], ["city","region","name", "estate_type2"])
for(def dist : districts){ for(def dist : districts){
//发重算均价命令 //发重算均价命令
addPrice(dist.city,dist.region,dist.name, dist.estate_type2, DateUtils.parseFromTightByPattern('2023-05-01','yyyy-MM-dd'),DateUtils.parseFromTightByPattern('2023-05-05','yyyy-MM-dd')) addPrice(dist.city,dist.region,dist.name, dist.estate_type2, DateUtils.parseFromTightByPattern('2023-06-30','yyyy-MM-dd'),DateUtils.parseFromTightByPattern('2023-07-05','yyyy-MM-dd'))
} }
} }
def run(){ def run(){
@@ -92,11 +92,10 @@ class DataStandardBatch extends BaseBatch{
cityMap.each{city,alias-> cityMap.each{city,alias->
println "开始加载【${city}】" println "开始加载【${city}】"
// if(city == "福州"){ // if(city == "广州"){
def detailMap = CommonDatautils.findAllCityDistrictNameAndAlias(city, "district", ["city","region","name","address","alias","addr_alias","mapping_alias","estate_type2"]) def detailMap = CommonDatautils.findAllCityDistrictNameAndAlias(city, "district", ["city","region","name","address","alias","addr_alias","mapping_alias","estate_type2"])
districtMap.putAll(detailMap) districtMap.putAll(detailMap)
// } // }
} }
while(flag){ while(flag){