|
@@ -1644,6 +1644,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
@Override
|
|
|
public Map<String, Object> executeDownloadPaperFileBatch(Map<String, Object> map) throws Exception {
|
|
|
TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
|
|
|
+ String specialSuccessMessage = "";
|
|
|
DownloadPaperFileParam downloadPaperFileParam = (DownloadPaperFileParam) map.get("downloadPaperFileParam");
|
|
|
Long schoolId = tbTask.getSchoolId();
|
|
|
Long semesterId = downloadPaperFileParam.getSemesterId();
|
|
@@ -1691,37 +1692,17 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
InputStream in = new ByteArrayInputStream(outputStream.toByteArray());
|
|
|
|
|
|
String excelName = "试卷使用清单";
|
|
|
+ if (Objects.nonNull(paperFileDownloadExposureStatus)){
|
|
|
+ excelName = excelName + paperFileDownloadExposureStatus.getDesc();
|
|
|
+ }
|
|
|
+ String excelLocalPath = zipLocalRootPath + File.separator + excelName + "." + SystemConstant.XLSX;
|
|
|
+ convertUtil.saveLocal(in,excelLocalPath);
|
|
|
|
|
|
// 所有试卷信息
|
|
|
List<ExamTaskPaperFileDto> examTaskPaperFileDtoList = examTaskPaperDto.getExamTaskPaperFileDtoList();
|
|
|
if (examTaskPaperFileDtoList.size() == 0){
|
|
|
throw ExceptionResultEnum.ERROR.exception("没有找到任何试卷信息");
|
|
|
}
|
|
|
- String specialSuccessMessage = "";
|
|
|
- if (Objects.nonNull(paperFileDownloadExposureStatus)){
|
|
|
- switch (paperFileDownloadExposureStatus) {
|
|
|
- case EXPOSED_PAPER: // 曝光的
|
|
|
- excelName = excelName + "(" + paperFileDownloadExposureStatus.getDesc() + ")";
|
|
|
- examTaskPaperFileDtoList = examTaskPaperFileDtoList.stream().filter(ExamTaskPaperFileDto::getExposureStatus).collect(Collectors.toList());
|
|
|
- if (examTaskPaperFileDtoList.size() == 0){
|
|
|
- specialSuccessMessage = "所选择的命题任务中没有已曝光的试卷";
|
|
|
- }
|
|
|
- break;
|
|
|
- case UNEXPOSED_PAPER: // 未曝光的
|
|
|
- excelName = excelName + "(" + paperFileDownloadExposureStatus.getDesc() + ")";
|
|
|
- examTaskPaperFileDtoList = examTaskPaperFileDtoList.stream().filter(e -> !e.getExposureStatus()).collect(Collectors.toList());
|
|
|
- if (examTaskPaperFileDtoList.size() == 0){
|
|
|
- specialSuccessMessage = "所选择的命题任务中没有未曝光的试卷";
|
|
|
- }
|
|
|
- break;
|
|
|
- case ALL_PAPER: // 全部试卷
|
|
|
- excelName = excelName + "(" + paperFileDownloadExposureStatus.getDesc() + ")";
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- String excelLocalPath = zipLocalRootPath + File.separator + excelName + "." + SystemConstant.XLSX;
|
|
|
- convertUtil.saveLocal(in,excelLocalPath);
|
|
|
-
|
|
|
// 二级路径 课程
|
|
|
Set<String> courseSet = examTaskPaperFileDtoList.stream().map(e -> e.getCourseName() + "-" + e.getCourseCode()).collect(Collectors.toSet());
|
|
|
for (String course : courseSet) {
|
|
@@ -1768,6 +1749,26 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
String cardLocalHtmlPath = filePath + cardName + SystemConstant.HTML_PREFIX;
|
|
|
String cardLocalPdfPath = filePath + cardName + SystemConstant.PDF_PREFIX;
|
|
|
|
|
|
+ // 试卷文件曝光度筛选
|
|
|
+ if (Objects.nonNull(paperFileDownloadExposureStatus)){
|
|
|
+ switch (paperFileDownloadExposureStatus) {
|
|
|
+ case EXPOSED_PAPER: // 曝光的
|
|
|
+ paperCellList = paperCellList.stream().filter(ExamTaskPaperFileDto::getExposureStatus).collect(Collectors.toList());
|
|
|
+ if (paperCellList.size() == 0){
|
|
|
+ specialSuccessMessage = "所选择的命题任务中没有已曝光的试卷";
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case UNEXPOSED_PAPER: // 未曝光的
|
|
|
+ paperCellList = paperCellList.stream().filter(e -> !e.getExposureStatus()).collect(Collectors.toList());
|
|
|
+ if (paperCellList.size() == 0){
|
|
|
+ specialSuccessMessage = "所选择的命题任务中没有未曝光的试卷";
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ALL_PAPER: // 全部试卷
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (Objects.isNull(paperFileDownloadContent)){
|
|
|
continue;
|
|
|
}
|