|
|
@@ -222,17 +222,19 @@ public class VideoServiceImpl implements VideoService {
|
|
222
|
222
|
fileName=fileId+fileName;
|
|
223
|
223
|
String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath();
|
|
224
|
224
|
staticAndMksDir = Paths.get(absPath).toFile().toString();
|
|
225
|
|
- HttpUtil.downloadFile(fileUrl, staticAndMksDir );
|
|
226
|
|
- Long caseId= caseApplicationMapper.selectCaseIdByRoomId(roomId);
|
|
227
|
|
- String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
|
|
228
|
|
- // 存入数据库
|
|
229
|
|
- CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId)
|
|
230
|
|
- .annexName(annexName)
|
|
231
|
|
- .annexPath(RuoYiConfig.getVideoUploadPath())
|
|
232
|
|
- .annexType(9)
|
|
233
|
|
- .build();
|
|
234
|
|
- caseAttachMapper.save(caseAttach);
|
|
235
|
|
- return annexName;
|
|
|
225
|
+ long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
|
|
|
226
|
+ if(downloadFile>0) {
|
|
|
227
|
+ Long caseId = caseApplicationMapper.selectCaseIdByRoomId(roomId);
|
|
|
228
|
+ String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
|
|
|
229
|
+ // 存入数据库
|
|
|
230
|
+ CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId)
|
|
|
231
|
+ .annexName(annexName)
|
|
|
232
|
+ .annexPath(RuoYiConfig.getVideoUploadPath())
|
|
|
233
|
+ .annexType(9)
|
|
|
234
|
+ .build();
|
|
|
235
|
+ caseAttachMapper.save(caseAttach);
|
|
|
236
|
+ return annexName;
|
|
|
237
|
+ }
|
|
236
|
238
|
}
|
|
237
|
239
|
return "";
|
|
238
|
240
|
|