feat(shipping-notice): 人工重取库存前置候选刷新并放开行级库存源下拉

- 人工重试库存准备前置幂等重判:任务级整单重路由、行级定向重评目标行,复用裁决与冻结链路,零新动作码零契约变更
- 新版候选集 supersede 时内置失效旧库存事实,导出归档与查询服务同步适配
- 行级「库存源」下拉抽纯函数合并选项:歧义行候选置顶 + 全部已启用源去重兜底,任一已启用源可人工指定
- 库存源门禁归一 Notice→OT 身份解析;任务中心抽屉与表格接入行级重取入口
- 同步四语言文案、技术文档与实施计划
This commit is contained in:
hugo committed 2026-10-13 15:04:40 +08:00
1 parent e38e5a63fe
commit ea94fb28db
35 files changed
+2675 -83

No files matched your search

@@ -321,6 +321,28 @@ def test_get_task_for_user_rejects_null_owner(app):
assert get_task_visible_to_user("OT-OWNED", 8, is_admin=True) is not None
def test_can_download_task_export_creator_or_admin(app):
"""导出统一谓词:创建者/管理员可下载;非创建者普通用户与无主单一律拒绝。"""
with app.app_context():
from app import db
from app.services.shipping_notice.query_service import can_download_task_export
owned = ShippingNotice(task_no="SN-DL-OWNED", business_no="QMN-DL-1", user_id=7, source_type="manual")
orphan = ShippingNotice(task_no="SN-DL-ORPHAN", business_no="QMN-DL-2", user_id=None, source_type="manual")
db.session.add_all([owned, orphan])
db.session.commit()
# 创建者可下载;同票对非创建者普通用户拒绝。
assert can_download_task_export(owned, user_id=7) is True
assert can_download_task_export(owned, user_id=8) is False
# 管理员可下载=可见:他人票与无主票均放行(下载留痕审计兜底)。
assert can_download_task_export(owned, user_id=8, is_admin=True) is True
assert can_download_task_export(orphan, user_id=7) is False
assert can_download_task_export(orphan, user_id=7, is_admin=True) is True
# 缺实体一律拒绝。
assert can_download_task_export(None, user_id=7, is_admin=True) is False
def test_serialize_task_summary_enriches_todo_and_can_handle(app):
"""SUMMARY enrich 含 todo_category / created_by / can_handle / ui_state。"""
with app.app_context():