diff --git a/apps/enm/tasks.py b/apps/enm/tasks.py index 30ae571e..d7b291f7 100644 --- a/apps/enm/tasks.py +++ b/apps/enm/tasks.py @@ -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')