feat(shipping-notice): 优化货运订单履约流程与用户体验
- 优化聊天附件列表为横向可滚动布局并新增配套测试用例 - 移除自动填充默认用户消息逻辑,空备注时不再伪造默认正文 - 修复流程Gate动作展示逻辑,隐藏历史遗留操作与自动阶段无效按钮 - 完善库存匹配重试与订单快照冻结校验流程 - 优化进度展示优先级,优先显示人工待处理状态 - 移除Excel导出自动推导金额逻辑,强制使用Schema配置字段 - 新增货代通用报表RPA详细设计文档 - 更新相关测试用例与断言逻辑
This commit is contained in:
1 parent
dc282f3b1d
commit
11cef575b4
51 files changed
+2197
-112
No files matched your search
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
services/shipping_notice/fulfillment_audit.py
|
||||
backend/app/services/shipping_notice/fulfillment_audit.py
|
||||
|
||||
用途:履约关键节点与敏感访问写入统一审计事件的轻量封装。
|
||||
依赖:audit_service.append_shipping_audit_event、Flask g.request_id / request、AppError。
|
||||
@@ -148,6 +148,49 @@ def record_fulfillment_audit(
|
||||
) from exc
|
||||
|
||||
|
||||
def emit_stp_auto_create_blocked_manual_audit(
|
||||
*,
|
||||
case: Any | None,
|
||||
job_id: int,
|
||||
error_code: str,
|
||||
next_action: str,
|
||||
details: dict[str, Any] | None = None,
|
||||
) -> None:
|
||||
"""
|
||||
记录 STP 自动建单业务阻断的人工处理审计事件。
|
||||
|
||||
核心逻辑:使用订单复核 Case 作为可选聚合,Job 作为稳定元数据引用;Worker 无请求上下文时仍可写入。
|
||||
Args:
|
||||
case: 可选 ShippingOrderReviewCase,优先提供 case_no;不得传入正文或凭据。
|
||||
job_id: STP Job 主键。
|
||||
error_code: 稳定业务阻断错误码。
|
||||
next_action: 后续人工处理动作编码。
|
||||
details: 脱敏诊断事实,仅允许审计元数据白名单字段。
|
||||
Returns:
|
||||
None。审计失败由 record_fulfillment_audit 按 strict 契约抛出。
|
||||
"""
|
||||
case_no = str(getattr(case, 'case_no', '') or '').strip() or None
|
||||
metadata = {
|
||||
'job_id': int(job_id),
|
||||
'next_action': str(next_action or '').strip() or None,
|
||||
**dict(details or {}),
|
||||
}
|
||||
record_fulfillment_audit(
|
||||
event_type='stp_auto_create_blocked_manual',
|
||||
aggregate_type='order_review_case' if case_no else 'shipping_job',
|
||||
aggregate_id=case_no or str(job_id),
|
||||
action='stp_auto_create_blocked_manual',
|
||||
actor_type='worker',
|
||||
task_no=case_no,
|
||||
review_case_no=case_no,
|
||||
reason_code=str(error_code or '').strip() or None,
|
||||
error_code=str(error_code or '').strip() or None,
|
||||
result='rejected',
|
||||
metadata=metadata,
|
||||
source='worker',
|
||||
)
|
||||
|
||||
|
||||
def record_access_audit(
|
||||
*,
|
||||
action: str,
|
||||
|
||||
Reference in new issue
Block a user