From 05bf1def23f999e634594c3464714aae0f386ac2 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 16 May 2025 16:04:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20wpr=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E9=80=BB=E8=BE=912?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/wpm/views.py b/apps/wpm/views.py index a78f74f2..34aa7ce0 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -690,15 +690,16 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust from apps.wpmw.models import Wpr now = timezone.now() c_year = now.year + c_year2 = str(c_year)[-2:] c_month = now.month m_model = material_out.model wps_qs = Wpr.objects.filter(material_start=material_out, create_time__year=c_year, create_time__month=c_month).order_by("create_time") n_count = wps_qs.count() + 1 try: if gen_count == 1: - return rule.format(c_year=c_year, c_month=c_month, m_model=m_model, n_count=n_count) + return rule.format(c_year=c_year, c_month=c_month, m_model=m_model, n_count=n_count, c_year2=c_year2) else: - return [rule.format(c_year=c_year, c_month=c_month, m_model=m_model, n_count=n_count+i) for i in range(gen_count)] + return [rule.format(c_year=c_year, c_month=c_month, m_model=m_model, n_count=n_count+i, c_year2=c_year2) for i in range(gen_count)] except (KeyError, ValueError) as e: raise ParseError(f"个号生成错误: {e}")