Files
Simon bea288e414 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
2026-07-11 23:13:10 +08:00

62 lines
3.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# =============================================================================
# 企微IT智能服务台 — 终端-会议室绑定模型
# =============================================================================
# 说明:存储小鱼易联终端SN与企微会议室ID的映射关系
# 这是企微API不提供的关系数据,需要在本地维护
# =============================================================================
from datetime import datetime
from sqlalchemy import Boolean, DateTime, Integer, String, func
from sqlalchemy.orm import Mapped, mapped_column
from app.database import Base
class TerminalRoomBinding(Base):
"""终端-会议室绑定模型。
存储小鱼易联终端SN与企微会议室ID的映射关系。
一个终端只能绑定一个会议室(terminal_sn 唯一索引),
一个会议室可被多个终端绑定(meetingroom_id 普通索引)。
Attributes:
id: 自增主键
terminal_sn: 小鱼易联终端序列号(唯一)
terminal_name: 终端名称(如"18F东区大屏"
meetingroom_id: 企微会议室ID
meetingroom_name: 会议室名称(冗余字段,便于终端页面展示)
location: 位置描述(如"18F东区"
is_active: 是否启用
created_at: 创建时间
updated_at: 更新时间
"""
__tablename__ = "terminal_room_binding"
# 自增主键
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
# 小鱼易联终端序列号(唯一索引,一个终端只能绑定一个会议室)
terminal_sn: Mapped[str] = mapped_column(String(64), unique=True, index=True, nullable=False)
# 终端名称(便于管理后台展示)
terminal_name: Mapped[str] = mapped_column(String(100), nullable=False, default="")
# 企微会议室ID(普通索引,一个会议室可被多个终端绑定)
meetingroom_id: Mapped[int] = mapped_column(Integer, index=True, nullable=False)
# 会议室名称(冗余字段,便于终端页面直接展示,无需额外查询企微API)
meetingroom_name: Mapped[str] = mapped_column(String(100), nullable=False, default="")
# 位置描述
location: Mapped[str] = mapped_column(String(200), nullable=False, default="")
# 是否启用(默认True,管理员可禁用绑定)
is_active: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
# 创建时间(服务器默认当前时间)
created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now(), nullable=False)
# 更新时间(每次更新时自动刷新)
updated_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now(), onupdate=func.now(), nullable=False)
def __repr__(self) -> str:
"""返回模型的可读字符串表示。"""
return (
f"<TerminalRoomBinding(id={self.id}, terminal_sn='{self.terminal_sn}', "
f"meetingroom_id={self.meetingroom_id}, meetingroom_name='{self.meetingroom_name}')>"
)