From 88e5fbe0c12adb1e07b944adf544373dc57b9a50 Mon Sep 17 00:00:00 2001 From: yaxin Date: Tue, 24 Dec 2024 10:12:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=8D=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=9B=BE=E8=B0=B1=E6=8F=90=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/NotePromptServiceImpl.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/supervision/police/service/impl/NotePromptServiceImpl.java b/src/main/java/com/supervision/police/service/impl/NotePromptServiceImpl.java index 8433770..68c7950 100644 --- a/src/main/java/com/supervision/police/service/impl/NotePromptServiceImpl.java +++ b/src/main/java/com/supervision/police/service/impl/NotePromptServiceImpl.java @@ -15,7 +15,7 @@ import com.supervision.minio.service.MinioService; import com.supervision.police.domain.*; import com.supervision.police.dto.LLMExtractDto; import com.supervision.police.dto.NotePromptDTO; -import com.supervision.police.dto.NotePromptExtractAttributesDto; +import com.supervision.police.dto.TripleInfoDTO; import com.supervision.police.mapper.NotePromptMapper; import com.supervision.police.service.*; import com.supervision.thread.TripleExtractTask; @@ -121,7 +121,7 @@ public class NotePromptServiceImpl extends ServiceImpl listPrompt(NotePromptDTO notePromptDTO) { Page notePromptDTOPage = notePromptMapper.selectNotePromptWithMatchNum(new Page<>(notePromptDTO.getPage(), notePromptDTO.getSize()), notePromptDTO); for (NotePromptDTO record : notePromptDTOPage.getRecords()) { - if (StrUtil.isEmpty(record.getEvidenceCategoryId())){ + if (StrUtil.isEmpty(record.getEvidenceCategoryId())) { continue; } record.setExtractAttributes(caseEvidencePropertyService.findExtractAttributes(record.getEvidenceCategoryId())); @@ -164,6 +164,20 @@ public class NotePromptServiceImpl extends ServiceImpl paramMap = new HashMap<>(); + + + // 头结点-关系-尾结点关系赋值 + List tripleList = notePromptDTO.getTripleList(); + for (TripleInfoDTO dto : tripleList) { + if ("头节点".equals(dto.getType())) { + notePromptDTO.setStartEntityType(dto.getValue()); + } else if ("关系".equals(dto.getType())) { + notePromptDTO.setRelType(dto.getValue()); + } else if ("尾节点".equals(dto.getType())) { + notePromptDTO.setEndEntityType(dto.getValue()); + } + } + paramMap.put("headEntityType", notePromptDTO.getStartEntityType()); paramMap.put("relation", notePromptDTO.getRelType()); paramMap.put("tailEntityType", notePromptDTO.getEndEntityType()); @@ -172,7 +186,7 @@ public class NotePromptServiceImpl extends ServiceImpl