|
@@ -55,13 +55,16 @@ import com.qmth.teachcloud.mark.params.MarkHeaderResult;
|
|
|
import com.qmth.teachcloud.mark.service.*;
|
|
|
import com.qmth.teachcloud.mark.utils.BatchGetDataUtil;
|
|
|
import com.qmth.teachcloud.mark.utils.Calculator;
|
|
|
+import com.qmth.teachcloud.mark.utils.FileStoreUtils;
|
|
|
import com.qmth.teachcloud.mark.utils.ScoreCalculateUtil;
|
|
|
+import org.apache.commons.codec.digest.DigestUtils;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
import org.apache.poi.ss.usermodel.FillPatternType;
|
|
|
import org.apache.poi.ss.usermodel.IndexedColors;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.FileCopyUtils;
|
|
@@ -155,6 +158,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
@Resource
|
|
|
CommonCacheService commonCacheService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FileStoreUtils fileStoreUtils;
|
|
|
+
|
|
|
@Override
|
|
|
public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
|
|
|
MarkStudentQuery markStudentQuery = new MarkStudentQuery();
|
|
@@ -1582,7 +1588,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void scoreReportDownload(MultipartFile file, HttpServletResponse response) {
|
|
|
+ public String scoreReportDownload(ArchiveStudentQuery query,MultipartFile file, HttpServletResponse response) {
|
|
|
String rootPath = null;
|
|
|
File htmlFile;
|
|
|
File pdfFile;
|
|
@@ -1617,7 +1623,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
pdfFile.createNewFile();
|
|
|
}
|
|
|
HtmlToPdfUtil.convert(cardHtmlPath, cardPdfPath, PageSizeEnum.A4);
|
|
|
- FileUtil.outputFile(response, pdfFile, "报告" + SystemConstant.PDF_PREFIX);
|
|
|
+ String md5 = DigestUtils.md5Hex(new FileInputStream(pdfFile));
|
|
|
+ String path = UploadFileEnum.PDF.getPath(UploadFileEnum.PDF.getTitle(), query.getExamId(), query.getPaperNumber(), FormatType.PDF.name().toLowerCase());
|
|
|
+ String uploadPath = fileStoreUtils.uploadFile(new FileInputStream(pdfFile), md5, UploadFileEnum.PDF, path);
|
|
|
+ return uploadPath;
|
|
|
+// FileUtil.outputFile(response, pdfFile, "报告" + SystemConstant.PDF_PREFIX);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|
|
@@ -1625,6 +1635,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
ConvertUtil.delFolder(rootPath);
|
|
|
}
|
|
|
}
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
@Override
|