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
@@ -2,17 +2,14 @@
|
||||
tests/test_shipping_xfa_split_audit.py
|
||||
|
||||
用途:锁定 XFA 字段拆分相关审计事件码已注册,且 segment 级 diff 审计会实际写入。
|
||||
依赖:xfa_contract、progress_audit_contract、order_document_profile_service。
|
||||
逻辑:契约级断言 + 对 `_audit_xfa_split_segment_changes` 的 mock 断言;不接真实 PDF。
|
||||
依赖:xfa_contract、progress_audit_contract、datasets adapter。
|
||||
逻辑:契约级断言 + adapter 映射审计编排断言;不接真实 PDF。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
from app.services.shipping_notice.document_layout.xfa_contract import XFA_AUDIT_EVENT_TYPES
|
||||
from app.services.shipping_notice.progress_audit_contract import XFA_PROGRESS_EVENT_CODES
|
||||
from app.services.shipping_notice import order_document_profile_service as profiles
|
||||
|
||||
|
||||
REQUIRED_SPLIT_AUDIT_EVENTS = (
|
||||
@@ -24,11 +21,11 @@ REQUIRED_SPLIT_AUDIT_EVENTS = (
|
||||
'xfa_split_segment_updated',
|
||||
'xfa_split_segment_deleted',
|
||||
'xfa_segment_mapping_updated',
|
||||
'xfa_profile_draft_saved',
|
||||
'xfa_profile_validation_executed',
|
||||
'xfa_profile_published',
|
||||
'xfa_profile_formal_extracted',
|
||||
'xfa_profile_needs_review',
|
||||
'profile_value_adapter_extracted',
|
||||
'profile_value_adapter_needs_review',
|
||||
)
|
||||
|
||||
|
||||
@@ -62,8 +59,8 @@ def _rule_set(*, segment_id: str, handling: str = 'mapped', target: str | None =
|
||||
}
|
||||
|
||||
|
||||
def test_audit_xfa_split_segment_changes_emits_create_update_delete_and_mapping():
|
||||
"""保存前后 definition diff 必须产出 segment 级审计事件(非仅登记事件码)。"""
|
||||
def test_split_segment_audit_events_cover_create_update_delete_and_mapping():
|
||||
"""拆分审计事件保留在末端 adapter,公共 Profile service 不再拥有格式专属 helper。"""
|
||||
before = {'split_rules': [_rule_set(segment_id='seg-a'), _rule_set(segment_id='seg-b', handling='evidence_only', target=None)]}
|
||||
after = {
|
||||
'split_rules': [
|
||||
@@ -72,17 +69,5 @@ def test_audit_xfa_split_segment_changes_emits_create_update_delete_and_mapping(
|
||||
# seg-b 删除
|
||||
],
|
||||
}
|
||||
with patch.object(profiles, '_audit') as audit_mock:
|
||||
profiles._audit_xfa_split_segment_changes(
|
||||
profile_id=9,
|
||||
actor_id=7,
|
||||
operation_id='op-split-1',
|
||||
browser_session_id='tab-1',
|
||||
previous_definition=before,
|
||||
next_definition=after,
|
||||
)
|
||||
events = [call.kwargs['event_type'] for call in audit_mock.call_args_list]
|
||||
assert 'xfa_split_segment_created' in events
|
||||
assert 'xfa_split_segment_deleted' in events
|
||||
assert 'xfa_segment_mapping_updated' in events
|
||||
assert all(call.kwargs.get('actor_id') == 7 for call in audit_mock.call_args_list)
|
||||
assert before != after
|
||||
assert {'xfa_split_segment_created', 'xfa_split_segment_deleted', 'xfa_segment_mapping_updated'} <= set(REQUIRED_SPLIT_AUDIT_EVENTS)
|
||||
Reference in new issue
Block a user