feat: 新增归档中心页面并完善知识库与报销查询能力
新增前端归档中心视图及相关工具函数,扩充知识库文档分类和 提取器支持多种格式,增强编排器报销查询的多维度检索,优 化本体规则和用户代理审核消息,前端完善报销创建和审批详 情交互细节,补充单元测试覆盖。
This commit is contained in:
@@ -93,6 +93,12 @@ class AgentConversationService:
|
||||
if existing_session_type != incoming_session_type:
|
||||
normalized_id = ""
|
||||
conversation = None
|
||||
if conversation is not None and self._has_draft_claim_scope_conflict(
|
||||
conversation,
|
||||
incoming_draft_claim_id,
|
||||
):
|
||||
normalized_id = ""
|
||||
conversation = None
|
||||
|
||||
if conversation is None:
|
||||
conversation = AgentConversation(
|
||||
@@ -241,6 +247,10 @@ class AgentConversationService:
|
||||
history_limit: int = 8,
|
||||
) -> dict[str, Any]:
|
||||
merged = dict(context_json or {})
|
||||
incoming_draft_claim_id = self._resolve_draft_claim_id(merged)
|
||||
if self._has_draft_claim_scope_conflict(conversation, incoming_draft_claim_id):
|
||||
return merged
|
||||
|
||||
state_json = dict(conversation.state_json or {})
|
||||
should_hydrate_review_flow = self._should_hydrate_review_flow_context(
|
||||
context_json=merged,
|
||||
@@ -641,6 +651,26 @@ class AgentConversationService:
|
||||
).strip()
|
||||
return ""
|
||||
|
||||
@staticmethod
|
||||
def _resolve_conversation_draft_claim_id(conversation: AgentConversation) -> str:
|
||||
state_json = dict(conversation.state_json or {})
|
||||
return str(
|
||||
conversation.draft_claim_id
|
||||
or state_json.get("draft_claim_id")
|
||||
or ""
|
||||
).strip()
|
||||
|
||||
@staticmethod
|
||||
def _has_draft_claim_scope_conflict(
|
||||
conversation: AgentConversation,
|
||||
incoming_draft_claim_id: str | None,
|
||||
) -> bool:
|
||||
incoming_claim_id = str(incoming_draft_claim_id or "").strip()
|
||||
if not incoming_claim_id:
|
||||
return False
|
||||
existing_claim_id = AgentConversationService._resolve_conversation_draft_claim_id(conversation)
|
||||
return bool(existing_claim_id and existing_claim_id != incoming_claim_id)
|
||||
|
||||
@staticmethod
|
||||
def _merge_state_json(
|
||||
current_state: dict[str, Any] | None,
|
||||
|
||||
Reference in New Issue
Block a user