修改福州供数逻辑,二次控制
This commit is contained in:
+22
@@ -1,5 +1,6 @@
|
|||||||
package com.fangjia.script.fuzhou
|
package com.fangjia.script.fuzhou
|
||||||
|
|
||||||
|
import com.fangjia.core.util.DataUtil
|
||||||
import com.fangjia.script.BaseBatch
|
import com.fangjia.script.BaseBatch
|
||||||
import com.fangjia.script.BatchOwner
|
import com.fangjia.script.BatchOwner
|
||||||
import com.fangjia.script.Watcher
|
import com.fangjia.script.Watcher
|
||||||
@@ -118,6 +119,7 @@ class DistrictPriceExportBatch extends BaseBatch{
|
|||||||
def createNewDatas(def city){
|
def createNewDatas(def city){
|
||||||
def districts = null
|
def districts = null
|
||||||
def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
|
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 day = new Date().getDate()
|
||||||
def startMDate = DateUtils.truncateDay(new Date()-1)
|
def startMDate = DateUtils.truncateDay(new Date()-1)
|
||||||
@@ -133,6 +135,8 @@ class DistrictPriceExportBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
|
|
||||||
def curPriceMap = findFzDistrictSellStat("福州",curDate)
|
def curPriceMap = findFzDistrictSellStat("福州",curDate)
|
||||||
|
def lastPriceMap = findFzDistrictStat("福州",lastMonth)
|
||||||
|
|
||||||
def result = []
|
def result = []
|
||||||
for(def rMap : districts){
|
for(def rMap : districts){
|
||||||
def curPrice = 0
|
def curPrice = 0
|
||||||
@@ -141,6 +145,22 @@ class DistrictPriceExportBatch extends BaseBatch{
|
|||||||
if(curPriceMap.containsKey(rMap.get("_id").toString())){
|
if(curPriceMap.containsKey(rMap.get("_id").toString())){
|
||||||
dbo = curPriceMap.get(rMap.get("_id").toString())
|
dbo = curPriceMap.get(rMap.get("_id").toString())
|
||||||
curPrice = dbo.avg_price
|
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{
|
}else{
|
||||||
curPrice = specialDistsPriceMap.get(rMap.name)
|
curPrice = specialDistsPriceMap.get(rMap.name)
|
||||||
if(curPrice){
|
if(curPrice){
|
||||||
@@ -177,6 +197,8 @@ class DistrictPriceExportBatch extends BaseBatch{
|
|||||||
m << "周边楼盘"
|
m << "周边楼盘"
|
||||||
}else if(dbo.value_type == 6){
|
}else if(dbo.value_type == 6){
|
||||||
m << "推导"
|
m << "推导"
|
||||||
|
}else if(dbo.value_type == 8) {
|
||||||
|
m << "新模型"
|
||||||
}else if(dbo.value_type == 9){
|
}else if(dbo.value_type == 9){
|
||||||
m << "神经网络"
|
m << "神经网络"
|
||||||
}else if(dbo.value_type == 10){
|
}else if(dbo.value_type == 10){
|
||||||
|
|||||||
Reference in New Issue
Block a user