feat(shipping-notice,receipt-report): 新增收料报表功能并优化发货通知流程
清理废弃的shipping xfa ocr automark相关代码和job配置 新增收料报表管理的前端页面、路由和侧边栏入口 新增后端收料报表配置接口、数据库模型和RPA脚本 优化发货通知流程的重试策略,将shipping相关job默认不自动重试 移除废弃的库存源确认相关逻辑,更新流程门禁规则 重构订单模板的值适配器模块,新增坐标OCR值适配器 清理前端shipping菜单和action的废弃选项 更新相关文档和测试用例,调整.gitignore忽略规则
This commit is contained in:
1 parent
260465b72d
commit
1b6483a4ea
466 files changed
+32115
-33796
No files matched your search
@@ -77,7 +77,7 @@ def test_projection_fact_read_failure_is_fail_closed():
|
||||
'available_actions': ['retry_inventory_preparation'],
|
||||
})
|
||||
assert payload['status'] == 'waiting_human'
|
||||
assert payload['retryable'] is False
|
||||
assert 'retryable' not in payload
|
||||
assert payload['primary_action'] is None
|
||||
assert payload['available_actions'] == []
|
||||
assert payload['blocking_reason']['code'] == 'projection_data_inconsistent'
|
||||
@@ -289,6 +289,29 @@ def test_derive_available_actions_failed_adds_retry():
|
||||
assert 'retry' in actions
|
||||
|
||||
|
||||
def test_retryable_projection_uses_technical_failure_reason_mapping():
|
||||
"""重试兜底原因必须生成可展示的技术失败 i18n 键,而不能抛 KeyError。"""
|
||||
payload = apply_user_projection_fields({
|
||||
'status': 'processing',
|
||||
'stage': 'inventory_preparation',
|
||||
'source_type': 'order_task',
|
||||
'current_gate': {
|
||||
'gate_code': 'inventory_preparation',
|
||||
'status': 'blocked_retryable',
|
||||
'next_action_code': 'retry_inventory_preparation',
|
||||
'blocking_reason_code': 'technical_failure_present',
|
||||
},
|
||||
'available_actions': ['retry'],
|
||||
})
|
||||
|
||||
assert payload['user_status'] == 'retryable'
|
||||
assert payload['blocking_reason'] == {
|
||||
'code': 'technical_failure_present',
|
||||
'i18n_key': 'workspace.shippingNotice.processGate.reasons.technical_failure_present',
|
||||
'details': {},
|
||||
}
|
||||
|
||||
|
||||
def test_inventory_snapshot_missing_projects_retryable_inventory_action():
|
||||
"""库存快照缺失属于可恢复技术阻断,用户态必须保留重试动作。"""
|
||||
payload = apply_user_projection_fields({
|
||||
@@ -309,11 +332,11 @@ def test_inventory_snapshot_missing_projects_retryable_inventory_action():
|
||||
})
|
||||
|
||||
assert payload['user_status'] == 'retryable'
|
||||
assert payload['retryable'] is True
|
||||
assert 'retryable' not in payload
|
||||
# 主动作必须保留 Gate 原始码,前端才能提交到正确的库存准备执行器。
|
||||
assert payload['primary_action'] == {
|
||||
'code': 'retry_inventory_preparation',
|
||||
'i18n_key': 'workspace.shippingNotice.processGate.actionCodes.retry_inventory_preparation',
|
||||
'i18n_key': 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryPreparation',
|
||||
'parameters': {},
|
||||
}
|
||||
|
||||
@@ -338,6 +361,28 @@ def test_formal_blocked_gate_overrides_stale_preparation_running_state():
|
||||
assert payload['primary_action']['code'] == 'retry_inventory_preparation'
|
||||
|
||||
|
||||
def test_retryable_projection_exposes_technical_failure_reason_without_retry_decision():
|
||||
"""AutoProgress 超时未生成 Retry Decision 时,工作项读取仍必须返回可翻译原因。"""
|
||||
payload = apply_user_projection_fields({
|
||||
'status': 'blocked',
|
||||
'stage': 'inventory_preparation',
|
||||
'source_type': 'order_task',
|
||||
'current_gate': {
|
||||
'gate_code': 'inventory_preparation',
|
||||
'status': 'blocked_retryable',
|
||||
'blocking_reason_code': 'technical_failure_present',
|
||||
},
|
||||
'available_actions': [],
|
||||
})
|
||||
|
||||
assert payload['user_status'] == 'retryable'
|
||||
assert payload['blocking_reason'] == {
|
||||
'code': 'technical_failure_present',
|
||||
'i18n_key': 'workspace.shippingNotice.processGate.reasons.technical_failure_present',
|
||||
'details': {},
|
||||
}
|
||||
|
||||
|
||||
def test_formal_inventory_matching_retry_projects_business_i18n_key():
|
||||
"""正式 OT 的库存重试不得让页面回退展示内部 action code。"""
|
||||
payload = apply_user_projection_fields({
|
||||
@@ -356,7 +401,7 @@ def test_formal_inventory_matching_retry_projects_business_i18n_key():
|
||||
|
||||
assert payload['primary_action'] == {
|
||||
'code': 'retry_inventory_matching',
|
||||
'i18n_key': 'workspace.shippingNotice.processGate.actionCodes.retry_inventory_matching',
|
||||
'i18n_key': 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryMatching',
|
||||
'parameters': {},
|
||||
}
|
||||
|
||||
@@ -424,7 +469,7 @@ def test_inventory_file_empty_keeps_gate_retry_as_the_only_primary_action():
|
||||
assert payload['user_status'] == 'waiting_human'
|
||||
assert payload['primary_action'] == {
|
||||
'code': 'retry_inventory_preparation',
|
||||
'i18n_key': 'workspace.shippingNotice.processGate.actionCodes.retry_inventory_preparation',
|
||||
'i18n_key': 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryPreparation',
|
||||
'parameters': {},
|
||||
}
|
||||
assert payload['available_actions'] == ['retry_inventory_preparation']
|
||||
@@ -477,7 +522,7 @@ def test_apply_user_projection_fields_fail_closes_inconsistent_projection():
|
||||
})
|
||||
|
||||
assert payload['user_status'] == 'waiting_human'
|
||||
assert payload['retryable'] is False
|
||||
assert 'retryable' not in payload
|
||||
assert payload['primary_action'] is None
|
||||
assert payload['available_actions'] == []
|
||||
assert payload['blocking_reason']['code'] == 'projection_data_inconsistent'
|
||||
|
||||
Reference in new issue
Block a user