From e6cad72807911dc2703a13c1bdfd71b6fe37974a Mon Sep 17 00:00:00 2001 From: zty Date: Tue, 10 Dec 2024 14:12:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20enm=20=E5=A2=9E=E5=8A=A0=E6=B0=A8?= =?UTF-8?q?=E6=B0=B4=E6=B6=88=E8=80=97=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0049_enstat_ammonia_consume.py | 18 ++++++++++++++++++ apps/enm/models.py | 1 + apps/enm/tasks.py | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 apps/enm/migrations/0049_enstat_ammonia_consume.py diff --git a/apps/enm/migrations/0049_enstat_ammonia_consume.py b/apps/enm/migrations/0049_enstat_ammonia_consume.py new file mode 100644 index 00000000..7d28a629 --- /dev/null +++ b/apps/enm/migrations/0049_enstat_ammonia_consume.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2024-12-09 06:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('enm', '0048_auto_20241129_1649'), + ] + + operations = [ + migrations.AddField( + model_name='enstat', + name='ammonia_consume', + field=models.FloatField(default=0, help_text='t', verbose_name='氨水消耗'), + ), + ] diff --git a/apps/enm/models.py b/apps/enm/models.py index 2b06f3fd..e9d1e14c 100644 --- a/apps/enm/models.py +++ b/apps/enm/models.py @@ -154,6 +154,7 @@ class EnStat(BaseModel): run_sec = models.PositiveIntegerField("运转时长", default=0, help_text="s") 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") class EnStat2(BaseModel): diff --git a/apps/enm/tasks.py b/apps/enm/tasks.py index 17c534eb..98dc6618 100644 --- a/apps/enm/tasks.py +++ b/apps/enm/tasks.py @@ -506,6 +506,8 @@ def cal_enstat(type, sflogId, mgroupId, year, month, day, hour, year_s, month_s, elif material.code == "steam": enstat.out_steam = amount_consume enstat.out_steam_coal = enstat.out_steam * 128.6 / 1000 + elif material.code == "ammonia": + enstat.ammonia_consume = amount_consume elif material.code == "ccr": enstat.ccr_consume = amount_consume enstat.kiln_end_heat = enstat.total_production - enstat.ccr_consume