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
@@ -118,65 +118,6 @@ def xfa_enabled() -> bool:
|
||||
return cfg_bool("SHIPPING_NOTICE_XFA_ENABLED", True)
|
||||
|
||||
|
||||
def xfa_shadow_mode_enabled() -> bool:
|
||||
"""
|
||||
XFA shadow:完整执行解析与资格评估,但必须阻断真实自动建单。
|
||||
|
||||
核心逻辑:开启时仍计算 shadow_would_auto_create;真实建单仍走统一 Schema/CQ
|
||||
`auto_create_enabled`,本开关不再另设独立 XFA 自动建单环境变量。
|
||||
"""
|
||||
return cfg_bool("SHIPPING_NOTICE_XFA_SHADOW_MODE", False)
|
||||
|
||||
|
||||
def _parse_csv_allowlist(raw: str | None) -> list[str]:
|
||||
"""解析逗号/分号分隔白名单,去空并保持稳定顺序。"""
|
||||
text = str(raw or '').strip()
|
||||
if not text:
|
||||
return []
|
||||
items: list[str] = []
|
||||
for part in text.replace(';', ',').split(','):
|
||||
value = str(part or '').strip()
|
||||
if value:
|
||||
items.append(value)
|
||||
return items
|
||||
|
||||
|
||||
def xfa_customer_allowlist() -> list[int]:
|
||||
"""
|
||||
XFA 客户白名单(自动建单硬门禁)。
|
||||
|
||||
Returns:
|
||||
客户主键列表;空列表表示未配置,fail-closed。
|
||||
"""
|
||||
raw = current_app.config.get('SHIPPING_NOTICE_XFA_CUSTOMER_ALLOWLIST')
|
||||
result: list[int] = []
|
||||
for item in _parse_csv_allowlist(str(raw or '')):
|
||||
try:
|
||||
result.append(int(item))
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
return sorted(set(result))
|
||||
|
||||
|
||||
def xfa_profile_checksum_allowlist() -> list[str]:
|
||||
"""XFA Profile checksum 白名单(自动建单硬门禁);空列表 fail-closed。"""
|
||||
raw = current_app.config.get('SHIPPING_NOTICE_XFA_PROFILE_CHECKSUM_ALLOWLIST')
|
||||
return sorted(set(_parse_csv_allowlist(str(raw or ''))))
|
||||
|
||||
|
||||
def xfa_scenario_allowlist() -> list[str]:
|
||||
"""XFA 业务场景白名单(自动建单硬门禁);默认 shipping_notice_order。"""
|
||||
raw = current_app.config.get('SHIPPING_NOTICE_XFA_SCENARIO_ALLOWLIST')
|
||||
if raw is None or str(raw).strip() == '':
|
||||
raw = 'shipping_notice_order'
|
||||
items = [
|
||||
str(item).strip().lower()
|
||||
for item in _parse_csv_allowlist(str(raw))
|
||||
if str(item).strip()
|
||||
]
|
||||
return sorted(set(items)) or ['shipping_notice_order']
|
||||
|
||||
|
||||
def llm_review_enabled() -> bool:
|
||||
"""确定性解析失败后是否允许请求 Dify 最小证据建议(不得自动冻结)。"""
|
||||
return cfg_bool("SHIPPING_NOTICE_LLM_REVIEW_ENABLED", False)
|
||||
@@ -534,7 +475,7 @@ def _audit_reason_code_for_task_event(event_type: str, detail: dict[str, Any]) -
|
||||
if name in mapping:
|
||||
code = mapping[name]
|
||||
if name == 'inventory_rpa_failed':
|
||||
if 'timeout' in err_blob:
|
||||
if 'timeout' in err_blob or ('not ready' in err_blob and 'within' in err_blob):
|
||||
return 'inventory_rpa_timeout'
|
||||
if 'login' in err_blob or 'auth' in err_blob:
|
||||
return 'inventory_rpa_login_failed'
|
||||
|
||||
Reference in new issue
Block a user