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: # 算能耗