From fa93e137ba6e114f3760cb79f24fbbe86f5de77b Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Wed, 13 Aug 2025 15:30:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A6=8F=E5=B7=9E=E4=BE=9B?= =?UTF-8?q?=E6=95=B0=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BA=8C=E6=AC=A1=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fuzhou/DistrictPriceExportBatch.groovy | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy index d6857d489..38c1dadec 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy @@ -1,5 +1,6 @@ package com.fangjia.script.fuzhou +import com.fangjia.core.util.DataUtil import com.fangjia.script.BaseBatch import com.fangjia.script.BatchOwner import com.fangjia.script.Watcher @@ -118,6 +119,7 @@ class DistrictPriceExportBatch extends BaseBatch{ def createNewDatas(def city){ def districts = null def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); + def lastMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -2, "yyyyMM")); def day = new Date().getDate() def startMDate = DateUtils.truncateDay(new Date()-1) @@ -133,6 +135,8 @@ class DistrictPriceExportBatch extends BaseBatch{ } def curPriceMap = findFzDistrictSellStat("福州",curDate) + def lastPriceMap = findFzDistrictStat("福州",lastMonth) + def result = [] for(def rMap : districts){ def curPrice = 0 @@ -141,6 +145,22 @@ class DistrictPriceExportBatch extends BaseBatch{ if(curPriceMap.containsKey(rMap.get("_id").toString())){ dbo = curPriceMap.get(rMap.get("_id").toString()) curPrice = dbo.avg_price + + def lastMonthPrice = lastPriceMap.get(rMap.get("_id").toString()) + if(curPrice && lastMonthPrice){ + if(dbo.value_type != 1){ + def mom = (curPrice - lastMonthPrice)/lastMonthPrice + if(Math.abs(mom)*100>=6){ + def randMarkup = nextDouble(2, 6) + if(mom < 0){ + mom = DataUtil.roundDouble(randMarkup*(-1)/100, 4) + }else{ + mom = DataUtil.roundDouble(randMarkup/100, 4) + } + curPrice = (int)(lastMonthPrice*mom + lastMonthPrice) + } + } + } }else{ curPrice = specialDistsPriceMap.get(rMap.name) if(curPrice){ @@ -177,6 +197,8 @@ class DistrictPriceExportBatch extends BaseBatch{ m << "周边楼盘" }else if(dbo.value_type == 6){ m << "推导" + }else if(dbo.value_type == 8) { + m << "新模型" }else if(dbo.value_type == 9){ m << "神经网络" }else if(dbo.value_type == 10){