Merge branch 'dev' into runny827
feat(training): 新增精益培训视频与周任务管理 # Conflicts: # backend/app/models/__init__.py
This commit is contained in:
1 parent
85d27e9ffa
commit
91b7233872
812 files changed
+73763
-18908
No files matched your search
@@ -2,11 +2,17 @@
|
||||
services/shipping_notice/chat_actions.py
|
||||
|
||||
用途:发货通知聊天只读状态适配。
|
||||
依赖:state_machine(checkpoint 与内部状态迁移)、ui_state。
|
||||
依赖:state_machine(位置/用户模式与内部状态迁移)、ui_state。
|
||||
逻辑:Chat 不再拥有动作目录或写入口;仅输出 Gate 已裁决的只读 UI State。
|
||||
"""
|
||||
|
||||
from app.services.shipping_notice.state_machine import TaskTransition, apply_task_transition, checkpoint_for_task, resolve_task_ui_state, validate_registry
|
||||
from app.services.shipping_notice.state_machine import (
|
||||
TaskTransition,
|
||||
apply_task_transition,
|
||||
position_for_task,
|
||||
resolve_task_ui_state,
|
||||
validate_registry,
|
||||
)
|
||||
from app.services.shipping_notice.ui_state import build_task_ui_state
|
||||
|
||||
|
||||
@@ -14,19 +20,20 @@ def build_chat_actions_payload(task) -> dict:
|
||||
"""
|
||||
构建聊天气泡侧动作按钮兼容 payload。
|
||||
|
||||
核心逻辑:复用统一 UI State 读模型,抽取聊天侧 checkpoint/summary/process_gate;
|
||||
核心逻辑:复用统一 UI State 读模型,抽取聊天侧 position/user_mode/summary/process_gate;
|
||||
业务动作只从 ui_state.actions 返回,Chat 不再暴露旧 action_buttons。
|
||||
|
||||
Args:
|
||||
task: ShippingNotice 模型实例。
|
||||
|
||||
Returns:
|
||||
包含 task_no、checkpoint、process_gate、actions 与摘要的字典。
|
||||
包含 task_no、position、user_mode、process_gate、actions 与摘要的字典。
|
||||
"""
|
||||
state = build_task_ui_state(task)
|
||||
return {
|
||||
"task_no": state.get("task_no"),
|
||||
"checkpoint": state.get("checkpoint"),
|
||||
"position": state.get("position"),
|
||||
"user_mode": state.get("user_mode"),
|
||||
"stage": state.get("stage"),
|
||||
"todo": state.get("todo"),
|
||||
"actions": state.get("actions"),
|
||||
@@ -41,7 +48,7 @@ __all__ = [
|
||||
"TaskTransition",
|
||||
"apply_task_transition",
|
||||
"build_chat_actions_payload",
|
||||
"checkpoint_for_task",
|
||||
"position_for_task",
|
||||
"resolve_task_ui_state",
|
||||
"validate_registry",
|
||||
]
|
||||
Reference in new issue
Block a user