feat:remove 碳排放强度计算和字段
This commit is contained in:
parent
bec6600089
commit
fa18fee720
|
@ -0,0 +1,21 @@
|
|||
# Generated by Django 3.2.12 on 2025-01-21 01:40
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('enm', '0055_auto_20250120_1318'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='enstat',
|
||||
name='carbon_emission',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='enstat',
|
||||
name='carbon_emission_unit',
|
||||
),
|
||||
]
|
|
@ -165,8 +165,6 @@ class EnStat(BaseModel):
|
|||
shut_sec = models.PositiveIntegerField("停机时长", default=0, help_text="s")
|
||||
run_rate = models.FloatField("运转率", default=0, help_text="%")
|
||||
ammonia_consume = models.FloatField("氨水消耗", default=0, help_text="t")
|
||||
carbon_emission = models.FloatField("碳排放", default=0, help_text="t")
|
||||
carbon_emission_unit = models.FloatField("碳排放强度", default=0, help_text="t/t")
|
||||
note = models.TextField("备注", default="", blank=True)
|
||||
|
||||
|
||||
|
|
|
@ -564,12 +564,6 @@ def cal_enstat(type, sflogId, mgroupId, year, month, day, hour, year_s, month_s,
|
|||
enstat.elec_consume_unit = enstat.elec_consume / enstat.total_production
|
||||
except ZeroDivisionError:
|
||||
enstat.elec_consume_unit = 0
|
||||
elif material.code == "carbon":
|
||||
enstat.carbon_emission = amount_consume
|
||||
try:
|
||||
enstat.carbon_emission_unit = enstat.carbon_emission / enstat.total_production
|
||||
except ZeroDivisionError:
|
||||
enstat.carbon_emission_unit = 0
|
||||
elif material.code == "water":
|
||||
enstat.water_consume = amount_consume
|
||||
elif material.code == "pcoal":
|
||||
|
|
Loading…
Reference in New Issue