From ac41f5a105f6ef9797d869bdf3d9a0160835fc7c Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 11 Feb 2025 14:40:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=B2=97=E4=B8=AD=E7=BB=86=E7=A3=A8?= =?UTF-8?q?=E7=9A=84=E7=BB=9F=E8=AE=A1=E8=A6=81=E6=B6=B5=E7=9B=96=E7=B2=97?= =?UTF-8?q?=E7=A3=A8=E5=92=8C=E7=B2=97=E4=B8=AD=E7=A3=A8=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services_2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/wpm/services_2.py b/apps/wpm/services_2.py index 8d9e3c75..6795f089 100644 --- a/apps/wpm/services_2.py +++ b/apps/wpm/services_2.py @@ -230,8 +230,11 @@ def get_alldata_with_batch(batch: str): # 六车间工段生产数据 mgroup_list = ["平头", "粘铁头", "粗中细磨", "抛光", "开槽"] for mgroup_name in mgroup_list: - mgroup = Mgroup.objects.get(name=mgroup_name) - mlogs_qs = Mlog.objects.filter(submit_time__isnull=False, mgroup=mgroup, batch=batch) + if mgroup_name == '粗中细磨': + mgroups = Mgroup.objects.filter(name__in=['粗磨', '粗中磨', '粗中细磨']) + else: + mgroups = Mgroup.objects.filter(name=mgroup_name) + mlogs_qs = Mlog.objects.filter(submit_time__isnull=False, mgroup__in=mgroups, batch=batch) if mlogs_qs.exists(): last_time = item.update_time if item.update_time > last_time else last_time data[f'六车间_{mgroup_name}_日期'] = []