feat(验证): 添加钢卷号和批次顺序的验证逻辑

在PDI创建和更新操作中添加以下验证:
1. 钢卷号必须为12位
2. 批次编号不能小于已有最大批次
3. 同一批次内顺序号不能重复且必须递增
This commit is contained in:
2026-04-10 08:04:07 +08:00
parent 89c6d3d1b5
commit 27f01f478f
2 changed files with 73 additions and 2 deletions

View File

@@ -1,9 +1,9 @@
from typing import Optional, List, Dict
from pydantic import BaseModel
from pydantic import BaseModel, Field
class PDIPLTMCreate(BaseModel):
coilid: str
coilid: str = Field(..., min_length=12, max_length=12, description="钢卷号必须为12位")
rollprogramnb: Optional[int] = None
sequencenb: Optional[int] = None
schedule_code: Optional[str] = None