Merge branch 'dev' into runny827
feat(training): 新增精益培训视频与周任务管理 # Conflicts: # backend/app/models/__init__.py
This commit is contained in:
1 parent
85d27e9ffa
commit
91b7233872
812 files changed
+73763
-18908
No files matched your search
@@ -22,6 +22,7 @@ _ATOMIC_PO_NUMBER_PATTERN = re.compile(r"[A-Za-z0-9][A-Za-z0-9\-_/]*")
|
||||
def normalize_po_number(value: Any) -> str:
|
||||
"""
|
||||
标准化采购单号;Wistron 等客户原文常带 ZNB 前缀(如 ZNB16754796 / ZNB-16754796),输出为纯数字段。
|
||||
纯数字 PO 前导零视为格式差异(0060208010 与 60208010 是同一张 PO),统一剥除,避免跨来源误判冲突。
|
||||
"""
|
||||
text = str(value or "").strip()
|
||||
if not text:
|
||||
@@ -32,8 +33,8 @@ def normalize_po_number(value: Any) -> str:
|
||||
if upper.startswith("ZNB") and len(text) > 3:
|
||||
tail = text[3:].strip().lstrip("-_/ ")
|
||||
if tail.isdigit():
|
||||
return tail
|
||||
return text
|
||||
return tail.lstrip("0") or "0"
|
||||
return text.lstrip("0") or "0"
|
||||
|
||||
|
||||
def normalize_atomic_po_number(value: Any) -> str:
|
||||
|
||||
Reference in new issue
Block a user