Browse Source

fix:
1.下载管理-试卷曝光日志数量

caozixuan 3 years ago
parent
commit
bf9af5237a

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

@@ -1711,8 +1711,11 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         }
         // 二级路径 课程
         Set<String> courseSet = examTaskPaperFileDtoList.stream().map(e -> e.getCourseName() + "-" + e.getCourseCode()).collect(Collectors.toSet());
+        // 文件数以一级目录文件为准(初始1是excel)
+        int count = 1;
         for (String course : courseSet) {
             // 三级路径 课程代码-课程名称/试卷编号
+            int courseCount = 0;
             Set<String> paperNumberSet = examTaskPaperFileDtoList
                     .stream()
                     .filter(e -> course.equals(e.getCourseName() + "-" + e.getCourseCode()))
@@ -1792,6 +1795,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                         }
                         HtmlToPdfUtil.convert(cardLocalHtmlPath, cardLocalPdfPath, PageSizeEnum.A3);
                         specialSuccessMessage = "";
+                        courseCount = 1;
                         break;
                     case ONLY_PAPER: // 只下载试卷
                         for (ExamTaskPaperFileDto examTaskPaperFileDto : paperCellList) {
@@ -1809,6 +1813,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                             String paperLocalPath = filePath + paperName + examTaskPaperFileDto.getPaperSuffix();
                             String paperPath = examTaskPaperFileDto.getPaperPath();
                             fileStoreUtil.ossDownload(paperPath, paperLocalPath, fileStoreUtil.getUploadEnumByPath(paperPath).getFssType());
+                            courseCount = 1;
                         }
                         break;
                     case PAPER_AND_CARD: // 全部下载
@@ -1840,10 +1845,12 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                             String paperLocalPath = filePath + paperName + examTaskPaperFileDto.getPaperSuffix();
                             String paperPath = examTaskPaperFileDto.getPaperPath();
                             fileStoreUtil.ossDownload(paperPath, paperLocalPath, fileStoreUtil.getUploadEnumByPath(paperPath).getFssType());
+                            courseCount = 1;
                         }
-
+                        break;
                 }
             }
+            count = count + courseCount;
         }
         ZipUtil.zip(zipLocalRootPath, zipFile.getPath(), false);
         fileStoreUtil.ossUpload(dirNameTmp, zipFile, BinaryUtil.toBase64String(HexUtils.decodeHex(DigestUtils.md5Hex(new FileInputStream(zipFile)))), fileStoreUtil.getUploadEnumByPath(dirNameTmp).getFssType());
@@ -1854,7 +1861,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         tbTask.setResultFilePath(jsonObject.toJSONString());
         ConvertUtil.delFolder(zipLocalRootPath);
         zipFile.delete();
-        map.put("count", courseSet.size() + 1);
+        map.put("count", count);
         map.put("specialSuccessMessage", specialSuccessMessage);
         return map;
     }