From de1644db2ca0ce6c4deb0786eb94b8fb15f582bd Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Thu, 30 Nov 2023 15:04:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=A1=88=E4=BB=B6id=E6=9F=A5?= =?UTF-8?q?=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/VideoController.java | 12 +++++++ .../java/com/ruoyi/common/utils/PdfUtils.java | 2 +- .../wisdomarbitrate/service/VideoService.java | 8 +++++ .../service/impl/VideoServiceImpl.java | 34 +++++++++++++++++-- 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java index c5958ad..f0220ee 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java @@ -132,6 +132,18 @@ public class VideoController extends BaseController { return videoService.htmlToPDF(reservedConferenceVO); } + /** + * 根据案件id和类型查询附件 + * @param caseAppliId + * @param annexType + * @return + */ + @Anonymous + @GetMapping("attachListByCaseId") + public AjaxResult attachListByCaseId( @RequestParam("caseAppliId") Long caseAppliId,@RequestParam("annexType") Integer annexType) { + + return videoService.attachListByCaseId(caseAppliId,annexType); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java index 328d5e0..feb1609 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java @@ -32,7 +32,7 @@ public class PdfUtils { * @param pdfFilePath 保存的路径 * @param htmlcontent:必须是完整的html格式,比如
123 */ - public boolean htmlStringConvertToPDF(String pdfFilePath, String htmlcontent) { + public static boolean htmlStringConvertToPDF(String pdfFilePath, String htmlcontent) { Document document = new Document(); PdfWriter writer = null; try { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java index 76e76af..c1c8c71 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java @@ -47,4 +47,12 @@ public interface VideoService { * @return */ AjaxResult htmlToPDF(ReservedConferenceVO reservedConferenceVO); + + /** + * 根据案件id和类型查询附件 + * @param caseAppliId + * @param annexType + * @return + */ + AjaxResult attachListByCaseId(Long caseAppliId, Integer annexType); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java index 3d8b731..ee7ab61 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java @@ -331,8 +331,7 @@ public class VideoServiceImpl implements VideoService { } String htmlContent = "" +reservedConferenceVO.getHtmlContent()+""; // 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