diff --git a/apps/enm/tasks.py b/apps/enm/tasks.py index d085b7f1..2269a649 100644 --- a/apps/enm/tasks.py +++ b/apps/enm/tasks.py @@ -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: