feat: 新增住建厅价格计算
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from sqlalchemy import func
|
||||
|
||||
from calculators import Calculator
|
||||
from commons.models.data_fujian import DataFujian
|
||||
from commons.models.data_network import DataNetwork
|
||||
from commons.models.fujian_survey import FujianSurvey
|
||||
from commons.models.fuzhou_highway_bureau import FuzhouHighwayBureau
|
||||
@@ -16,10 +17,6 @@ class Reber400Calculator(Calculator):
|
||||
unit = "t"
|
||||
spec = ""
|
||||
|
||||
def __init__(self, year, month):
|
||||
self.year = year
|
||||
self.month = month
|
||||
|
||||
def _get_ftb_price(self):
|
||||
query = FuzhouTransportationBureau.get_query(self.year, self.month, name='带肋钢筋')
|
||||
data = query.first()
|
||||
@@ -55,6 +52,13 @@ class Reber400Calculator(Calculator):
|
||||
fluctuating = int(self._get_fluctuating('price_survey', price))
|
||||
return price, fluctuating
|
||||
|
||||
def _get_fujian_price(self):
|
||||
query = DataFujian.get_query(self.year, self.month, name='圆钢筋', spec='HRB400EΦ20')
|
||||
data = query.first()
|
||||
price = data.price if data else 0
|
||||
fluctuating = self._get_fluctuating('price_fujian', price)
|
||||
return price, fluctuating
|
||||
|
||||
def _get_recommend_price(self):
|
||||
self._fluctuatings = [self.fluctuating_network, self.fluctuating_survey, self.fluctuating_fhb, self.fluctuating_ftb, self.fluctuating_ss]
|
||||
return super()._get_recommend_price()
|
||||
|
Reference in New Issue
Block a user