feat: 新增住建厅价格计算
This commit is contained in:
@@ -45,12 +45,19 @@ class Calculator:
|
||||
price_calculate = 0
|
||||
price_recommend = 0
|
||||
fluctuating_recommend = 0
|
||||
price_fujian = 0
|
||||
fluctuating_fujian = 0
|
||||
unit = ""
|
||||
spec = ''
|
||||
|
||||
_previous_prices = None
|
||||
_fluctuatings = []
|
||||
|
||||
def __init__(self, year, month, force=True):
|
||||
self.year = year
|
||||
self.month = month
|
||||
self.force = True # todo-2 已修改的的发布价不在覆盖计算
|
||||
|
||||
@property
|
||||
def previous_prices(self):
|
||||
if not self._previous_prices:
|
||||
@@ -78,6 +85,8 @@ class Calculator:
|
||||
'price_calculate': self.price_calculate,
|
||||
'price_recommend': self.price_recommend,
|
||||
'fluctuating_recommend': self.fluctuating_recommend,
|
||||
'price_fujian': self.price_fujian,
|
||||
'fluctuating_fujian': self.fluctuating_fujian,
|
||||
'unit': self.unit,
|
||||
'spec': self.spec,
|
||||
}
|
||||
@@ -91,6 +100,7 @@ class Calculator:
|
||||
self.price_last_month = self._get_last_month_price()
|
||||
self.price_calculate = self._get_calculate_price()
|
||||
self.price_recommend, self.fluctuating_recommend = self._get_recommend_price()
|
||||
self.price_fujian, self.fluctuating_fujian = self._get_fujian_price()
|
||||
return self
|
||||
|
||||
def _get_ftb_price(self):
|
||||
@@ -108,6 +118,9 @@ class Calculator:
|
||||
def _get_survey_price(self):
|
||||
return 0, 0
|
||||
|
||||
def _get_fujian_price(self):
|
||||
return 0, 0
|
||||
|
||||
def _get_last_month_price(self):
|
||||
return getattr(self.previous_prices, 'price_recommend', 0)
|
||||
|
||||
|
Reference in New Issue
Block a user