文件读取逻辑纠正

This commit is contained in:
liu.zixi
2025-09-24 13:59:04 +08:00
parent 9b5e3c47f5
commit fb9d31e2ec

View File

@@ -6,6 +6,7 @@ import com.xboe.common.utils.IDGenerator;
import com.xboe.common.utils.StringUtil;
import com.xboe.common.OrderCondition;
import com.xboe.core.orm.FieldFilters;
import com.xboe.core.upload.XFileUploader;
import com.xboe.enums.CaseDocumentLogCaseStatusEnum;
import com.xboe.enums.CaseDocumentLogOptStatusEnum;
import com.xboe.enums.CaseDocumentLogOptTypeEnum;
@@ -61,6 +62,9 @@ public class CaseKnowledgeServiceImpl implements ICaseKnowledgeService {
@Resource
private CaseDocumentLogDao caseDocumentLogDao;
@Resource
private XFileUploader fileUploader;
@Autowired
private IAiAccessTokenService aiAccessTokenService;
@@ -86,9 +90,11 @@ public class CaseKnowledgeServiceImpl implements ICaseKnowledgeService {
return false;
}
File file = new File(caseEntity.getFilePath());
String savePath = fileUploader.getSavePath();
String filePath = savePath + caseEntity.getFilePath();
File file = new File(filePath);
if (!file.exists()) {
log.error("上传案例文档失败案例文件不存在filePath: {}", caseEntity.getFilePath());
log.error("上传案例文档失败案例文件不存在filePath: {}", filePath);
return false;
}
@@ -380,9 +386,11 @@ public class CaseKnowledgeServiceImpl implements ICaseKnowledgeService {
return false;
}
File file = new File(caseEntity.getFilePath());
String savePath = fileUploader.getSavePath();
String filePath = savePath + caseEntity.getFilePath();
File file = new File(filePath);
if (!file.exists()) {
log.warn("调用上传接口失败案例文件不存在filePath: {}", caseEntity.getFilePath());
log.warn("调用上传接口失败案例文件不存在filePath: {}", filePath);
return false;
}