Merge branch 'dev' into runny827

feat(training): 新增精益培训视频与周任务管理

# Conflicts:
#	backend/app/models/__init__.py
This commit is contained in:
runny committed 2026-09-08 18:30:09 +08:00
1 parent 85d27e9ffa
commit 91b7233872
812 files changed
+73763 -18908

No files matched your search

@@ -15,7 +15,7 @@ def _norm(value: Any) -> str:
return str(value or "").strip()
def _line_key(row: dict[str, Any], fields: list[str]) -> tuple[str, ...] | None:
def _match_identity(row: dict[str, Any], fields: list[str]) -> tuple[str, ...] | None:
"""按配置字段列表构造确定性匹配键;任一字段为空时该行不可匹配。"""
values = tuple(_norm(row.get(field)).casefold() for field in fields)
return values if values and all(values) else None
@@ -27,7 +27,7 @@ def _aggregate_inventory(
"""按用户配置的库存匹配字段组合汇总唯一数量字段。"""
totals: dict[tuple[str, ...], float] = {}
for row in inventory_lines:
key = _line_key(row, match_fields)
key = _match_identity(row, match_fields)
if key is None:
continue
try:
@@ -70,7 +70,7 @@ def match_notice_lines(
# [STEP 2] 逐订单行计算 ok/partial/shortage 并收集缺口明细。
total_lines = len(notice_lines)
for index, line in enumerate(notice_lines, start=1):
order_key = _line_key(line, order_fields)
order_key = _match_identity(line, order_fields)
try:
required = float(line.get("__required_qty") or 0)
except (TypeError, ValueError):