|
|
|
@ -6,16 +6,12 @@ import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
import com.supervision.common.constant.NotePromptConstants;
|
|
|
|
|
import com.supervision.common.utils.StringUtils;
|
|
|
|
|
import com.supervision.demo.dto.QARecordNodeDTO;
|
|
|
|
|
import com.supervision.minio.domain.MinioFile;
|
|
|
|
|
import com.supervision.minio.service.MinioService;
|
|
|
|
|
import com.supervision.police.domain.ModelRecordType;
|
|
|
|
|
import com.supervision.police.domain.NotePrompt;
|
|
|
|
|
import com.supervision.police.domain.NotePromptTypeRel;
|
|
|
|
|
import com.supervision.police.domain.NoteRecordSplit;
|
|
|
|
|
import com.supervision.police.domain.*;
|
|
|
|
|
import com.supervision.police.dto.LLMExtractDto;
|
|
|
|
|
import com.supervision.police.dto.NotePromptDTO;
|
|
|
|
|
import com.supervision.police.mapper.NotePromptMapper;
|
|
|
|
@ -25,11 +21,11 @@ import com.supervision.utils.RecordRegexUtil;
|
|
|
|
|
import com.supervision.utils.WordReadUtil;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
|
|
import org.springframework.ai.chat.ChatClient;
|
|
|
|
|
import org.springframework.ai.chat.ChatResponse;
|
|
|
|
|
import org.springframework.ai.chat.messages.UserMessage;
|
|
|
|
|
import org.springframework.ai.chat.prompt.Prompt;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@ -61,6 +57,8 @@ public class NotePromptServiceImpl extends ServiceImpl<NotePromptMapper, NotePro
|
|
|
|
|
private LLMExtractService llmExtractService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ChatClient chatClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private EvidenceCategoryService evidenceCategoryService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<NotePrompt> listPromptBySplitId(String recordSplitId) {
|
|
|
|
@ -181,4 +179,21 @@ public class NotePromptServiceImpl extends ServiceImpl<NotePromptMapper, NotePro
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public NotePromptDTO getById(String id) {
|
|
|
|
|
NotePrompt notePrompt = super.getById(id);
|
|
|
|
|
NotePromptDTO notePromptDTO = new NotePromptDTO();
|
|
|
|
|
BeanUtils.copyProperties(notePrompt, notePromptDTO);
|
|
|
|
|
String evidenceCategoryId = notePromptDTO.getEvidenceCategoryId();
|
|
|
|
|
if (StringUtils.isNotEmpty(evidenceCategoryId)) {
|
|
|
|
|
EvidenceCategory category = evidenceCategoryService.getById(evidenceCategoryId);
|
|
|
|
|
if (category != null) {
|
|
|
|
|
String parentId = category.getParentId();
|
|
|
|
|
notePromptDTO.setEvidenceCategoryIdList(Arrays.asList(parentId, evidenceCategoryId));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return notePromptDTO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|