|
|
@@ -53,8 +53,7 @@ import java.util.Map;
|
|
53
|
53
|
import java.util.stream.Collectors;
|
|
54
|
54
|
|
|
55
|
55
|
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
|
56
|
|
-import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
|
|
57
|
|
-import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
|
|
|
56
|
+import static com.ruoyi.common.utils.file.FileUploadUtils.*;
|
|
58
|
57
|
|
|
59
|
58
|
/**
|
|
60
|
59
|
* @author wangqiong
|
|
|
@@ -454,23 +453,29 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
|
454
|
453
|
String fileName = fileUrl.substring(fileUrl.lastIndexOf("/"));
|
|
455
|
454
|
fileName = fileName.replace("/", "");
|
|
456
|
455
|
fileName=fileId+fileName;
|
|
457
|
|
- String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath();
|
|
|
456
|
+ String annexName=System.currentTimeMillis()+fileName;
|
|
|
457
|
+ String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), annexName).getAbsolutePath();
|
|
458
|
458
|
staticAndMksDir = Paths.get(absPath).toFile().toString();
|
|
459
|
459
|
long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
|
|
460
|
460
|
if(downloadFile>0) {
|
|
|
461
|
+
|
|
461
|
462
|
Example example = new Example(MsCaseApplication.class);
|
|
462
|
463
|
example.createCriteria().andEqualTo("roomId", roomId);
|
|
463
|
464
|
MsCaseApplication caseApplication = caseApplicationMapper.selectOneByExample(example);
|
|
464
|
465
|
if(caseApplication != null) {
|
|
465
|
|
- String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
|
|
466
|
|
- // 存入数据库
|
|
467
|
|
- MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(caseApplication.getId())
|
|
468
|
|
- .annexName(fileName)
|
|
469
|
|
- .annexPath(annexName)
|
|
470
|
|
- .annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
|
|
471
|
|
- .build();
|
|
472
|
|
- caseAttachMapper.save(caseAttach);
|
|
473
|
|
- return annexName;
|
|
|
466
|
+ // 根据文件名称查询附件,如果该视频已存在则不存入数据库
|
|
|
467
|
+ int count= caseAttachMapper.countByfileName(fileName,caseApplication.getId());
|
|
|
468
|
+ if(count<1) {
|
|
|
469
|
+ annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), annexName);
|
|
|
470
|
+ // 存入数据库
|
|
|
471
|
+ MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(caseApplication.getId())
|
|
|
472
|
+ .annexName(fileName)
|
|
|
473
|
+ .annexPath(annexName)
|
|
|
474
|
+ .annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
|
|
|
475
|
+ .build();
|
|
|
476
|
+ caseAttachMapper.save(caseAttach);
|
|
|
477
|
+ return annexName;
|
|
|
478
|
+ }
|
|
474
|
479
|
}
|
|
475
|
480
|
}
|
|
476
|
481
|
}
|