feat(shipping-notice): 新增临时库存管理功能,支持创建会话、获取分析结果及字段映射建议
This commit is contained in:
1 parent
46eb63f5bb
commit
e9bdd81f1a
320 files changed
+28361
-10487
No files matched your search
@@ -8,6 +8,7 @@ from app.services.shipping_notice.query_service import (
|
||||
extract_task_no_from_text,
|
||||
get_task_by_ref,
|
||||
get_task_in_batch,
|
||||
list_tasks_for_user,
|
||||
list_batch_task_summaries,
|
||||
resolve_task_from_payload,
|
||||
serialize_batch,
|
||||
@@ -80,6 +81,33 @@ def test_get_task_in_batch_rejects_foreign_task(app):
|
||||
assert get_task_in_batch("SB-B", "SN-FOREIGN") is None
|
||||
|
||||
|
||||
def test_list_tasks_for_user_filters_shortage_review_by_user_facing_state(app):
|
||||
"""库存缺口筛选应读取复核状态,而不是要求不存在的 process_status。"""
|
||||
with app.app_context():
|
||||
from app import db
|
||||
|
||||
shortage = ShippingTask(
|
||||
task_no="SN-FILTER-SHORTAGE",
|
||||
process_status="pending_review",
|
||||
review_status="shortage_review",
|
||||
pending_human_reason="shortage",
|
||||
source_type="manual",
|
||||
)
|
||||
ordinary = ShippingTask(
|
||||
task_no="SN-FILTER-PARSE",
|
||||
process_status="pending_review",
|
||||
review_status="parse_review",
|
||||
pending_human_reason="low_confidence",
|
||||
source_type="manual",
|
||||
)
|
||||
db.session.add_all([shortage, ordinary])
|
||||
db.session.commit()
|
||||
|
||||
rows = list_tasks_for_user(999999, process_status="shortage_review")
|
||||
|
||||
assert [item["task_no"] for item in rows] == ["SN-FILTER-SHORTAGE"]
|
||||
|
||||
|
||||
def test_task_export_error_message_distinct_for_missing_path(app):
|
||||
"""无导出路径与磁盘缺失应返回不同错误文案。"""
|
||||
with app.app_context():
|
||||
@@ -92,7 +120,7 @@ def test_task_export_error_message_distinct_for_missing_path(app):
|
||||
source_type="manual",
|
||||
export_file_path="/tmp/not-a-real-shipping-export.xlsx",
|
||||
)
|
||||
assert task_export_error_message(missing) == "export file missing on disk"
|
||||
assert task_export_error_message(missing) == "export file not found" # 未落库 Task 不具备 Artifact 身份。
|
||||
|
||||
|
||||
def test_task_projection_tool_strips_internal_fields(app):
|
||||
|
||||
Reference in new issue
Block a user