feat(供应商管理): 新增规则引擎与词典配置支持

refactor(处理器): 重构通用供应商处理器以支持规则引擎
docs: 更新README与文档说明供应商管理功能
build: 更新打包脚本注入版本信息
test: 添加规则引擎单元测试
This commit is contained in:
2025-12-12 13:46:00 +08:00
parent 73d17836d7
commit fb12e63c4c
33 changed files with 8678 additions and 62 deletions
+3 -4
View File
@@ -605,17 +605,16 @@ class ExcelProcessor:
Returns:
表头行索引,如果未找到则返回None
"""
# 定义可能的表头关键词
header_keywords = [
'条码', '条形码', '商品条码', '商品名称', '名称', '数量', '单位', '单价',
'规格', '商品编码', '采购数量', '采购单位', '商品', '品名'
'规格', '商品编码', '采购数量', '采购单位', '商品', '品名',
'金额', '小计', '总计', '合计', '合计金额'
]
# 存储每行的匹配分数
row_scores = []
# 遍历前10行(通常表头不会太靠后)
max_rows_to_check = min(10, len(df))
max_rows_to_check = min(30, len(df))
for row in range(max_rows_to_check):
row_data = df.iloc[row]
score = 0
+1 -1
View File
@@ -298,4 +298,4 @@ class ProductValidator:
logger.warning(f"数量验证失败: {error_msg}")
validated_product['quantity'] = 0.0
return validated_product
return validated_product