|
|
@ -48,13 +48,7 @@ public class SaveDataExtractResultDomainServiceImpl implements SaveDataExtractRe |
|
|
} |
|
|
} |
|
|
informationFileBaseService.updateById(file); |
|
|
informationFileBaseService.updateById(file); |
|
|
|
|
|
|
|
|
// 2. 解析失败则记录日志
|
|
|
// 2. 检查该虚拟资料下所有子文件是否全部到达终态(Success 或 Failed)
|
|
|
if (!FileParseStatusEnum.Success.getValue().equals(callback.getParseStatus())) { |
|
|
|
|
|
log.warn(">>> [数据服务回调] 子文件解析失败, fileId={}, error={}", fileId, callback.getErrorMsg()); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 3. 检查该虚拟资料下所有子文件是否全部完成
|
|
|
|
|
|
List<InformationFileEntity> allFiles = informationFileBaseService.list( |
|
|
List<InformationFileEntity> allFiles = informationFileBaseService.list( |
|
|
new LambdaQueryWrapper<InformationFileEntity>() |
|
|
new LambdaQueryWrapper<InformationFileEntity>() |
|
|
.eq(InformationFileEntity::getInformationId, informationId)); |
|
|
.eq(InformationFileEntity::getInformationId, informationId)); |
|
|
@ -68,12 +62,21 @@ public class SaveDataExtractResultDomainServiceImpl implements SaveDataExtractRe |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 4. 全部完成 → 调用算法服务知识点提取
|
|
|
// 3. 所有子文件均已到达终态
|
|
|
log.info(">>> [数据服务回调] 虚拟资料 {} 下所有子文件解析完成,开始调用算法服务", informationId); |
|
|
boolean allSuccess = allFiles.stream() |
|
|
|
|
|
.allMatch(f -> FileParseStatusEnum.Success.getValue().equals(f.getParseStatus())); |
|
|
|
|
|
|
|
|
|
|
|
if (!allSuccess) { |
|
|
|
|
|
log.warn(">>> [数据服务回调] 虚拟资料 {} 下存在解析失败的子文件,跳过算法调用", informationId); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 4. 全部成功 → 调用算法服务知识点提取
|
|
|
|
|
|
log.info(">>> [数据服务回调] 虚拟资料 {} 下所有子文件解析成功,开始调用算法服务", informationId); |
|
|
|
|
|
|
|
|
List<AiExtractRequestDTO.FileContent> fileContents = new ArrayList<>(); |
|
|
List<AiExtractRequestDTO.FileContent> fileContents = new ArrayList<>(); |
|
|
for (InformationFileEntity f : allFiles) { |
|
|
for (InformationFileEntity f : allFiles) { |
|
|
if (FileParseStatusEnum.Success.getValue().equals(f.getParseStatus()) && f.getParsedText() != null) { |
|
|
if (f.getParsedText() != null) { |
|
|
AiExtractRequestDTO.FileContent fc = new AiExtractRequestDTO.FileContent(); |
|
|
AiExtractRequestDTO.FileContent fc = new AiExtractRequestDTO.FileContent(); |
|
|
fc.setFileName(f.getFileName()); |
|
|
fc.setFileName(f.getFileName()); |
|
|
fc.setContentCategory(String.valueOf(f.getContentCategory())); |
|
|
fc.setContentCategory(String.valueOf(f.getContentCategory())); |
|
|
@ -83,7 +86,7 @@ public class SaveDataExtractResultDomainServiceImpl implements SaveDataExtractRe |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (fileContents.isEmpty()) { |
|
|
if (fileContents.isEmpty()) { |
|
|
log.warn(">>> [数据服务回调] 虚拟资料 {} 下没有成功解析的子文件", informationId); |
|
|
log.warn(">>> [数据服务回调] 虚拟资料 {} 下所有子文件已解析成功但 parsedText 均为空", informationId); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|