fix: 修复计算后未移除多余材料的问题
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from calculators import RoundMethod
|
||||
from commons.models.material import Material
|
||||
from commons.models.price_result import PriceResult
|
||||
|
||||
|
||||
def calculate(year=2023, month=8):
|
||||
@@ -8,6 +9,8 @@ def calculate(year=2023, month=8):
|
||||
"""
|
||||
from calculators import Calculator
|
||||
|
||||
# 清空当月数据
|
||||
PriceResult.clean(year, month)
|
||||
# 从材料表获取趋势表所需的材料信息
|
||||
for material in Material.query.all():
|
||||
calculator = Calculator(year=year, month=month)
|
||||
@@ -36,7 +39,7 @@ if __name__ == '__main__':
|
||||
from core.factory import ClientApp
|
||||
|
||||
with ClientApp().app_context():
|
||||
calculate(2024, 8)
|
||||
calculate(2024, 7)
|
||||
|
||||
# for i in range(2, 12):
|
||||
# calculate(2022, i+1)
|
||||
|
Reference in New Issue
Block a user