|
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.type.TypeReference; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.project.information.domain.entity.InformationEntity; |
|
|
|
import com.project.information.domain.entity.InformationFileEntity; |
|
|
|
import com.project.information.domain.enums.DraftStatusEnum; |
|
|
|
import com.project.information.domain.enums.FileParseStatusEnum; |
|
|
|
import com.project.information.domain.enums.InformationParseStatusEnum; |
|
|
|
import com.project.information.domain.service.InformationBaseService; |
|
|
|
@ -101,6 +102,15 @@ public class SaveDataExtractResultDomainServiceImpl implements SaveDataExtractRe |
|
|
|
AiExtractRequestDTO request = buildExtractRequest(informationId); |
|
|
|
if (request != null) { |
|
|
|
postToAiExtractDomainService.postToAiExtract(request); |
|
|
|
} else { |
|
|
|
// 所有子文件解析文本均为空,无知识点可提取,视为解析成功
|
|
|
|
InformationEntity information = informationBaseService.getById(informationId); |
|
|
|
if (information != null) { |
|
|
|
information.setParseStatus(InformationParseStatusEnum.Success.getValue()); |
|
|
|
information.setDraftStatus(DraftStatusEnum.PENDING.getValue()); |
|
|
|
informationBaseService.updateById(information); |
|
|
|
} |
|
|
|
log.info(">>> [数据服务回调] 虚拟资料 {} 所有子文件解析文本为空,无知识点,视为解析成功,draftStatus=PENDING", informationId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -116,7 +126,7 @@ public class SaveDataExtractResultDomainServiceImpl implements SaveDataExtractRe |
|
|
|
|
|
|
|
List<AiExtractRequestDTO.Segment> allSegments = new ArrayList<>(); |
|
|
|
for (InformationFileEntity f : allFiles) { |
|
|
|
if (f.getParsedText() == null || f.getParsedText().isBlank()) { |
|
|
|
if (f.getParsedText() == null || f.getParsedText().isBlank() || "null".equals(f.getParsedText())) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
// 解析 parsed_text JSON: {"segments": [[{"content": "...", "supplement": "", "chapter": "...", "content_type": "..."}]]}
|
|
|
|
|