feat(shipping-notice): 新增临时库存管理功能,支持创建会话、获取分析结果及字段映射建议
This commit is contained in:
1 parent
46eb63f5bb
commit
e9bdd81f1a
320 files changed
+28361
-10487
No files matched your search
@@ -8,23 +8,11 @@ services/shipping_notice/constants.py
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
# HTTP JSON request/response fields
|
||||
MAP_JSON = "map_json"
|
||||
SUGGEST_OK = "suggest_ok"
|
||||
AUTO_MAP = "auto_map"
|
||||
# Workspace / Hxops chat fallback only — Dify 正式路径不直接调用主推进 Tool;人工确认后由后端 worker 续跑
|
||||
AUTO_CHAIN_FALLBACK = "auto_chain_fallback"
|
||||
|
||||
# Legacy request field names (read-only compat)
|
||||
MAP_JSON_LEGACY = "column_mapping_json"
|
||||
|
||||
# Checkpoints (tool_response.checkpoint; canonical ids — register buttons in state_machine.py)
|
||||
CP_ALIGN_REVIEW = "align_review"
|
||||
CP_MAP_INFER = "map_infer"
|
||||
CP_UPLOAD_REQ = "upload_req"
|
||||
CP_MAP_OK = "map_ok"
|
||||
CP_PARSE_OK = "parse_ok"
|
||||
CP_PARSE_REVIEW = "parse_review"
|
||||
CP_CUSTOMER_REVIEW = "customer_review"
|
||||
@@ -45,7 +33,6 @@ CP_UPLOADED = "uploaded"
|
||||
CP_COMPLETED = "completed"
|
||||
|
||||
# review_status
|
||||
RS_ALIGN_REVIEW = "align_review"
|
||||
RS_PARSE_REVIEW = "parse_review"
|
||||
RS_SHORTAGE_REVIEW = "shortage_review"
|
||||
RS_RSV_REQ = "rsv_req"
|
||||
@@ -53,8 +40,6 @@ RS_REJECTED = "rejected"
|
||||
RS_CONFIRMED = "confirmed"
|
||||
|
||||
# pending_human_reason (internal; shortened)
|
||||
PH_ALIGN_REVIEW = CP_ALIGN_REVIEW
|
||||
PH_MAP_INFER = CP_MAP_INFER
|
||||
PH_LOW_CONF = "low_confidence"
|
||||
PH_RSV_REQ = CP_RSV_REQ
|
||||
PH_SHORTAGE = "shortage"
|
||||
@@ -65,13 +50,3 @@ PH_INVENTORY_SOURCE_UNRESOLVED = "inventory_source_unresolved"
|
||||
PH_NOTICE_TEXT_EXTRACTION_FAILED = CP_NOTICE_TEXT_EXTRACTION_FAILED
|
||||
PH_UPLOAD_RPA_FAILED = "upload_rpa_failed"
|
||||
PH_UPLOAD_RPA_PENDING = "upload_rpa_pending"
|
||||
|
||||
|
||||
def payload_map_json(payload: dict[str, Any]) -> Any:
|
||||
"""从请求体读取列映射 JSON,兼容 map_json 与 legacy column_mapping_json 字段名。"""
|
||||
raw = payload.get(MAP_JSON)
|
||||
if raw is None:
|
||||
raw = payload.get(MAP_JSON_LEGACY)
|
||||
if raw is None:
|
||||
raw = payload.get("field_mapping")
|
||||
return raw
|
||||
Reference in new issue
Block a user