feat: enm 回转窑综合电耗计算
This commit is contained in:
parent
5fe86c3e98
commit
8ec5f8c6dd
|
|
@ -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
|
enstat.celec_consume_unit = enstat.elec_consume_unit + get_sysconfig('enm.enm_lhxs') * pre_enstat.elec_consume_unit
|
||||||
if pre_enstat2:
|
if pre_enstat2:
|
||||||
try:
|
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:
|
except ZeroDivisionError:
|
||||||
pre_enstat2.production_elec_consume_unit = 0
|
pre_enstat2.production_elec_consume_unit = 0
|
||||||
pre_enstat2.save(update_fields=["production_elec_consume_unit"])
|
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()
|
enstat.save()
|
||||||
# 算总煤耗
|
# 算总煤耗
|
||||||
if "pcoal" in this_cal_attrs:
|
if "pcoal" in this_cal_attrs:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue