This commit is contained in:
qitz
2023-10-31 13:27:25 +08:00
@@ -222,8 +222,9 @@ public class VideoServiceImpl implements VideoService {
fileName=fileId+fileName; fileName=fileId+fileName;
String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath(); String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath();
staticAndMksDir = Paths.get(absPath).toFile().toString(); staticAndMksDir = Paths.get(absPath).toFile().toString();
HttpUtil.downloadFile(fileUrl, staticAndMksDir ); long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
Long caseId= caseApplicationMapper.selectCaseIdByRoomId(roomId); if(downloadFile>0) {
Long caseId = caseApplicationMapper.selectCaseIdByRoomId(roomId);
String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName); String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
// 存入数据库 // 存入数据库
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId) CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId)
@@ -234,6 +235,7 @@ public class VideoServiceImpl implements VideoService {
caseAttachMapper.save(caseAttach); caseAttachMapper.save(caseAttach);
return annexName; return annexName;
} }
}
return ""; return "";
} }