From 6ba99f119ad8844ffe816d59a420a17065759496 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 14 May 2024 13:53:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=89=80=E7=9B=91?= =?UTF-8?q?=E6=B5=8B=E8=AE=BE=E5=A4=87=E6=B5=8B=E7=82=B9=E7=9A=84total=5Fp?= =?UTF-8?q?roduction=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/enm/tasks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/enm/tasks.py b/apps/enm/tasks.py index d67d8ccc..c73ba2cb 100644 --- a/apps/enm/tasks.py +++ b/apps/enm/tasks.py @@ -448,9 +448,9 @@ def cal_enstat(type, sflogId, mgroupId, year, month, day, hour, year_s, month_s, elec_consume_unit = 0 else: elec_consume_unit = F("val") / total_production - MpointStat.objects.filter(mgroup=enstat.mgroup, mpoint__material__code="elec").exclude(mpoint__ep_monitored=None).update( - total_production=total_production, elec_consume_unit=elec_consume_unit - ) + MpointStat.objects.filter( + mgroup=enstat.mgroup, mpoint__material__code="elec", type=enstat.type, year_s=enstat.year_s, month_s=enstat.month_s, day_s=enstat.day_s, hour=enstat.hour + ).exclude(mpoint__ep_monitored=None).update(total_production=total_production, elec_consume_unit=elec_consume_unit) if enstat.mgroup.cate == "section": if "material" in this_cal_attrs: # 算能耗