feat(freight-rpa): 库存/收料改名在手/入站,报表归属RPA,类名统一FreightRpa

把 shipping 侧 inventory/receipt 词根迁到 onhand/inbound,29 张表与
枚举/权限/前端/i18n 同步改名;在手与入站报表配置及文件改由 freight_rpa
持有,发货与调拨仅按 source_code 消费;ORM 类加 FreightRpa 前缀,
上传动作改为 freight_rpa_upload。含类名与上传动作改名规格文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-10-19 10:46:06 +08:00
1 parent ffc0d4a430
commit 39fe3c05f2
453 files changed
+17945 -8646

No files matched your search

@@ -21,7 +21,7 @@ from app.services.schedule.job_params import (
def _enabled_source_code() -> str:
"""读取测试数据库的首个启用库存源,避免测试依赖已废弃 YAML 的固定编码。"""
from app.services.shipping_notice.inventory_source_repository import list_database_inventory_sources
from app.services.shipping_notice.onhand_source_repository import list_database_inventory_sources
sources = list_database_inventory_sources()
assert sources, 'expected at least one enabled inventory source'
@@ -65,7 +65,7 @@ def test_platform_task_definitions_returns_params_schema(client, admin_jwt_heade
assert rpa['category'] == 'shipping'
schema_keys = {f['key']: f for f in rpa['params_schema']}
assert schema_keys['source_codes']['type'] == 'multi_select'
assert schema_keys['source_codes']['options_source'] == 'shipping_inventory_sources'
assert schema_keys['source_codes']['options_source'] == 'freight_rpa_sources'
assert rpa['defaults'] == {'source_codes': []}
# FAQ 热点聚合:select 应用字段
faq = by_type['faq-aggregate-hot']
@@ -79,7 +79,7 @@ def test_platform_task_definitions_returns_params_schema(client, admin_jwt_heade
def test_platform_task_options_shipping_sources(client, admin_jwt_headers, app):
"""options 接口应返回库存源统一 label/value 结构。"""
res = client.get(
'/api/admin/platform-tasks/options?source=shipping_inventory_sources',
'/api/admin/platform-tasks/options?source=freight_rpa_sources',
headers=admin_jwt_headers,
)
assert res.status_code == 200
@@ -365,7 +365,7 @@ def test_faq_job_prefers_job_params_over_dify_agent_id(app):
def test_shipping_rpa_filter_prefers_job_params(app):
"""货代 RPA 应优先按 job_params.source_codes 筛选库存源。"""
from app.services.schedule.freight_onhand_rpa_job import _filter_sources
from app.services.schedule.freight_rpa_onhand_job import _filter_sources
with app.app_context():
source_code = _enabled_source_code()