fix: 未注册为task

This commit is contained in:
caoqianming 2023-08-02 14:28:13 +08:00
parent 7619e5156c
commit 5c3af36441
1 changed files with 2 additions and 1 deletions

View File

@ -225,6 +225,7 @@ def cal_mpointstat_manual(mpointId: str, sflogId: str, mgroupId: str, year: int,
types_list = ['hour_s', 'sflog', 'day_s', 'month_st', 'month_s', 'year_s']
@shared_task(base=CustomTask)
def cal_enstat(type, sflogId, mgroupId, year, month, day, hour, year_s, month_s, day_s, cascade=True, cal_attrs=[]):
"""
计算能源数据统计
@ -462,7 +463,7 @@ def get_total_hour_now_and_shut_hour(enstat: EnStat):
)
return res['sum1'] if res['sum1'] else 0, res['sum2'] if res['sum2'] else 0
@shared_task(base=CustomTask)
def cal_enstat2(year_s: int, month_s: int):
enstat2, _ = EnStat2.objects.get_or_create(year_s=year_s, month_s=month_s, defaults={'year_s': year_s, 'month_s': month_s})
material_cement = Material.objects.get(code='cement')