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