feat(shipping-notice): 优化货运订单履约流程与用户体验

- 优化聊天附件列表为横向可滚动布局并新增配套测试用例
- 移除自动填充默认用户消息逻辑,空备注时不再伪造默认正文
- 修复流程Gate动作展示逻辑,隐藏历史遗留操作与自动阶段无效按钮
- 完善库存匹配重试与订单快照冻结校验流程
- 优化进度展示优先级,优先显示人工待处理状态
- 移除Excel导出自动推导金额逻辑,强制使用Schema配置字段
- 新增货代通用报表RPA详细设计文档
- 更新相关测试用例与断言逻辑
This commit is contained in:
hugo committed 2026-08-13 00:17:01 +08:00
1 parent dc282f3b1d
commit 11cef575b4
51 files changed
+2197 -112

No files matched your search

@@ -197,6 +197,49 @@ def test_inventory_matching_recovery_keeps_review_entry_when_primary_is_technica
]
def test_formal_inventory_matching_uses_only_executable_retries(app, monkeypatch):
"""正式 OT 库存匹配阻断不得投影无写操作的复核入口。"""
from types import SimpleNamespace
from app.services.shipping_notice import process_gate_projection as projection
execution = SimpleNamespace(
id=1, execution_no='EXE-INV-OT-1', status='blocked',
current_gate_code='inventory_matching', primary_next_action_code='open_inventory_match_review',
responsible_party='worker', lock_version=1, review_case_id=None, task_id=99,
)
monkeypatch.setattr(
projection,
'serialize_process_execution',
lambda _execution, include_diagnostics=False: {
'execution_no': 'EXE-INV-OT-1', 'status': 'blocked',
'primary_next_action_code': 'open_inventory_match_review',
'responsible_party': 'worker',
'current_gate': {
'gate_code': 'inventory_matching',
'status': 'blocked_manual',
'blocking_reason_code': 'inventory_match_incomplete',
'next_action_code': 'open_inventory_match_review',
},
'recovery_targets': [
{'action_code': 'open_inventory_match_review', 'target_gate': 'inventory_matching'},
{'action_code': 'retry_inventory_from_preparation', 'target_gate': 'inventory_preparation'},
],
'gates': [], 'active_recovery_plans': [],
},
)
summary = projection.project_user_gate_summary(execution)
assert summary['next_action_code'] == 'retry_inventory_matching'
assert summary['allowed_actions'] == [
'retry_inventory_matching',
'retry_inventory_from_preparation',
]
assert summary['recovery_targets'] == [
{'action_code': 'retry_inventory_from_preparation', 'target_gate': 'inventory_preparation'},
]
def test_user_gate_summary_exposes_sanitized_failure_detail_for_any_gate(app, monkeypatch):
"""所有 Gate 均应把当前 Attempt 的脱敏失败详情投影给用户,而非只显示泛化原因。"""
from types import SimpleNamespace