From 5c3af36441fdd2cef4cb0ac4ebdd3101cc8330ca Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 2 Aug 2023 14:28:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9C=AA=E6=B3=A8=E5=86=8C=E4=B8=BAtask?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/enm/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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')