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:
Simon
2026-07-11 23:13:10 +08:00
parent 3d152fc8eb
commit bea288e414
928 changed files with 85169 additions and 54205 deletions
+26 -8
View File
@@ -20,7 +20,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
from app.models.agent import Agent
from app.models.conversation import Conversation
from app.services.avatar_service import clean_avatar_url
from app.services.avatar_service import clean_avatar_url, wrap_avatar_url
from app.services.wecom_service import WecomService
from app.utils.response import (
AppException,
@@ -912,8 +912,11 @@ class SessionService:
cached_avatar = await self.redis_client.get(cache_key)
if cached_avatar:
# 兼容历史缓存中可能带查询参数,统一清理后返回
return clean_avatar_url(
cached_avatar.decode("utf-8") if isinstance(cached_avatar, bytes) else cached_avatar
# 缓存中存储的是 clean_avatar_url 的结果(不含代理包装),返回时再包装
return wrap_avatar_url(
clean_avatar_url(
cached_avatar.decode("utf-8") if isinstance(cached_avatar, bytes) else cached_avatar
)
)
except Exception as e:
logger.warning(f"从Redis获取头像缓存失败: employee_id={employee_id}, error={e}")
@@ -937,7 +940,8 @@ class SessionService:
await self.redis_client.setex(cache_key, self.AVATAR_CACHE_TTL, cleaned)
except Exception as e:
logger.warning(f"存入Redis头像缓存失败: employee_id={employee_id}, error={e}")
return cleaned
# 缓存中存储 cleaned(不含代理包装),返回时再包装
return wrap_avatar_url(cleaned)
else:
logger.info(f"employees表无头像记录: employee_id={employee_id}")
@@ -973,7 +977,8 @@ class SessionService:
except Exception as e:
logger.warning(f"从企微API获取头像失败: employee_id={employee_id}, error={e}")
return avatar
# 返回时包装为代理 URL(缓存和 DB 中存储的是 clean_avatar_url 的结果)
return wrap_avatar_url(avatar)
async def invite_participants(
self,
@@ -1003,9 +1008,22 @@ class SessionService:
# 1. 校验会话
conversation = await self._get_conversation(conversation_id)
# 2. 权限:只有主责坐席可以邀请
if conversation.assigned_agent_id != inviter_agent_id:
raise AppException(3030, "只有主责坐席才能邀请人员加入会话")
# 2. 权限:主责坐席、会话发起人、或已被邀请的参与者可以邀请
is_primary_agent = conversation.assigned_agent_id == inviter_agent_id
is_creator = conversation.employee_id == inviter_agent_id
# 检查是否为已在会话中的参与者(participants 是结构化对象数组)
# 兼容 "id" 和 "employee_id" 两种可能的键名
is_participant = False
if conversation.participants:
for p in conversation.participants:
if isinstance(p, dict) and (
p.get("id") == inviter_agent_id
or p.get("employee_id") == inviter_agent_id
):
is_participant = True
break
if not (is_primary_agent or is_creator or is_participant):
raise AppException(3030, "只有会话参与者才能邀请人员加入会话")
# 3. 校验:会话必须是服务中状态
if conversation.status != "serving":