|
@@ -1546,7 +1546,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void scoreReportDownload(MultipartFile file, HttpServletResponse response) {
|
|
|
+ public String scoreReportDownload(ArchiveStudentQuery query, MultipartFile file, HttpServletResponse response) {
|
|
|
+ MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(query.getExamId(), query.getPaperNumber());
|
|
|
String rootPath = null;
|
|
|
File htmlFile;
|
|
|
File pdfFile;
|
|
@@ -1581,7 +1582,13 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
pdfFile.createNewFile();
|
|
|
}
|
|
|
HtmlToPdfUtil.convert(cardHtmlPath, cardPdfPath, PageSizeEnum.A4);
|
|
|
- FileUtil.outputFile(response, pdfFile, "报告" + SystemConstant.PDF_PREFIX);
|
|
|
+ String fileName = markPaper.getId() + SystemConstant.PDF_PREFIX;
|
|
|
+ FilePathVo filePathVo = fileUploadService.uploadFile(pdfFile, UploadFileEnum.FILE, fileName);
|
|
|
+ if (filePathVo == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("报告下载失败");
|
|
|
+ }
|
|
|
+ return teachcloudCommonService.filePreview(JSON.toJSONString(filePathVo));
|
|
|
+// FileUtil.outputFile(response, pdfFile, "报告" + SystemConstant.PDF_PREFIX);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|
|
@@ -1589,6 +1596,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
ConvertUtil.delFolder(rootPath);
|
|
|
}
|
|
|
}
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
@Override
|