diff --git a/app/core/excel/handlers/unit_converter_handlers.py b/app/core/excel/handlers/unit_converter_handlers.py index 7aac214..9cce4e9 100644 --- a/app/core/excel/handlers/unit_converter_handlers.py +++ b/app/core/excel/handlers/unit_converter_handlers.py @@ -63,8 +63,9 @@ class JianUnitHandler(UnitHandler): Returns: 是否可以处理 """ - unit = product.get('unit', '') - return unit == '件' + unit = str(product.get('unit', '')).strip() + # 匹配"件"、"件、"、"件装"等 + return unit == '件' or unit.startswith('件') def handle(self, product: Dict[str, Any], level1: int, level2: int, level3: Optional[int]) -> Dict[str, Any]: """ @@ -117,8 +118,9 @@ class BoxUnitHandler(UnitHandler): Returns: 是否可以处理 """ - unit = product.get('unit', '') - return unit == '箱' + unit = str(product.get('unit', '')).strip() + # 匹配"箱"、"箱、"、"箱装"等 + return unit == '箱' or unit.startswith('箱') def handle(self, product: Dict[str, Any], level1: int, level2: int, level3: Optional[int]) -> Dict[str, Any]: """ @@ -171,8 +173,8 @@ class TiHeUnitHandler(UnitHandler): Returns: 是否可以处理 """ - unit = product.get('unit', '') - return unit in ['提', '盒'] + unit = str(product.get('unit', '')).strip() + return unit in ['提', '盒'] or unit.startswith('提') or unit.startswith('盒') def handle(self, product: Dict[str, Any], level1: int, level2: int, level3: Optional[int]) -> Dict[str, Any]: """ diff --git a/app/core/excel/processor.py b/app/core/excel/processor.py index 771328b..4a9245d 100644 --- a/app/core/excel/processor.py +++ b/app/core/excel/processor.py @@ -253,6 +253,20 @@ class ExcelProcessor: # 跳过空条码行 if not product['barcode']: continue + + # 检查备注列,过滤换货、退货、作废等非采购行 + skip_row = False + for col in df.columns: + col_str = str(col) + if any(k in col_str for k in ['备注', '说明', '类型', '备注1']): + val = str(row[col]).strip() + # 过滤常见的非采购关键字 + if any(k in val for k in ['换货', '退货', '作废', '减钱', '冲减', '赠品单', '补货']): + logger.info(f"过滤非采购行: {product['barcode']} - {product.get('name', '')}, 原因: {col_str}包含 '{val}'") + skip_row = True + break + if skip_row: + continue # 提取商品名称 if '商品名称' in df.columns and not pd.isna(row['商品名称']): diff --git a/config.ini b/config.ini index 7ca0a43..27bfaeb 100644 --- a/config.ini +++ b/config.ini @@ -27,4 +27,5 @@ max_file_size_mb = 4 purchase_order = 银豹-采购单模板.xls [App] -version = 2026.03.25.2048 \ No newline at end of file +version = 2026.03.25.2048 + diff --git a/logs/app.core.excel.converter.log b/logs/app.core.excel.converter.log index 3fb642b..b8f538b 100644 --- a/logs/app.core.excel.converter.log +++ b/logs/app.core.excel.converter.log @@ -7078,3 +7078,25 @@ 2025-12-12 12:32:20,668 - app.core.excel.converter - INFO - 从名称推断规格(简单容量): 娃哈哈纯净水1.5L@ -> 1.5L*1 2025-12-12 12:32:20,668 - app.core.excel.converter - INFO - 解析容量(L)规格: 1.5L*1 -> 1*1 2025-12-12 12:32:20,672 - app.core.excel.converter - INFO - 其他单位处理: 保持原样 数量: 48.0, 单价: 2.1, 单位: 份 +2026-03-30 10:20:20,137 - app.core.excel.converter - INFO - 成功加载条码映射配置,共62项 +2026-03-30 10:20:20,435 - app.core.excel.converter - INFO - 解析容量(L)规格: 1L*12 -> 1*12 +2026-03-30 10:20:20,447 - app.core.excel.converter - INFO - 解析容量(L)规格: 1L*12 -> 1*12 +2026-03-30 10:20:20,447 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:20:20,448 - app.core.excel.converter - INFO - 其他单位处理: 保持原样 数量: 2.0, 单价: 55.0, 单位: 件、 +2026-03-30 10:20:20,448 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:20:20,449 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:20:20,449 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:21:25,354 - app.core.excel.converter - INFO - 成功加载条码映射配置,共62项 +2026-03-30 10:21:25,655 - app.core.excel.converter - INFO - 解析容量(L)规格: 1L*12 -> 1*12 +2026-03-30 10:21:25,656 - app.core.excel.converter - INFO - 解析容量(L)规格: 1L*12 -> 1*12 +2026-03-30 10:21:25,657 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:21:25,658 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:21:25,659 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:21:25,660 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:21:52,468 - app.core.excel.converter - INFO - 成功加载条码映射配置,共62项 +2026-03-30 10:21:52,769 - app.core.excel.converter - INFO - 解析容量(L)规格: 1L*12 -> 1*12 +2026-03-30 10:21:52,769 - app.core.excel.converter - INFO - 解析容量(L)规格: 1L*12 -> 1*12 +2026-03-30 10:21:52,770 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:21:52,771 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:21:52,772 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 +2026-03-30 10:21:52,772 - app.core.excel.converter - INFO - 解析容量(ml)规格: 600ml*15 -> 1*15 diff --git a/logs/app.core.excel.handlers.unit_converter_handlers.log b/logs/app.core.excel.handlers.unit_converter_handlers.log index 0158fcb..ccf11a7 100644 --- a/logs/app.core.excel.handlers.unit_converter_handlers.log +++ b/logs/app.core.excel.handlers.unit_converter_handlers.log @@ -4454,3 +4454,20 @@ 2025-12-12 12:30:07,771 - app.core.excel.handlers.unit_converter_handlers - INFO - 提/盒单位(二级规格)处理: 保持原样 数量: 10.0, 单价: 1.43, 单位: 提 2025-12-12 12:30:07,779 - app.core.excel.handlers.unit_converter_handlers - INFO - 提/盒单位(二级规格)处理: 保持原样 数量: 6.0, 单价: 2.09, 单位: 提 2025-12-12 12:32:20,664 - app.core.excel.handlers.unit_converter_handlers - INFO - 提/盒单位(二级规格)处理: 保持原样 数量: 30.0, 单价: 0.66, 单位: 盒 +2026-03-30 10:20:20,435 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 12.0, 单价: 62.0 -> 5.166666666666667, 单位: 件 -> 瓶 +2026-03-30 10:20:20,447 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 12.0, 单价: 62.0 -> 5.166666666666667, 单位: 件 -> 瓶 +2026-03-30 10:20:20,448 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 15.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:20:20,449 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 15.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:20:20,450 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 15.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:21:25,656 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 12.0, 单价: 62.0 -> 5.166666666666667, 单位: 件 -> 瓶 +2026-03-30 10:21:25,656 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 12.0, 单价: 62.0 -> 5.166666666666667, 单位: 件 -> 瓶 +2026-03-30 10:21:25,657 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 2.0 -> 30.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:21:25,658 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 15.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:21:25,659 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 15.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:21:25,660 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 15.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:21:52,769 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 12.0, 单价: 62.0 -> 5.166666666666667, 单位: 件 -> 瓶 +2026-03-30 10:21:52,770 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 12.0, 单价: 62.0 -> 5.166666666666667, 单位: 件 -> 瓶 +2026-03-30 10:21:52,770 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 2.0 -> 30.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:21:52,771 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 15.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:21:52,772 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 15.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 +2026-03-30 10:21:52,772 - app.core.excel.handlers.unit_converter_handlers - INFO - 件单位处理: 数量: 1.0 -> 15.0, 单价: 55.0 -> 3.6666666666666665, 单位: 件 -> 瓶 diff --git a/logs/app.core.excel.merger.log b/logs/app.core.excel.merger.log index 3f73b0c..85dec3f 100644 --- a/logs/app.core.excel.merger.log +++ b/logs/app.core.excel.merger.log @@ -255,3 +255,9 @@ 2025-12-12 12:30:07,700 - app.core.excel.merger - INFO - 初始化PurchaseOrderMerger完成,模板文件: E:\2025Code\python\orc-order-v2\templates\银豹-采购单模板.xls 2025-12-12 12:32:20,579 - app.core.excel.merger - INFO - 使用输出目录: E:\2025Code\python\orc-order-v2\data\output 2025-12-12 12:32:20,579 - app.core.excel.merger - INFO - 初始化PurchaseOrderMerger完成,模板文件: E:\2025Code\python\orc-order-v2\templates\银豹-采购单模板.xls +2026-03-30 10:20:20,144 - app.core.excel.merger - INFO - 使用输出目录: E:\2025Code\python\orc-order-v2\data\output +2026-03-30 10:20:20,145 - app.core.excel.merger - INFO - 初始化PurchaseOrderMerger完成,模板文件: E:\2025Code\python\orc-order-v2\templates\银豹-采购单模板.xls +2026-03-30 10:21:25,355 - app.core.excel.merger - INFO - 使用输出目录: E:\2025Code\python\orc-order-v2\data\output +2026-03-30 10:21:25,356 - app.core.excel.merger - INFO - 初始化PurchaseOrderMerger完成,模板文件: E:\2025Code\python\orc-order-v2\templates\银豹-采购单模板.xls +2026-03-30 10:21:52,469 - app.core.excel.merger - INFO - 使用输出目录: E:\2025Code\python\orc-order-v2\data\output +2026-03-30 10:21:52,470 - app.core.excel.merger - INFO - 初始化PurchaseOrderMerger完成,模板文件: E:\2025Code\python\orc-order-v2\templates\银豹-采购单模板.xls diff --git a/logs/app.core.excel.processor.log b/logs/app.core.excel.processor.log index 4e5dcdb..10038ca 100644 --- a/logs/app.core.excel.processor.log +++ b/logs/app.core.excel.processor.log @@ -31147,3 +31147,148 @@ 2025-12-12 12:32:20,703 - app.core.excel.processor - INFO - 条码 6902083881412 处理结果:正常商品数量48.0,单价2.1,赠品数量0 2025-12-12 12:32:20,707 - app.core.excel.processor - INFO - 采购单已保存到: data/result\采购单_蓉城易购-订单1765513867817.xls 2025-12-12 12:32:20,707 - app.core.excel.processor - INFO - 采购单已保存到: data/result\采购单_蓉城易购-订单1765513867817.xls +2026-03-30 10:20:20,124 - app.core.excel.processor - INFO - 使用输出目录: E:\2025Code\python\orc-order-v2\data\output +2026-03-30 10:20:20,136 - app.core.excel.processor - INFO - 使用临时目录: E:\2025Code\python\orc-order-v2\data\temp +2026-03-30 10:20:20,144 - app.core.excel.processor - INFO - 初始化ExcelProcessor完成,模板文件: templates/银豹-采购单模板.xls +2026-03-30 10:20:20,146 - app.core.excel.processor - INFO - 开始处理Excel文件: e:\2025Code\python\orc-order-v2\data\output\495a630b-87cf-4245-834e-2705a3dcd12f.xlsx +2026-03-30 10:20:20,415 - app.core.excel.processor - INFO - 成功读取Excel文件: e:\2025Code\python\orc-order-v2\data\output\495a630b-87cf-4245-834e-2705a3dcd12f.xlsx, 共 9 行 +2026-03-30 10:20:20,417 - app.core.excel.processor - INFO - 找到可能的表头行: 第1行,评分: 65 +2026-03-30 10:20:20,417 - app.core.excel.processor - INFO - 识别到表头在第 1 行 +2026-03-30 10:20:20,431 - app.core.excel.processor - INFO - 使用表头行重新读取数据,共 8 行有效数据 +2026-03-30 10:20:20,431 - app.core.excel.processor - INFO - 找到精确匹配的条码列: 商品条码 +2026-03-30 10:20:20,431 - app.core.excel.processor - INFO - 使用条码列: 商品条码 +2026-03-30 10:20:20,431 - app.core.excel.processor - INFO - 找到name列: 商品名称 +2026-03-30 10:20:20,432 - app.core.excel.processor - INFO - 找到specification列: 规格 +2026-03-30 10:20:20,432 - app.core.excel.processor - INFO - 找到quantity列: 数量 +2026-03-30 10:20:20,432 - app.core.excel.processor - INFO - 找到unit列: 单位 +2026-03-30 10:20:20,432 - app.core.excel.processor - INFO - 找到price列: 单价 +2026-03-30 10:20:20,432 - app.core.excel.processor - INFO - 找到amount列: 金额 +2026-03-30 10:20:20,433 - app.core.excel.processor - INFO - 检测到列映射: {'barcode': '商品条码', 'name': '商品名称', 'specification': '规格', 'quantity': '数量', 'unit': '单位', 'price': '单价', 'amount': '金额'} +2026-03-30 10:20:20,434 - app.core.excel.processor - INFO - 解析规格: 1L*12 -> 包装数量=12 +2026-03-30 10:20:20,446 - app.core.excel.processor - INFO - 解析规格: 1L*12 -> 包装数量=12 +2026-03-30 10:20:20,447 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:20:20,448 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:20:20,449 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:20:20,449 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:20:20,451 - app.core.excel.processor - INFO - 提取到 7 个商品信息 +2026-03-30 10:20:20,457 - app.core.excel.processor - INFO - 开始处理7 个产品信息 +2026-03-30 10:20:20,457 - app.core.excel.processor - INFO - 处理商品: 条码=6902538006261, 数量=12.0, 单价=5.166666666666667, 是否赠品=False +2026-03-30 10:20:20,457 - app.core.excel.processor - INFO - 发现正常商品:条码6902538006261, 数量=12.0, 单价=5.166666666666667 +2026-03-30 10:20:20,457 - app.core.excel.processor - INFO - 处理商品: 条码=6902538006278, 数量=12.0, 单价=5.166666666666667, 是否赠品=False +2026-03-30 10:20:20,458 - app.core.excel.processor - INFO - 发现正常商品:条码6902538006278, 数量=12.0, 单价=5.166666666666667 +2026-03-30 10:20:20,458 - app.core.excel.processor - INFO - 处理商品: 条码=6902538004045, 数量=2.0, 单价=55.0, 是否赠品=False +2026-03-30 10:20:20,458 - app.core.excel.processor - INFO - 发现正常商品:条码6902538004045, 数量=2.0, 单价=55.0 +2026-03-30 10:20:20,458 - app.core.excel.processor - INFO - 处理商品: 条码=6902538005141, 数量=15.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:20:20,458 - app.core.excel.processor - INFO - 发现正常商品:条码6902538005141, 数量=15.0, 单价=3.6666666666666665 +2026-03-30 10:20:20,459 - app.core.excel.processor - INFO - 处理商品: 条码=6902538007169, 数量=15.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:20:20,459 - app.core.excel.processor - INFO - 发现正常商品:条码6902538007169, 数量=15.0, 单价=3.6666666666666665 +2026-03-30 10:20:20,459 - app.core.excel.processor - INFO - 处理商品: 条码=6902538008401, 数量=15.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:20:20,459 - app.core.excel.processor - INFO - 发现正常商品:条码6902538008401, 数量=15.0, 单价=3.6666666666666665 +2026-03-30 10:20:20,459 - app.core.excel.processor - INFO - 处理商品: 条码=6902538004045, 数量=3.0, 单价=4.0, 是否赠品=False +2026-03-30 10:20:20,459 - app.core.excel.processor - INFO - 累加正常商品数量:条码6902538004045, 新增=3.0, 累计=5.0 +2026-03-30 10:20:20,459 - app.core.excel.processor - INFO - 调整单价(取平均值):条码6902538004045, 原价=29.5, 新价=4.0, 平均=29.5 +2026-03-30 10:20:20,460 - app.core.excel.processor - INFO - 分组后共6 个不同条码的商品 +2026-03-30 10:20:20,460 - app.core.excel.processor - INFO - 条码 6902538006261 处理结果:正常商品数量12.0,单价5.166666666666667,赠品数量0 +2026-03-30 10:20:20,460 - app.core.excel.processor - INFO - 条码 6902538006278 处理结果:正常商品数量12.0,单价5.166666666666667,赠品数量0 +2026-03-30 10:20:20,460 - app.core.excel.processor - INFO - 条码 6902538004045 处理结果:正常商品数量5.0,单价29.5,赠品数量0 +2026-03-30 10:20:20,460 - app.core.excel.processor - INFO - 条码 6902538005141 处理结果:正常商品数量15.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:20:20,460 - app.core.excel.processor - INFO - 条码 6902538007169 处理结果:正常商品数量15.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:20:20,460 - app.core.excel.processor - INFO - 条码 6902538008401 处理结果:正常商品数量15.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:20:20,463 - app.core.excel.processor - INFO - 采购单已保存到: data/result\采购单_495a630b-87cf-4245-834e-2705a3dcd12f.xls +2026-03-30 10:20:20,483 - app.core.excel.processor - INFO - 采购单已保存到: data/result\采购单_495a630b-87cf-4245-834e-2705a3dcd12f.xls +2026-03-30 10:21:25,353 - app.core.excel.processor - INFO - 使用输出目录: E:\2025Code\python\orc-order-v2\data\output +2026-03-30 10:21:25,353 - app.core.excel.processor - INFO - 使用临时目录: E:\2025Code\python\orc-order-v2\data\temp +2026-03-30 10:21:25,354 - app.core.excel.processor - INFO - 初始化ExcelProcessor完成,模板文件: templates/银豹-采购单模板.xls +2026-03-30 10:21:25,356 - app.core.excel.processor - INFO - 开始处理Excel文件: e:\2025Code\python\orc-order-v2\data\output\495a630b-87cf-4245-834e-2705a3dcd12f.xlsx +2026-03-30 10:21:25,632 - app.core.excel.processor - INFO - 成功读取Excel文件: e:\2025Code\python\orc-order-v2\data\output\495a630b-87cf-4245-834e-2705a3dcd12f.xlsx, 共 9 行 +2026-03-30 10:21:25,634 - app.core.excel.processor - INFO - 找到可能的表头行: 第1行,评分: 65 +2026-03-30 10:21:25,634 - app.core.excel.processor - INFO - 识别到表头在第 1 行 +2026-03-30 10:21:25,651 - app.core.excel.processor - INFO - 使用表头行重新读取数据,共 8 行有效数据 +2026-03-30 10:21:25,651 - app.core.excel.processor - INFO - 找到精确匹配的条码列: 商品条码 +2026-03-30 10:21:25,651 - app.core.excel.processor - INFO - 使用条码列: 商品条码 +2026-03-30 10:21:25,652 - app.core.excel.processor - INFO - 找到name列: 商品名称 +2026-03-30 10:21:25,652 - app.core.excel.processor - INFO - 找到specification列: 规格 +2026-03-30 10:21:25,652 - app.core.excel.processor - INFO - 找到quantity列: 数量 +2026-03-30 10:21:25,652 - app.core.excel.processor - INFO - 找到unit列: 单位 +2026-03-30 10:21:25,652 - app.core.excel.processor - INFO - 找到price列: 单价 +2026-03-30 10:21:25,652 - app.core.excel.processor - INFO - 找到amount列: 金额 +2026-03-30 10:21:25,652 - app.core.excel.processor - INFO - 检测到列映射: {'barcode': '商品条码', 'name': '商品名称', 'specification': '规格', 'quantity': '数量', 'unit': '单位', 'price': '单价', 'amount': '金额'} +2026-03-30 10:21:25,654 - app.core.excel.processor - INFO - 解析规格: 1L*12 -> 包装数量=12 +2026-03-30 10:21:25,656 - app.core.excel.processor - INFO - 解析规格: 1L*12 -> 包装数量=12 +2026-03-30 10:21:25,657 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:21:25,658 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:21:25,658 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:21:25,659 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:21:25,662 - app.core.excel.processor - INFO - 提取到 7 个商品信息 +2026-03-30 10:21:25,667 - app.core.excel.processor - INFO - 开始处理7 个产品信息 +2026-03-30 10:21:25,667 - app.core.excel.processor - INFO - 处理商品: 条码=6902538006261, 数量=12.0, 单价=5.166666666666667, 是否赠品=False +2026-03-30 10:21:25,667 - app.core.excel.processor - INFO - 发现正常商品:条码6902538006261, 数量=12.0, 单价=5.166666666666667 +2026-03-30 10:21:25,667 - app.core.excel.processor - INFO - 处理商品: 条码=6902538006278, 数量=12.0, 单价=5.166666666666667, 是否赠品=False +2026-03-30 10:21:25,667 - app.core.excel.processor - INFO - 发现正常商品:条码6902538006278, 数量=12.0, 单价=5.166666666666667 +2026-03-30 10:21:25,668 - app.core.excel.processor - INFO - 处理商品: 条码=6902538004045, 数量=30.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:21:25,668 - app.core.excel.processor - INFO - 发现正常商品:条码6902538004045, 数量=30.0, 单价=3.6666666666666665 +2026-03-30 10:21:25,668 - app.core.excel.processor - INFO - 处理商品: 条码=6902538005141, 数量=15.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:21:25,668 - app.core.excel.processor - INFO - 发现正常商品:条码6902538005141, 数量=15.0, 单价=3.6666666666666665 +2026-03-30 10:21:25,669 - app.core.excel.processor - INFO - 处理商品: 条码=6902538007169, 数量=15.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:21:25,669 - app.core.excel.processor - INFO - 发现正常商品:条码6902538007169, 数量=15.0, 单价=3.6666666666666665 +2026-03-30 10:21:25,669 - app.core.excel.processor - INFO - 处理商品: 条码=6902538008401, 数量=15.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:21:25,669 - app.core.excel.processor - INFO - 发现正常商品:条码6902538008401, 数量=15.0, 单价=3.6666666666666665 +2026-03-30 10:21:25,669 - app.core.excel.processor - INFO - 处理商品: 条码=6902538004045, 数量=3.0, 单价=4.0, 是否赠品=False +2026-03-30 10:21:25,670 - app.core.excel.processor - INFO - 累加正常商品数量:条码6902538004045, 新增=3.0, 累计=33.0 +2026-03-30 10:21:25,670 - app.core.excel.processor - INFO - 调整单价(取平均值):条码6902538004045, 原价=3.833333333333333, 新价=4.0, 平均=3.833333333333333 +2026-03-30 10:21:25,670 - app.core.excel.processor - INFO - 分组后共6 个不同条码的商品 +2026-03-30 10:21:25,670 - app.core.excel.processor - INFO - 条码 6902538006261 处理结果:正常商品数量12.0,单价5.166666666666667,赠品数量0 +2026-03-30 10:21:25,670 - app.core.excel.processor - INFO - 条码 6902538006278 处理结果:正常商品数量12.0,单价5.166666666666667,赠品数量0 +2026-03-30 10:21:25,670 - app.core.excel.processor - INFO - 条码 6902538004045 处理结果:正常商品数量33.0,单价3.833333333333333,赠品数量0 +2026-03-30 10:21:25,671 - app.core.excel.processor - INFO - 条码 6902538005141 处理结果:正常商品数量15.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:21:25,671 - app.core.excel.processor - INFO - 条码 6902538007169 处理结果:正常商品数量15.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:21:25,671 - app.core.excel.processor - INFO - 条码 6902538008401 处理结果:正常商品数量15.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:21:25,673 - app.core.excel.processor - INFO - 采购单已保存到: data/result\采购单_495a630b-87cf-4245-834e-2705a3dcd12f.xls +2026-03-30 10:21:25,675 - app.core.excel.processor - INFO - 采购单已保存到: data/result\采购单_495a630b-87cf-4245-834e-2705a3dcd12f.xls +2026-03-30 10:21:52,467 - app.core.excel.processor - INFO - 使用输出目录: E:\2025Code\python\orc-order-v2\data\output +2026-03-30 10:21:52,468 - app.core.excel.processor - INFO - 使用临时目录: E:\2025Code\python\orc-order-v2\data\temp +2026-03-30 10:21:52,469 - app.core.excel.processor - INFO - 初始化ExcelProcessor完成,模板文件: templates/银豹-采购单模板.xls +2026-03-30 10:21:52,470 - app.core.excel.processor - INFO - 开始处理Excel文件: e:\2025Code\python\orc-order-v2\data\output\495a630b-87cf-4245-834e-2705a3dcd12f.xlsx +2026-03-30 10:21:52,749 - app.core.excel.processor - INFO - 成功读取Excel文件: e:\2025Code\python\orc-order-v2\data\output\495a630b-87cf-4245-834e-2705a3dcd12f.xlsx, 共 9 行 +2026-03-30 10:21:52,750 - app.core.excel.processor - INFO - 找到可能的表头行: 第1行,评分: 65 +2026-03-30 10:21:52,751 - app.core.excel.processor - INFO - 识别到表头在第 1 行 +2026-03-30 10:21:52,764 - app.core.excel.processor - INFO - 使用表头行重新读取数据,共 8 行有效数据 +2026-03-30 10:21:52,765 - app.core.excel.processor - INFO - 找到精确匹配的条码列: 商品条码 +2026-03-30 10:21:52,765 - app.core.excel.processor - INFO - 使用条码列: 商品条码 +2026-03-30 10:21:52,765 - app.core.excel.processor - INFO - 找到name列: 商品名称 +2026-03-30 10:21:52,765 - app.core.excel.processor - INFO - 找到specification列: 规格 +2026-03-30 10:21:52,765 - app.core.excel.processor - INFO - 找到quantity列: 数量 +2026-03-30 10:21:52,765 - app.core.excel.processor - INFO - 找到unit列: 单位 +2026-03-30 10:21:52,766 - app.core.excel.processor - INFO - 找到price列: 单价 +2026-03-30 10:21:52,766 - app.core.excel.processor - INFO - 找到amount列: 金额 +2026-03-30 10:21:52,766 - app.core.excel.processor - INFO - 检测到列映射: {'barcode': '商品条码', 'name': '商品名称', 'specification': '规格', 'quantity': '数量', 'unit': '单位', 'price': '单价', 'amount': '金额'} +2026-03-30 10:21:52,768 - app.core.excel.processor - INFO - 解析规格: 1L*12 -> 包装数量=12 +2026-03-30 10:21:52,769 - app.core.excel.processor - INFO - 解析规格: 1L*12 -> 包装数量=12 +2026-03-30 10:21:52,770 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:21:52,771 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:21:52,771 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:21:52,772 - app.core.excel.processor - INFO - 解析规格: 600ml*15 -> 包装数量=15 +2026-03-30 10:21:52,773 - app.core.excel.processor - INFO - 过滤非采购行: 6902538004045.0 - , 原因: 备注包含 '换货减钱' +2026-03-30 10:21:52,773 - app.core.excel.processor - INFO - 提取到 6 个商品信息 +2026-03-30 10:21:52,778 - app.core.excel.processor - INFO - 开始处理6 个产品信息 +2026-03-30 10:21:52,778 - app.core.excel.processor - INFO - 处理商品: 条码=6902538006261, 数量=12.0, 单价=5.166666666666667, 是否赠品=False +2026-03-30 10:21:52,778 - app.core.excel.processor - INFO - 发现正常商品:条码6902538006261, 数量=12.0, 单价=5.166666666666667 +2026-03-30 10:21:52,778 - app.core.excel.processor - INFO - 处理商品: 条码=6902538006278, 数量=12.0, 单价=5.166666666666667, 是否赠品=False +2026-03-30 10:21:52,779 - app.core.excel.processor - INFO - 发现正常商品:条码6902538006278, 数量=12.0, 单价=5.166666666666667 +2026-03-30 10:21:52,779 - app.core.excel.processor - INFO - 处理商品: 条码=6902538004045, 数量=30.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:21:52,779 - app.core.excel.processor - INFO - 发现正常商品:条码6902538004045, 数量=30.0, 单价=3.6666666666666665 +2026-03-30 10:21:52,779 - app.core.excel.processor - INFO - 处理商品: 条码=6902538005141, 数量=15.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:21:52,779 - app.core.excel.processor - INFO - 发现正常商品:条码6902538005141, 数量=15.0, 单价=3.6666666666666665 +2026-03-30 10:21:52,779 - app.core.excel.processor - INFO - 处理商品: 条码=6902538007169, 数量=15.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:21:52,779 - app.core.excel.processor - INFO - 发现正常商品:条码6902538007169, 数量=15.0, 单价=3.6666666666666665 +2026-03-30 10:21:52,780 - app.core.excel.processor - INFO - 处理商品: 条码=6902538008401, 数量=15.0, 单价=3.6666666666666665, 是否赠品=False +2026-03-30 10:21:52,780 - app.core.excel.processor - INFO - 发现正常商品:条码6902538008401, 数量=15.0, 单价=3.6666666666666665 +2026-03-30 10:21:52,780 - app.core.excel.processor - INFO - 分组后共6 个不同条码的商品 +2026-03-30 10:21:52,780 - app.core.excel.processor - INFO - 条码 6902538006261 处理结果:正常商品数量12.0,单价5.166666666666667,赠品数量0 +2026-03-30 10:21:52,780 - app.core.excel.processor - INFO - 条码 6902538006278 处理结果:正常商品数量12.0,单价5.166666666666667,赠品数量0 +2026-03-30 10:21:52,780 - app.core.excel.processor - INFO - 条码 6902538004045 处理结果:正常商品数量30.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:21:52,780 - app.core.excel.processor - INFO - 条码 6902538005141 处理结果:正常商品数量15.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:21:52,780 - app.core.excel.processor - INFO - 条码 6902538007169 处理结果:正常商品数量15.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:21:52,781 - app.core.excel.processor - INFO - 条码 6902538008401 处理结果:正常商品数量15.0,单价3.6666666666666665,赠品数量0 +2026-03-30 10:21:52,783 - app.core.excel.processor - INFO - 采购单已保存到: data/result\采购单_495a630b-87cf-4245-834e-2705a3dcd12f.xls +2026-03-30 10:21:52,790 - app.core.excel.processor - INFO - 采购单已保存到: data/result\采购单_495a630b-87cf-4245-834e-2705a3dcd12f.xls diff --git a/logs/app.core.excel.validators.log b/logs/app.core.excel.validators.log index a63271c..73c8e24 100644 --- a/logs/app.core.excel.validators.log +++ b/logs/app.core.excel.validators.log @@ -5375,3 +5375,23 @@ 2025-12-12 12:32:20,668 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 2025-12-12 12:32:20,668 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 2025-12-12 12:32:20,668 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:20:20,434 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:20:20,446 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:20:20,447 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:20:20,448 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:20:20,449 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:20:20,449 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:20:20,451 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:25,655 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:25,656 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:25,657 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:25,658 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:25,659 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:25,659 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:25,661 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:52,768 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:52,769 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:52,770 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:52,771 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:52,771 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 +2026-03-30 10:21:52,772 - app.core.excel.validators - INFO - 修正条码长度: 从14位截断到13位 diff --git a/logs/app.services.order_service.log b/logs/app.services.order_service.log index f7bf6bd..c03325b 100644 --- a/logs/app.services.order_service.log +++ b/logs/app.services.order_service.log @@ -688,3 +688,12 @@ 2025-12-12 12:32:20,576 - app.services.order_service - INFO - 初始化OrderService 2025-12-12 12:32:20,579 - app.services.order_service - INFO - OrderService初始化完成 2025-12-12 12:32:20,579 - app.services.order_service - INFO - OrderService开始处理指定Excel文件: E:\2025Code\python\orc-order-v2\data\output\蓉城易购-订单1765513867817.xlsx +2026-03-30 10:20:20,106 - app.services.order_service - INFO - 初始化OrderService +2026-03-30 10:20:20,145 - app.services.order_service - INFO - OrderService初始化完成 +2026-03-30 10:20:20,145 - app.services.order_service - INFO - OrderService开始处理指定Excel文件: e:\2025Code\python\orc-order-v2\data\output\495a630b-87cf-4245-834e-2705a3dcd12f.xlsx +2026-03-30 10:21:25,351 - app.services.order_service - INFO - 初始化OrderService +2026-03-30 10:21:25,356 - app.services.order_service - INFO - OrderService初始化完成 +2026-03-30 10:21:25,356 - app.services.order_service - INFO - OrderService开始处理指定Excel文件: e:\2025Code\python\orc-order-v2\data\output\495a630b-87cf-4245-834e-2705a3dcd12f.xlsx +2026-03-30 10:21:52,466 - app.services.order_service - INFO - 初始化OrderService +2026-03-30 10:21:52,470 - app.services.order_service - INFO - OrderService初始化完成 +2026-03-30 10:21:52,470 - app.services.order_service - INFO - OrderService开始处理指定Excel文件: e:\2025Code\python\orc-order-v2\data\output\495a630b-87cf-4245-834e-2705a3dcd12f.xlsx