fix:
This commit is contained in:
@@ -23,6 +23,7 @@ def create_last_month_publish_data():
|
||||
# 检查是否生成上月数据
|
||||
query = PriceResult.get_query(year=year, month=month)
|
||||
result = PriceResult.get_list(query)
|
||||
# todo 有修改记录的忽略,其余都重新生成
|
||||
if not result:
|
||||
calculate(year=year, month=month)
|
||||
|
||||
|
@@ -15,6 +15,14 @@ from calculators.asphalt_imported_modifier import AsphaltImportedModifierCalcula
|
||||
|
||||
|
||||
def calculate(year=2023, month=8):
|
||||
"""
|
||||
计算生成趋势表
|
||||
"""
|
||||
# todo-1 价格计算触发器
|
||||
# todo-1 十一地市 交通局 计算调整
|
||||
# todo-1 十一地市 公路局 计算调整
|
||||
# todo-1 十一地市 调查表 计算调整
|
||||
# todo-1 十一地市 网络价格 计算调整
|
||||
for Calculator in [
|
||||
AsphaltDomesticCalculator,
|
||||
AsphaltImportedCalculator,
|
||||
|
@@ -2,6 +2,9 @@ from collectors import Collector
|
||||
|
||||
|
||||
def collect(year=2023, month=11):
|
||||
"""
|
||||
整理发布价格
|
||||
"""
|
||||
collector = Collector(year, month)
|
||||
collector.run()
|
||||
|
||||
|
30
web/tasks/once/init_db.py
Normal file
30
web/tasks/once/init_db.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from core.factory import ClientApp
|
||||
|
||||
if __name__ == '__main__':
|
||||
from core.extensions import db
|
||||
from commons.models.asphalt_domestic import *
|
||||
from commons.models.asphalt_imported import *
|
||||
from commons.models.asphalt_modifier import *
|
||||
from commons.models.budget import *
|
||||
from commons.models.budget_item import *
|
||||
from commons.models.cement import *
|
||||
from commons.models.data_fujian import *
|
||||
from commons.models.data_guangdong import *
|
||||
from commons.models.data_zhejiang import *
|
||||
from commons.models.fujian_survey import *
|
||||
from commons.models.fuzhou_highway_bureau import *
|
||||
from commons.models.fuzhou_transportation_bureau import *
|
||||
from commons.models.local_material import *
|
||||
from commons.models.material import *
|
||||
from commons.models.material_task import *
|
||||
from commons.models.oil import *
|
||||
from commons.models.price_publish import *
|
||||
from commons.models.price_result import *
|
||||
from commons.models.sanming_steel import *
|
||||
from commons.models.steel_plate import *
|
||||
from commons.models.steel_rebar import *
|
||||
from commons.models.steel_section import *
|
||||
from commons.models.steel_strand import *
|
||||
|
||||
with ClientApp().app_context():
|
||||
db.create_all()
|
Reference in New Issue
Block a user