Преглед на файлове

Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

wangqiong123 преди 2 години
родител
ревизия
8acb479047

+ 12
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java Целия файл

@@ -132,6 +132,18 @@ public class VideoController extends BaseController {
132 132
 
133 133
         return  videoService.htmlToPDF(reservedConferenceVO);
134 134
     }
135
+    /**
136
+     * 根据案件id和类型查询附件
137
+     * @param caseAppliId
138
+     * @param annexType
139
+     * @return
140
+     */
141
+    @Anonymous
142
+    @GetMapping("attachListByCaseId")
143
+    public AjaxResult attachListByCaseId( @RequestParam("caseAppliId") Long caseAppliId,@RequestParam("annexType") Integer annexType) {
144
+
145
+        return  videoService.attachListByCaseId(caseAppliId,annexType);
146
+    }
135 147
 
136 148
 
137 149
 }

+ 1
- 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java Целия файл

@@ -32,7 +32,7 @@ public class PdfUtils {
32 32
      * @param pdfFilePath 保存的路径
33 33
      * @param htmlcontent:必须是完整的html格式,比如<html><body>123</body></html>
34 34
      */
35
-    public  boolean htmlStringConvertToPDF(String pdfFilePath, String htmlcontent) {
35
+    public  static boolean htmlStringConvertToPDF(String pdfFilePath, String htmlcontent) {
36 36
         Document document = new Document();
37 37
         PdfWriter writer = null;
38 38
         try {

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java Целия файл

@@ -47,4 +47,12 @@ public interface VideoService {
47 47
      * @return
48 48
      */
49 49
     AjaxResult htmlToPDF(ReservedConferenceVO reservedConferenceVO);
50
+
51
+    /**
52
+     * 根据案件id和类型查询附件
53
+     * @param caseAppliId
54
+     * @param annexType
55
+     * @return
56
+     */
57
+    AjaxResult attachListByCaseId(Long caseAppliId, Integer annexType);
50 58
 }

+ 32
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java Целия файл

@@ -331,8 +331,7 @@ public class VideoServiceImpl implements VideoService {
331 331
         }
332 332
         String htmlContent = "<html><body style=\"font-size:12.0pt; font-family:SimSun;\">" +reservedConferenceVO.getHtmlContent()+"</body></html>";
333 333
         // html转pdf并上传到服务器
334
-        PdfUtils pdfUtils = new PdfUtils();
335
-        boolean convertFlag = pdfUtils.htmlStringConvertToPDF(RuoYiConfig.getHtml2PDFPath() + currentFileName, htmlContent);
334
+        boolean convertFlag = PdfUtils.htmlStringConvertToPDF(RuoYiConfig.getHtml2PDFPath() + currentFileName, htmlContent);
336 335
 
337 336
         // 绑定案件
338 337
         if(convertFlag){
@@ -348,6 +347,37 @@ public class VideoServiceImpl implements VideoService {
348 347
         }
349 348
     }
350 349
 
350
+    @Override
351
+    public AjaxResult attachListByCaseId(Long caseAppliId, Integer annexType) {
352
+        CaseApplication caseApplication = new CaseApplication();
353
+        caseApplication.setId(caseAppliId);
354
+        caseApplication.setAnnexType(annexType);
355
+        List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication);
356
+        if(CollectionUtil.isEmpty(caseAttachList)){
357
+            return success(caseAttachList);
358
+        }
359
+
360
+        // 附件转换
361
+        if (caseAttachList != null && caseAttachList.size() > 0) {
362
+            for (CaseAttach caseAttach : caseAttachList) {
363
+                String annexName = caseAttach.getAnnexName();
364
+                String prefix = "/profile";
365
+                int startIndex = annexName.indexOf(prefix);
366
+                startIndex += prefix.length();
367
+                String annexPath = "/uploadPath" + annexName.substring(startIndex);
368
+                caseAttach.setAnnexPath(annexPath);
369
+                int startIndexnew = annexName.lastIndexOf("/");
370
+                if (startIndexnew != -1) {
371
+                    String annexNamenew = annexName.substring(startIndexnew + 1);
372
+                    caseAttach.setAnnexName(annexNamenew);
373
+                }
374
+
375
+
376
+            }
377
+        }
378
+        return success(caseAttachList);
379
+    }
380
+
351 381
 
352 382
     /**
353 383
      *  查询出音视频集合,并下载,在将云点播上面的音视频删除