From e214c6115af16bfc78ca1838511e75565cc0a814 Mon Sep 17 00:00:00 2001 From: zty Date: Fri, 10 Oct 2025 16:32:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ofm-models=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/enm/tasks.py | 6 ++--- .../ofm/migrations/0017_auto_20251010_1631.py | 23 +++++++++++++++++++ apps/ofm/models.py | 3 ++- 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 apps/ofm/migrations/0017_auto_20251010_1631.py diff --git a/apps/enm/tasks.py b/apps/enm/tasks.py index 13d34021..6edfbd93 100644 --- a/apps/enm/tasks.py +++ b/apps/enm/tasks.py @@ -167,11 +167,11 @@ def get_first_stlog_time_from_duration(mgroup:Mgroup, dt_start:datetime, dt_end: if st: return st, "ending" - st = st_qs.filter(start_time__gte=dt_start, start_time__lte=dt_end, duration_sec__lte=600).order_by("start_time").last() + st = st_qs.filter(start_time__gte=dt_start, start_time__lte=dt_end, duration_sec__gte=600).order_by("start_time").last() if st: return st, "start" - st = st_qs.filter(end_time__gte=dt_start, end_time__lte=dt_end, duration_sec__lte=600).order_by("end_time").first() + st = st_qs.filter(end_time__gte=dt_start, end_time__lte=dt_end, duration_sec__gte=600).order_by("end_time").first() if st: return st, "end" @@ -213,7 +213,7 @@ def cal_mpointstat_hour(mpointId: str, year: int, month: int, day: int, hour: in val = abs(first_val - last_val) else: xtype = "normal" - if mpointfrom and mpoint.cal_related_mgroup_running == 10: + if mpointfrom and mpoint.cal_related_mgroup_running == 20: stlog, xtype = get_first_stlog_time_from_duration(mpoint.mgroup, dt, dt_hour_n) diff --git a/apps/ofm/migrations/0017_auto_20251010_1631.py b/apps/ofm/migrations/0017_auto_20251010_1631.py new file mode 100644 index 00000000..36ce2c26 --- /dev/null +++ b/apps/ofm/migrations/0017_auto_20251010_1631.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.12 on 2025-10-10 08:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('ofm', '0016_auto_20250929_1551'), + ] + + operations = [ + migrations.AddField( + model_name='publicity', + name='secret_period', + field=models.CharField(blank=True, max_length=50, null=True, verbose_name='秘密期限'), + ), + migrations.AlterField( + model_name='publicity', + name='level', + field=models.JSONField(default=list, help_text=['重要', '一般', '非涉密'], verbose_name='涉密等级'), + ), + ] diff --git a/apps/ofm/models.py b/apps/ofm/models.py index 91a0a422..5b529d8a 100644 --- a/apps/ofm/models.py +++ b/apps/ofm/models.py @@ -127,7 +127,7 @@ class Publicity(CommonBDModel): participants = models.CharField('所有撰稿人', max_length=50) pub_dept = models.CharField('部室/研究院', null=True, blank=True, max_length=50) pfile = models.CharField('稿件路径', null=True, blank=True, max_length=100) - level = models.JSONField('用途', default=list, help_text=['重要', '一般', '非涉密']) + level = models.JSONField('涉密等级', default=list, help_text=['重要', '一般', '非涉密']) content = models.JSONField('稿件内容涉及', default=list, help_text=[ "武器装备科研生产综合事项", "其它" @@ -139,6 +139,7 @@ class Publicity(CommonBDModel): report_name = models.CharField('报道名称', max_length=50, blank=True, null=True) review = models.JSONField('第一撰稿人自审', default=list, help_text=['内容不涉及国家秘密和商业秘密,申请公开', '内容涉及国家秘密,申请按涉密渠道发布']) dept_opinion = models.JSONField('部门负责人意见', default=list, help_text=['同意', '不同意']) + secret_period = models.CharField('秘密期限', max_length=50, blank=True, null=True) dept_opinion_review = models.CharField('部门审查意见', max_length=100, blank=True, null=True) publicity_opinion = models.JSONField('宣传统战部审查意见', default=list, help_text=['同意公开宣传报道', '不同意任何渠道的宣传报道']) ticket = models.ForeignKey('wf.ticket', verbose_name='关联工单',