feat: 报销预审会话状态管理与工作台交互增强
- 新增差旅报销会话状态管理与对话模型重构 - 增强风险观测服务与运行时聊天上下文作用域 - 优化工作台图标资源、助理意图识别与摘要工具 - 完善报销创建视图样式与差旅详情页标准调整交互 - 补充风险观测、运行时聊天与报销端点测试覆盖
This commit is contained in:
@@ -33,17 +33,25 @@ FEEDBACK_STATUS_MAP = {
|
||||
|
||||
|
||||
class RiskObservationService:
|
||||
_storage_ready_cache: set[str] = set()
|
||||
|
||||
def __init__(self, db: Session) -> None:
|
||||
self.db = db
|
||||
|
||||
def ensure_storage_ready(self) -> None:
|
||||
bind = self.db.get_bind()
|
||||
cache_key = str(getattr(bind, "url", "") or id(bind))
|
||||
if cache_key in self._storage_ready_cache:
|
||||
return
|
||||
|
||||
Base.metadata.create_all(
|
||||
bind=self.db.get_bind(),
|
||||
bind=bind,
|
||||
tables=[
|
||||
RiskObservation.__table__,
|
||||
RiskObservationFeedback.__table__,
|
||||
],
|
||||
)
|
||||
self._storage_ready_cache.add(cache_key)
|
||||
|
||||
def upsert_observation(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user