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

+7 -7
View File
@@ -35,17 +35,17 @@ def terminal_configuration_test_run(app):
"""预置一个已终态的配置测试运行 + 批次,供 configuration-test 三端点走 OK envelope 路径。"""
from app import db
from app.models import (
ShippingInventoryConfigurationTestRun,
ShippingInventorySource,
ShippingInventoryValidationBatch,
FreightRpaOnhandConfigurationTestRun,
FreightRpaSource,
FreightRpaOnhandValidationBatch,
)
source = ShippingInventorySource.query.filter_by(source_code='DSV360_AWSDU').one()
batch = ShippingInventoryValidationBatch(batch_no='CONFIG-BATCH-ENV-TEST', status='running', total_count=1)
source = FreightRpaSource.query.filter_by(source_code='DSV360_AWSDU').one()
batch = FreightRpaOnhandValidationBatch(batch_no='CONFIG-BATCH-ENV-TEST', status='running', total_count=1)
db.session.add(batch)
db.session.flush()
run = ShippingInventoryConfigurationTestRun(
run_no='CONFIG-ENV-TEST-RUN', validation_batch_id=batch.id, inventory_source_id=source.id,
run = FreightRpaOnhandConfigurationTestRun(
run_no='CONFIG-ENV-TEST-RUN', validation_batch_id=batch.id, source_id=source.id,
source_config_version=source.config_version,
rpa_profile_config_version=source.rpa_profile.config_version,
status='completed', stage='current_profile_verified', result_json={},
@@ -664,21 +664,21 @@ def _seed_parse_failed_inbound_file(source_code: str):
from uuid import uuid4
from app.models import (
ShippingInventorySource,
ShippingReceiptReportFile,
ShippingReceiptRpaUnitRun,
FreightRpaSource,
FreightRpaInboundReportFile,
FreightRpaInboundUnitRun,
)
source = ShippingInventorySource.query.filter_by(source_code=source_code).one()
unit = ShippingReceiptRpaUnitRun(
inventory_source_id=source.id, source_code=source.source_code,
source = FreightRpaSource.query.filter_by(source_code=source_code).one()
unit = FreightRpaInboundUnitRun(
source_id=source.id, source_code=source.source_code,
connector_type=source.connector_type, warehouse_id=source.fixed_warehouse_id,
callback_id=f"receipt-retry-{uuid4().hex[:12]}", status="success",
config_snapshot_json={},
)
db.session.add(unit)
db.session.flush()
report = ShippingReceiptReportFile(
report = FreightRpaInboundReportFile(
unit_run_id=unit.id, storage_provider="minio", storage_bucket="test",
storage_key=f"shipping/receipt/retry-{unit.id}.xlsx",
original_filename="retry.xlsx", file_size=16,
@@ -699,14 +699,14 @@ def test_retry_rpa_parse_failed_reparses_existing_file(app, client, admin_header
def fake_sync(*, source_code, business_date, now):
# 断言意图:重解析路径 sync 恰好 1 次;成功链路清除解析失败标记使投影回
# ready(请求会话内重查后清除并 commit,保证端点再解析可见)。
from app.models import ShippingReceiptReportFile
from app.models import FreightRpaInboundReportFile
from app.services.in_transit_transfer.source_file_status import clear_inbound_parse_failure
called["sync"] += 1
file = (
ShippingReceiptReportFile.query
.join(ShippingReceiptReportFile.unit_run)
.filter(ShippingReceiptReportFile.unit_run.has(source_code=source_code))
FreightRpaInboundReportFile.query
.join(FreightRpaInboundReportFile.unit_run)
.filter(FreightRpaInboundReportFile.unit_run.has(source_code=source_code))
.first()
)
if file is not None: