|
@@ -32,8 +32,10 @@ import {
|
|
|
import { buildTestDocumentLineStreamChunks } from './test-document-line-stream';
|
|
import { buildTestDocumentLineStreamChunks } from './test-document-line-stream';
|
|
|
|
|
|
|
|
import { getChatHistoryStorageKey, enterpriseInfo } from '@/components/useEnterpriseAuth';
|
|
import { getChatHistoryStorageKey, enterpriseInfo } from '@/components/useEnterpriseAuth';
|
|
|
-import { fetchRemoteSessionRecords, updateSessionInfo, deleteSessionInfo, type RemoteSession } from '@/network/api/chat-sessions';
|
|
|
|
|
-import { upsertDmsSession, upsertDmsRecord } from '@/network/api/dms/chat-sessions-dms';
|
|
|
|
|
|
|
+import { fetchRemoteSessionRecords, deleteSessionInfo, type RemoteSession } from '@/network/api/chat-sessions';
|
|
|
|
|
+// [已停用] updateSessionInfo 随 1887 会话写入一并停用
|
|
|
|
|
+import { upsertDmsRecord } from '@/network/api/dms/chat-sessions-dms';
|
|
|
|
|
+// [已停用] upsertDmsSession 随 1887 会话写入一并停用
|
|
|
import { collectPolicyCardsFromMessages } from '../Chat/policy-match-utils';
|
|
import { collectPolicyCardsFromMessages } from '../Chat/policy-match-utils';
|
|
|
|
|
|
|
|
interface UseBusinessAssistantChatOptions {
|
|
interface UseBusinessAssistantChatOptions {
|
|
@@ -106,10 +108,13 @@ export function useBusinessAssistantChat(options: UseBusinessAssistantChatOption
|
|
|
void upsertDmsRecord(params);
|
|
void upsertDmsRecord(params);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- // DMS 版本不再要求登录:访客的记录也要落库(c_credit_code = 访客_<访客id>)
|
|
|
|
|
- const syncSessionTitleToServer = (sessionId: string, title: string) => {
|
|
|
|
|
- void updateSessionInfo(sessionId, getCreditCode(), title);
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ // [已停用] 不再往 DMS 的 1887「助手会话」栏目写数据(用户 2026-09-18 指示:
|
|
|
|
|
+ // 「只传具体的会话记录,另一个接口不传了」)。原来这里做会话标题同步,
|
|
|
|
|
+ // 现在改名只改本地;1887 那套写入(含标题同步)整条链路停用。
|
|
|
|
|
+ // 原实现:
|
|
|
|
|
+ // const syncSessionTitleToServer = (sessionId: string, title: string) => {
|
|
|
|
|
+ // void updateSessionInfo(sessionId, getCreditCode(), title);
|
|
|
|
|
+ // };
|
|
|
|
|
|
|
|
const syncSessionDeleteToServer = (sessionId: string) => {
|
|
const syncSessionDeleteToServer = (sessionId: string) => {
|
|
|
void deleteSessionInfo(sessionId, getCreditCode());
|
|
void deleteSessionInfo(sessionId, getCreditCode());
|
|
@@ -327,10 +332,10 @@ export function useBusinessAssistantChat(options: UseBusinessAssistantChatOption
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 首轮完成时同步标题(会话行在发送时已建,这里按 c_session_id 更新)
|
|
|
|
|
- if (session && session.messages.length <= 2) {
|
|
|
|
|
- syncSessionTitleToServer(session.id, session.title || '');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // [已停用] 首轮完成时同步标题到 DMS 会话行(1887 不再写入)
|
|
|
|
|
+ // if (session && session.messages.length <= 2) {
|
|
|
|
|
+ // syncSessionTitleToServer(session.id, session.title || '');
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
finishTask(task);
|
|
finishTask(task);
|
|
|
});
|
|
});
|
|
@@ -461,9 +466,9 @@ export function useBusinessAssistantChat(options: UseBusinessAssistantChatOption
|
|
|
saveHistory();
|
|
saveHistory();
|
|
|
await options.afterSend?.();
|
|
await options.afterSend?.();
|
|
|
|
|
|
|
|
- // 点击提交即写 DMS:会话 upsert(没有就新增、有就更新)+ 本轮问答(先写 question)
|
|
|
|
|
|
|
+ // 点击提交即写 DMS:**只写本轮问答记录(1889)**,不再写会话行(1887)
|
|
|
|
|
+ // [已停用] void upsertDmsSession({ sessionId: session.id, title: session.title });
|
|
|
// fire-and-forget,失败只 warn,不影响聊天
|
|
// fire-and-forget,失败只 warn,不影响聊天
|
|
|
- void upsertDmsSession({ sessionId: session.id, title: session.title });
|
|
|
|
|
saveTurnToDms({ sessionId: session.id, recordId: pendingAiMessage.id, question: text });
|
|
saveTurnToDms({ sessionId: session.id, recordId: pendingAiMessage.id, question: text });
|
|
|
|
|
|
|
|
void coordinator.generateAnswer(text);
|
|
void coordinator.generateAnswer(text);
|
|
@@ -1523,7 +1528,8 @@ export function useBusinessAssistantChat(options: UseBusinessAssistantChatOption
|
|
|
}
|
|
}
|
|
|
chatHistory.value[index].title = nextTitle;
|
|
chatHistory.value[index].title = nextTitle;
|
|
|
saveHistory();
|
|
saveHistory();
|
|
|
- syncSessionTitleToServer(chatHistory.value[index].id, nextTitle);
|
|
|
|
|
|
|
+ // [已停用] 改名不再同步到 DMS 会话行(1887 不再写入)——只改本地
|
|
|
|
|
+ // syncSessionTitleToServer(chatHistory.value[index].id, nextTitle);
|
|
|
return true;
|
|
return true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -1662,9 +1668,9 @@ export function useBusinessAssistantChat(options: UseBusinessAssistantChatOption
|
|
|
saveHistory();
|
|
saveHistory();
|
|
|
await options.afterSend?.();
|
|
await options.afterSend?.();
|
|
|
|
|
|
|
|
- // 补问也是一轮问答:记进 DMS。问题存**真实提交文本**(answerText),
|
|
|
|
|
|
|
+ // 补问也是一轮问答:记进 DMS 的问答记录(1889)。问题存**真实提交文本**(answerText),
|
|
|
// 不存界面上那句「已提交企业信息补充」——否则从 DMS 读回的历史会失真
|
|
// 不存界面上那句「已提交企业信息补充」——否则从 DMS 读回的历史会失真
|
|
|
- void upsertDmsSession({ sessionId: session.id, title: session.title });
|
|
|
|
|
|
|
+ // [已停用] void upsertDmsSession({ sessionId: session.id, title: session.title });
|
|
|
saveTurnToDms({ sessionId: session.id, recordId: pendingAiMessage.id, question: answerText });
|
|
saveTurnToDms({ sessionId: session.id, recordId: pendingAiMessage.id, question: answerText });
|
|
|
|
|
|
|
|
void coordinator.generateAnswer(answerText);
|
|
void coordinator.generateAnswer(answerText);
|