From fa18fee7203c541baed34594cc202eb5ec0cfbee Mon Sep 17 00:00:00 2001 From: zty Date: Tue, 21 Jan 2025 09:40:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Aremove=20=E7=A2=B3=E6=8E=92?= =?UTF-8?q?=E6=94=BE=E5=BC=BA=E5=BA=A6=E8=AE=A1=E7=AE=97=E5=92=8C=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enm/migrations/0056_auto_20250121_0940.py | 21 +++++++++++++++++++ apps/enm/models.py | 2 -- apps/enm/tasks.py | 6 ------ 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 apps/enm/migrations/0056_auto_20250121_0940.py diff --git a/apps/enm/migrations/0056_auto_20250121_0940.py b/apps/enm/migrations/0056_auto_20250121_0940.py new file mode 100644 index 00000000..d11bba92 --- /dev/null +++ b/apps/enm/migrations/0056_auto_20250121_0940.py @@ -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', + ), + ] diff --git a/apps/enm/models.py b/apps/enm/models.py index ddc58346..d091df5f 100644 --- a/apps/enm/models.py +++ b/apps/enm/models.py @@ -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) diff --git a/apps/enm/tasks.py b/apps/enm/tasks.py index 1634ebfb..d1ab7eae 100644 --- a/apps/enm/tasks.py +++ b/apps/enm/tasks.py @@ -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":