From d84b8e94fd17ba4ca32210d8eb0d1ed4544bb716 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 9 Sep 2025 16:19:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20gen=5Fnumber=5Fwith=5Frule=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/wpm/views.py b/apps/wpm/views.py index eeccd4e7..2925f1c3 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -879,10 +879,12 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust c_month = handle_date.month m_model = material_out.model # 按生产日志查询 - wpr = Wpr.objects.filter(wpr_mlogbw__mlogb__mlog__mgroup=mlog.mgroup, + wpr = Wpr.objects.filter(wpr_mlogbw__mlogb__material_out__isnull=False, + wpr_mlogbw__mlogb__mlog__mgroup=mlog.mgroup, wpr_mlogbw__mlogb__mlog__is_fix=False, wpr_mlogbw__mlogb__mlog__submit_time__isnull=False, - wpr_mlogbw__mlogb__mlog__handle_date__year=c_year, wpr_mlogbw__mlogb__mlog__handle_date__month=c_month).order_by("number").last() + wpr_mlogbw__mlogb__mlog__handle_date__year=c_year, + wpr_mlogbw__mlogb__mlog__handle_date__month=c_month).order_by("number").last() cq_w = 4 if '02d' in rule: cq_w = 2