根据案件id查附件

This commit is contained in:
18792927508
2023-11-30 15:04:09 +08:00
parent 45d23fbab6
commit de1644db2c
4 changed files with 53 additions and 3 deletions
@@ -47,4 +47,12 @@ public interface VideoService {
* @return
*/
AjaxResult htmlToPDF(ReservedConferenceVO reservedConferenceVO);
/**
* 根据案件id和类型查询附件
* @param caseAppliId
* @param annexType
* @return
*/
AjaxResult attachListByCaseId(Long caseAppliId, Integer annexType);
}
@@ -331,8 +331,7 @@ public class VideoServiceImpl implements VideoService {
}
String htmlContent = "<html><body style=\"font-size:12.0pt; font-family:SimSun;\">" +reservedConferenceVO.getHtmlContent()+"</body></html>";
// html转pdf并上传到服务器
PdfUtils pdfUtils = new PdfUtils();
boolean convertFlag = pdfUtils.htmlStringConvertToPDF(RuoYiConfig.getHtml2PDFPath() + currentFileName, htmlContent);
boolean convertFlag = PdfUtils.htmlStringConvertToPDF(RuoYiConfig.getHtml2PDFPath() + currentFileName, htmlContent);
// 绑定案件
if(convertFlag){
@@ -348,6 +347,37 @@ public class VideoServiceImpl implements VideoService {
}
}
@Override
public AjaxResult attachListByCaseId(Long caseAppliId, Integer annexType) {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseAppliId);
caseApplication.setAnnexType(annexType);
List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication);
if(CollectionUtil.isEmpty(caseAttachList)){
return success(caseAttachList);
}
// 附件转换
if (caseAttachList != null && caseAttachList.size() > 0) {
for (CaseAttach caseAttach : caseAttachList) {
String annexName = caseAttach.getAnnexName();
String prefix = "/profile";
int startIndex = annexName.indexOf(prefix);
startIndex += prefix.length();
String annexPath = "/uploadPath" + annexName.substring(startIndex);
caseAttach.setAnnexPath(annexPath);
int startIndexnew = annexName.lastIndexOf("/");
if (startIndexnew != -1) {
String annexNamenew = annexName.substring(startIndexnew + 1);
caseAttach.setAnnexName(annexNamenew);
}
}
}
return success(caseAttachList);
}
/**
* 查询出音视频集合,并下载,在将云点播上面的音视频删除