feat: gen_number_with_rule 添加校验

This commit is contained in:
caoqianming 2025-10-27 16:33:23 +08:00
parent 1ea8a30d14
commit bc0200669b
1 changed files with 4 additions and 0 deletions

View File

@ -948,6 +948,10 @@ class MlogbInViewSet(BulkCreateModelMixin, BulkUpdateModelMixin, BulkDestroyMode
c_year2 = str(c_year)[-2:] c_year2 = str(c_year)[-2:]
c_month = handle_date.month c_month = handle_date.month
m_model = material_out.model m_model = material_out.model
if m_model is None:
raise ParseError("生成编号出错:产品型号不能为空")
elif m_model and m_model.is_lower():
raise ParseError("生成编号出错:产品型号不能为小写")
# 按生产日志查询 # 按生产日志查询
wpr = ( wpr = (
Wpr.objects.filter( Wpr.objects.filter(