This commit is contained in:
caoqianming 2024-11-07 09:02:08 +08:00
commit 0ba6737661
1 changed files with 2 additions and 2 deletions

View File

@ -577,11 +577,11 @@ def cal_enstat(type, sflogId, mgroupId, year, month, day, hour, year_s, month_s,
enstat.celec_consume_unit = enstat.elec_consume_unit + get_sysconfig('enm.enm_lhxs') * pre_enstat.elec_consume_unit
if pre_enstat2:
try:
pre_enstat2.production_elec_consume_unit = enstat.elec_consume / enstat.total_production
pre_enstat2.production_elec_consume_unit = pre_enstat2.elec_consume / enstat.total_production
except ZeroDivisionError:
pre_enstat2.production_elec_consume_unit = 0
pre_enstat2.save(update_fields=["production_elec_consume_unit"])
enstat.celec_consume_unit += enstat.production_elec_consume_unit
enstat.celec_consume_unit += pre_enstat2.production_elec_consume_unit
enstat.save()
# 算总煤耗
if "pcoal" in this_cal_attrs: