From f57632314f434bba5bb6a647488fcd7a5a2e0b13 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 10 Jul 2023 17:59:34 +0800 Subject: [PATCH] update --- .../fuzhou/DistrictSellStatBatch.groovy | 26 +++++++++++-------- .../fangjia/script/gj/AddAvgpriceBatch.groovy | 2 +- .../thirdPriceCrawl/DataStandardBatch.groovy | 3 +-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy index 585d07a4b..644156419 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy @@ -60,6 +60,7 @@ class DistrictSellStatBatch extends BaseBatch { } def calcMonthlyPrice(){ + //只有福州使用tob价格 def citys = CommonUtils.findAllCity() 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(dist.city == "福州"){ - if(Math.abs(mom)*100>3){ - if(dist.region != "马尾"){ - def randMarkup = nextDouble(0, 3) - if(mom < 0){ - mom = DataUtil.roundDouble(randMarkup*(-1)/100, 4) - }else{ - mom = DataUtil.roundDouble(randMarkup/100, 4) - } - curPrice = (int)(lastMonthPriceObj.avg_price*mom + lastMonthPriceObj.avg_price) - } - } +// if(Math.abs(mom)*100>3){ +// def randMarkup = nextDouble(0, 3) +// if(mom < 0){ +// mom = DataUtil.roundDouble(randMarkup*(-1)/100, 4) +// }else{ +// mom = DataUtil.roundDouble(randMarkup/100, 4) +// } +// curPrice = (int)(lastMonthPriceObj.avg_price*mom + lastMonthPriceObj.avg_price) +// } }else{ if(Math.abs(mom)*100>10){ def randMarkup = nextDouble(0, 10) @@ -232,6 +231,11 @@ class DistrictSellStatBatch extends BaseBatch { def dbcursor = DISTRICT_STAT.find(q) def priceMap = [:] 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) } return priceMap diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/AddAvgpriceBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/AddAvgpriceBatch.groovy index db43ba788..34fa4eefe 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/AddAvgpriceBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/AddAvgpriceBatch.groovy @@ -33,7 +33,7 @@ class AddAvgpriceBatch { // def districts = CommonDatautils.findDistrictByCityAndRegions("福州","district", ["马尾"], ["city","region","name", "estate_type2"]) 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(){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy index 1088430e3..8379df446 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy @@ -92,11 +92,10 @@ class DataStandardBatch extends BaseBatch{ cityMap.each{city,alias-> println "开始加载【${city}】" -// if(city == "福州"){ +// if(city == "广州"){ def detailMap = CommonDatautils.findAllCityDistrictNameAndAlias(city, "district", ["city","region","name","address","alias","addr_alias","mapping_alias","estate_type2"]) districtMap.putAll(detailMap) // } - } while(flag){