feat(shipping-freight-auto-upload): 新增货代发货Excel连接级自动上传全链路功能
为提升货代上传的自动化程度,减少人工操作,本提交实现完整的连接级自动上传功能,包含以下变更: - 新增数据库迁移与ShippingRpaProfile模型字段,存储连接级上传配置 - 完善RPA自动上传触发、回调与状态管理逻辑,支持三态结果与人工兜底 - 优化聊天界面任务卡片加载与按钮渲染,修复无文案幽灵按钮问题
This commit is contained in:
1 parent
06c18b3c7c
commit
434c04ed2d
30 files changed
+1574
-185
No files matched your search
@@ -378,6 +378,34 @@ def test_freight_notice_groups_split_same_po_by_business_no_and_owner(app):
|
||||
assert result['items'][1]['lines'][0]['part_number'] == 'PART-B'
|
||||
|
||||
|
||||
def test_freight_notice_groups_exposes_per_notice_upload_error(app):
|
||||
"""货代上传聚合必须逐单透出上传错误码/原因/需人工原因,供「按通知单展示状态」消费。"""
|
||||
with app.app_context():
|
||||
from app import db
|
||||
from app.models import ShippingNotice
|
||||
from app.services.shipping_notice import query_service
|
||||
|
||||
first = ShippingNotice(task_no='SN-GROUP-ERR-1', business_no='WYC26082401', source_type='manual', user_id=11)
|
||||
db.session.add(first); db.session.flush()
|
||||
first.upload_status = 'failed'
|
||||
first.upload_error_code = 'RPA_UPLOAD_FAILED'
|
||||
first.upload_error_message = '货代平台拒绝:凭证无效'
|
||||
db.session.commit()
|
||||
|
||||
original_header_reader = query_service.current_header_field_values_or_empty
|
||||
query_service.current_header_field_values_or_empty = lambda _task: {'customer_po_number': 'PO-ERR'}
|
||||
try:
|
||||
result = list_freight_notice_groups_for_task(first, user_id=11)
|
||||
finally:
|
||||
query_service.current_header_field_values_or_empty = original_header_reader
|
||||
|
||||
item = result['items'][0]
|
||||
assert item['business_no'] == 'WYC26082401'
|
||||
assert item['upload_status'] == 'failed'
|
||||
assert item['upload_error_code'] == 'RPA_UPLOAD_FAILED'
|
||||
assert item['upload_error_message'] == '货代平台拒绝:凭证无效'
|
||||
|
||||
|
||||
def test_freight_notice_groups_reads_frozen_snapshot_po_when_extraction_projection_is_unavailable(app):
|
||||
"""当前 Extraction 不可读时,货代上传聚合仍必须以冻结快照中的客户 PO 对齐同一发货批次。"""
|
||||
with app.app_context():
|
||||
|
||||
Reference in new issue
Block a user