From 0719ef8f4234239b91a21cdb605fbdbad1ecdd7f Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 11 Jun 2025 11:02:50 +0800 Subject: [PATCH] feat: gen_number_with_rule bug2 --- apps/wpm/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wpm/views.py b/apps/wpm/views.py index 2d69ea39..6d9a1636 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -706,9 +706,9 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust raise ParseError(f"获取该类产品最后编号错误: {str(e)}") try: if gen_count == 1: - return rule.format(c_year=c_year, c_month=c_month, m_model=m_model, n_count=n_count, c_year2=c_year2) + return rule.format(c_year=c_year, c_month=c_month, m_model=m_model, n_count=n_count+1, 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, c_year2=c_year2) 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+1, c_year2=c_year2) for i in range(gen_count)] except Exception as e: raise ParseError(f"个号生成错误: {e}")