feat: gen_number_with_rule bug2

This commit is contained in:
caoqianming 2025-06-11 11:02:50 +08:00
parent fea3c320a9
commit 0719ef8f42
1 changed files with 2 additions and 2 deletions

View File

@ -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}")