[DAT] 文档去重

This commit is contained in:
liu.zixi
2025-10-23 13:18:34 +08:00
parent f9d2b8e92f
commit 11ed049a6a

View File

@@ -57,10 +57,7 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.concurrent.TimeUnit;
@EnableConfigurationProperties({CaseAiProperties.class})
@@ -373,6 +370,7 @@ public class CaseAiChatServiceImpl implements ICaseAiChatService {
try {
// 先处理文件引用收集CaseReferVo数据
List<CaseReferVo> currentCaseRefers = new ArrayList<>();
Set<String> docIds = new HashSet<>();
JSONObject fileRefer = responseData.getJSONObject("fileRefer");
if (fileRefer != null && fileRefer.containsKey("files")) {
@@ -383,7 +381,8 @@ public class CaseAiChatServiceImpl implements ICaseAiChatService {
if (docId != null) {
// 根据docId从 case_document_log 表查询案例数据
CaseReferVo caseRefer = getCaseReferByDocId(docId);
if (caseRefer != null) {
if (caseRefer != null && !docIds.contains(docId)) {
docIds.add(docId);
currentCaseRefers.add(caseRefer);
conversationData.addCaseRefer(caseRefer); // 也添加到总的收集器中
}