fix: 更新所监测设备测点的total_production筛选条件错误

This commit is contained in:
caoqianming 2024-05-14 13:53:23 +08:00
parent 7f1dbda3b0
commit 6ba99f119a
1 changed files with 3 additions and 3 deletions

View File

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