瀏覽代碼

fix:批量下载 题卡名称根据规则生成

caozixuan 3 年之前
父節點
當前提交
2d8d93916f

+ 14 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -1742,8 +1742,18 @@ public class TaskLogicServiceImpl implements TaskLogicService {
 
 
                 byte[] bytes = htmlContent.getBytes();
-                String cardLocalHtmlPath = filePath + "题卡-" + examCardService.getById(examCardId).getTitle() + SystemConstant.HTML_PREFIX;
-                String cardLocalPdfPath = filePath + "题卡-" + examCardService.getById(examCardId).getTitle() + SystemConstant.PDF_PREFIX;
+                String cardName = "题卡-";
+                if (namedByCourseInfo){
+                    cardName = cardName + course;
+                }
+                if (namedByPaperNumber){
+                    cardName = cardName + paperNumber;
+                }
+                if (namedByOriginalFile){
+                    cardName = cardName + examCardService.getById(examCardId).getTitle();
+                }
+                String cardLocalHtmlPath = filePath + cardName + SystemConstant.HTML_PREFIX;
+                String cardLocalPdfPath = filePath + cardName + SystemConstant.PDF_PREFIX;
 
                 switch (paperFileDownloadContent) {
                     case ONLY_CARD: // 只下载题卡
@@ -1771,6 +1781,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                             if (namedByOriginalFile){
                                 paperName = paperName + examTaskPaperFileDto.getPaperName();
                             }
+                            paperName = paperName + "-" + examTaskPaperFileDto.getPaperType();
                             String paperLocalPath = filePath + paperName + examTaskPaperFileDto.getPaperSuffix();
                             String paperPath = examTaskPaperFileDto.getPaperPath();
                             fileStoreUtil.ossDownload(paperPath, paperLocalPath, fileStoreUtil.getUploadEnumByPath(paperPath).getFssType());
@@ -1801,6 +1812,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                             if (namedByOriginalFile){
                                 paperName = paperName + examTaskPaperFileDto.getPaperName();
                             }
+                            paperName = paperName + "-" + examTaskPaperFileDto.getPaperType();
                             String paperLocalPath = filePath + paperName + examTaskPaperFileDto.getPaperSuffix();
                             String paperPath = examTaskPaperFileDto.getPaperPath();
                             fileStoreUtil.ossDownload(paperPath, paperLocalPath, fileStoreUtil.getUploadEnumByPath(paperPath).getFssType());