feat: 2026-07-11 全量更新 - 代办集成+会议室预定+知识迭代修复+UI统一+Bug修复
== 已部署上线 (9项) == - 代办事项真实数据源集成 (企微审批API 8bug修复链) - H5/坐席端 Logo样式统一+绿色背景 - 视频引导页修复 (localStorage key v2) - 坐席端 v9 Vue版本修复 (ElMessage._context) - 截图按钮 v10 修复 (getDisplayMedia user gesture) - 扫码样式恢复+H5扫码登录跳转修复 - H5截图快捷键提示 == 代码完成待部署 (3项) == - 知识迭代3Bug修复 (#8 POST端点/#7 MERGE幂等/#6 过期检查) - 会议室预定-小鱼易联终端 (40文件, 40/40测试通过) - IT资产升级审批推送 (asset_service.py) == 需求文档 (2项) == - 坐席端AI辅助消息框-PRD (4项新功能确认) - 坐席端布局优化建议 v2.0 (7天计划) == 新增文档 == - 日报-2026-07-11.md - 知识迭代Bug修复报告-20260711.md - 会议室预定-部署指南.md - CHANGELOG.md 更新 == 测试 == - test_todo_integration.py: 40/40 - test_meetingroom.py: 40/40 - test_bugfix_ki_suggestions.py: 21/21
This commit is contained in:
@@ -0,0 +1,271 @@
|
||||
# 复杂场景重构第一阶段 — 类图
|
||||
|
||||
> **关联文档**: `复杂场景重构第一阶段-架构设计.md` §3
|
||||
|
||||
---
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
direction TB
|
||||
|
||||
%% ==================== 数据模型层 ====================
|
||||
namespace Models {
|
||||
class AutoSession {
|
||||
+String id
|
||||
+String conversation_id
|
||||
+String employee_id
|
||||
+String agent_id
|
||||
+String scenario_key
|
||||
+String status
|
||||
+String mode
|
||||
+Float confidence
|
||||
+JSON intent
|
||||
+String current_action_id
|
||||
+String title
|
||||
+DateTime auto_close_at
|
||||
+DateTime paused_at
|
||||
+DateTime resolved_at
|
||||
+String closed_by
|
||||
+JSON meta
|
||||
+DateTime created_at
|
||||
+DateTime updated_at
|
||||
}
|
||||
|
||||
class AutoAction {
|
||||
+String id
|
||||
+String session_id
|
||||
+Integer action_index
|
||||
+String action_type
|
||||
+String adapter
|
||||
+String risk_level
|
||||
+String title
|
||||
+String description
|
||||
+String status
|
||||
+JSON payload
|
||||
+JSON result
|
||||
+String error
|
||||
+String approved_by
|
||||
+DateTime approved_at
|
||||
}
|
||||
|
||||
class InformationItem {
|
||||
+String id
|
||||
+String session_id
|
||||
+String name
|
||||
+String value
|
||||
+JSON modifiers
|
||||
+Boolean is_filled
|
||||
+Boolean is_locked
|
||||
+Integer version
|
||||
+JSON update_history
|
||||
+DateTime created_at
|
||||
+DateTime updated_at
|
||||
}
|
||||
|
||||
class ApprovalTicket {
|
||||
+String id
|
||||
+String action_id
|
||||
+String session_id
|
||||
+String approver_id
|
||||
+String channel
|
||||
+String status
|
||||
+String reason
|
||||
+String decision_note
|
||||
+DateTime decided_at
|
||||
}
|
||||
|
||||
class ScenarioConfig {
|
||||
+String id
|
||||
+String scenario_key
|
||||
+String name
|
||||
+String description
|
||||
+Boolean enabled
|
||||
+JSON trigger_conditions
|
||||
+JSON actions
|
||||
+JSON approval_strategy
|
||||
+String current_version_id
|
||||
}
|
||||
}
|
||||
|
||||
%% ==================== 服务层 ====================
|
||||
namespace Services {
|
||||
class IntentRouter {
|
||||
-db: AsyncSession
|
||||
-audit: Any
|
||||
+detect(description: str, employee_id: str) Dict
|
||||
+detect_global_intent(text: str) Dict
|
||||
-_keyword_fallback_global(text: str) Dict
|
||||
}
|
||||
|
||||
class DifyClient {
|
||||
-base_url: str
|
||||
-api_key: str
|
||||
-timeout: float
|
||||
+detect_intent(description: str, employee_id: str) Dict
|
||||
-_parse_intent(answer: str) Dict
|
||||
-_parse_global_intent(answer: str) Dict
|
||||
-_fallback_intent(description: str) Dict
|
||||
-_fallback_global_intent(text: str) Dict
|
||||
+test_connection() Dict
|
||||
}
|
||||
|
||||
class AutoSessionService {
|
||||
-db: AsyncSession
|
||||
-redis: Any
|
||||
-audit: Any
|
||||
+create_session(...) AutoSession
|
||||
+get_session(session_id) AutoSession
|
||||
+list_sessions(...) List
|
||||
+start(session_id) void
|
||||
+pause_session(session_id, reason) AutoSession
|
||||
+resume_session(employee_id, session_id) dict
|
||||
+list_paused_sessions(employee_id) List
|
||||
+correct_info(session_id, field, new_value) InformationItem
|
||||
+supplement_info(session_id, field, value) InformationItem
|
||||
+agent_resume(session_id, agent_id) AutoSession
|
||||
+agent_close(session_id, agent_id) AutoSession
|
||||
+takeover(session_id, agent_id) AutoSession
|
||||
+resolve_feedback(session_id, satisfied) AutoSession
|
||||
-_build_resume_point(session) dict
|
||||
-_save_resume_point(session, snapshot) void
|
||||
-_load_resume_point(session_id) dict
|
||||
}
|
||||
|
||||
class InformationItemService {
|
||||
-db: AsyncSession
|
||||
-redis: Any
|
||||
+create_item(session_id, name, value, modifiers) InformationItem
|
||||
+get_items(session_id) List~InformationItem~
|
||||
+get_item(session_id, name) InformationItem
|
||||
+correct_value(session_id, name, new_value) InformationItem
|
||||
+supplement_value(session_id, name, value) InformationItem
|
||||
+lock_items_for_action(session_id, action_id) void
|
||||
+check_downstream_impact(session_id, field) bool
|
||||
+get_pending_required_items(session_id) List~str~
|
||||
}
|
||||
|
||||
class ActionExecutor {
|
||||
-db: AsyncSession
|
||||
-redis: Any
|
||||
-audit: Any
|
||||
-approval: ApprovalService
|
||||
-rollback: RollbackService
|
||||
+run(session_id) void
|
||||
+resume(session_id, action_id, decision) void
|
||||
-_do_execute(session, action, mapping, clients) void
|
||||
-_on_action_failed(session, action, exc) void
|
||||
-_finish_success(session) void
|
||||
}
|
||||
|
||||
class TimeoutCleaner {
|
||||
-db_factory: async_sessionmaker
|
||||
-redis: Any
|
||||
+run_once() int
|
||||
+run_scheduled(interval: int) void
|
||||
-_scan_and_close() int
|
||||
-_notify_timeout(session_id) void
|
||||
}
|
||||
|
||||
class ProgressPublisher {
|
||||
+publish_progress(session_id, step, message) void
|
||||
+publish_action_required(session_id, action, ticket) void
|
||||
+publish_resolved(session_id, summary) void
|
||||
+publish_takeover(session_id, reason) void
|
||||
+publish_error(session_id, code, message) void
|
||||
+publish_paused(session_id, title, paused_at, hint) void
|
||||
+publish_resumed(session_id, title, resumed_at, step) void
|
||||
+publish_timeout_closed(session_id, closed_at, reason) void
|
||||
+publish_info_corrected(session_id, field, old, new, ver) void
|
||||
+publish_info_supplemented(session_id, field, supp, new) void
|
||||
-_publish(event_type, session_id, data) void
|
||||
}
|
||||
}
|
||||
|
||||
%% ==================== Schema 层 ====================
|
||||
namespace Schemas {
|
||||
class GlobalIntentResult {
|
||||
+Optional~str~ global_intent
|
||||
+Optional~str~ scenario_key
|
||||
+float confidence
|
||||
+Optional~str~ corrected_field
|
||||
+Optional~str~ old_value
|
||||
+Optional~str~ new_value
|
||||
+Optional~str~ supplement_field
|
||||
+Optional~str~ supplement_value
|
||||
+str raw
|
||||
+str error
|
||||
}
|
||||
|
||||
class PauseRequest {
|
||||
+Optional~str~ reason
|
||||
}
|
||||
|
||||
class ResumeRequest {
|
||||
+Optional~str~ session_id
|
||||
}
|
||||
|
||||
class CorrectRequest {
|
||||
+str field
|
||||
+str new_value
|
||||
+Optional~str~ old_value
|
||||
}
|
||||
|
||||
class SupplementRequest {
|
||||
+str field
|
||||
+str value
|
||||
}
|
||||
|
||||
class InformationItemResponse {
|
||||
+str id
|
||||
+str session_id
|
||||
+str name
|
||||
+str value
|
||||
+List~str~ modifiers
|
||||
+bool is_filled
|
||||
+bool is_locked
|
||||
+int version
|
||||
+List~dict~ update_history
|
||||
+Optional~str~ updated_at
|
||||
}
|
||||
|
||||
class ResumePointResponse {
|
||||
+str session_id
|
||||
+str title
|
||||
+Optional~str~ scenario_key
|
||||
+str current_step
|
||||
+Optional~str~ paused_at
|
||||
+List~str~ pending_items
|
||||
+List~InformationItemResponse~ info_items
|
||||
}
|
||||
|
||||
class PausedSessionItem {
|
||||
+str session_id
|
||||
+str title
|
||||
+Optional~str~ scenario_key
|
||||
+Optional~str~ paused_at
|
||||
+str paused_duration
|
||||
}
|
||||
}
|
||||
|
||||
%% ==================== 关系 ====================
|
||||
AutoSession "1" --> "*" InformationItem : session_id 关联
|
||||
AutoSession "1" --> "*" AutoAction : session_id 关联
|
||||
AutoSession "1" --> "*" ApprovalTicket : session_id 关联
|
||||
ScenarioConfig --> AutoSession : scenario_key 匹配
|
||||
|
||||
AutoSessionService --> AutoSession : 管理生命周期
|
||||
AutoSessionService --> InformationItemService : 委托信息项操作
|
||||
AutoSessionService --> IntentRouter : 使用意图识别
|
||||
AutoSessionService --> ActionExecutor : 调用续行执行
|
||||
AutoSessionService --> ProgressPublisher : 推送事件
|
||||
|
||||
IntentRouter --> DifyClient : 调用 Dify 识别
|
||||
InformationItemService --> InformationItem : CRUD
|
||||
TimeoutCleaner --> AutoSessionService : 调用 auto_close
|
||||
TimeoutCleaner --> ProgressPublisher : 推送超时事件
|
||||
ProgressPublisher --> AutoSession : 推送状态变更
|
||||
|
||||
InformationItemResponse ..> InformationItem : 序列化
|
||||
ResumePointResponse ..> InformationItemResponse : 包含
|
||||
GlobalIntentResult ..> IntentRouter : 返回类型
|
||||
```
|
||||
Reference in New Issue
Block a user