feat(shipping-notice): 完善库存源聚合与订单模板匹配

- 优化订单模板匹配、重放及库存配置测试
- 新增库存 RPA 源合并设计与相关测试
- 更新库存管理页面及四语言文案
- 同步需求、技术文档与测试配置
This commit is contained in:
hugo committed 2026-09-10 00:42:30 +08:00
1 parent 2bb7822247
commit 6052c46d88
14 files changed
+1056 -86

No files matched your search

@@ -145,6 +145,29 @@ def test_configuration_test_callback_isolated_from_production_inventory(app, tmp
assert ShippingInventoryConfigurationTestRun.query.count() == 1
def test_configuration_test_callback_maps_windows_drop_path_to_shared_mount(app, tmp_path):
"""Worker 回传 Windows drop 路径时,必须映射到 Linux 共享目录再分析,不能报「文件不存在」。"""
drop_dir = tmp_path / 'inventory_drop'
drop_dir.mkdir()
app.config['SHIPPING_NOTICE_STORAGE_ROOT'] = str(tmp_path / 'shipping')
app.config['SHIPPING_NOTICE_RPA_CREDENTIAL_KEY'] = Fernet.generate_key().decode('ascii')
app.config['SHIPPING_NOTICE_RPA_SHARED_INVENTORY_DROP_DIR'] = str(drop_dir)
with app.app_context(), patch(
'app.services.shipping_notice.rpa.write_inventory_export_batch_trigger', return_value='trigger.json',
):
source = _source()
started = inventory_configuration_test.start_test_export(source['id'], actor_id=None)
result_file = drop_dir / f"inventory_{started['run_no']}_DSV360_BYAWSPRD01.xlsx"
_workbook(result_file)
windows_path = rf'C:\HxopsRpaTest\data\inventory_drop\{result_file.name}'
completed = inventory_configuration_test.report_test_export({
'run_no': started['run_no'], 'status': 'success', 'file_path': windows_path,
})
assert completed['status'] == 'completed'
assert completed.get('error_message') in (None, '')
assert not ShippingInventoryFile.query.count()
def test_empty_configuration_export_is_successful_but_marks_data_validation_pending(app, tmp_path):
"""已绑定发布方案的空库存结果是有效连接证据,不能被误写为 RPA 失败。"""
app.config['SHIPPING_NOTICE_RPA_CREDENTIAL_KEY'] = Fernet.generate_key().decode('ascii')