|
@@ -237,12 +237,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
String paperType = Objects.nonNull(paperTypeParam) ? paperTypeParam : createPdfUtil.getPaperType(examPrintPlan, examTaskDetail, examDetail, examDetailCourse);
|
|
String paperType = Objects.nonNull(paperTypeParam) ? paperTypeParam : createPdfUtil.getPaperType(examPrintPlan, examTaskDetail, examDetail, examDetailCourse);
|
|
examTaskDetail.setRelatePaperType(paperType);
|
|
examTaskDetail.setRelatePaperType(paperType);
|
|
|
|
|
|
- //获取试卷pdf
|
|
|
|
- PdfDto pdfDto = createPdfUtil.getPaperPdf(paperType, examTaskDetail, examPrintPlan.getBackupCount(), paperPdfTempList, backupPaperTempPdfList);
|
|
|
|
- examDetailCourse.setPaperPagesA3(Objects.nonNull(pdfDto) ? pdfDto.getPageCount() : examDetailCourse.getPaperPagesA3());
|
|
|
|
- paperPdfList.addAll(paperPdfTempList);
|
|
|
|
- backupPaperPdfList.addAll(backupPaperTempPdfList);
|
|
|
|
-
|
|
|
|
basicAttachmentList = Objects.isNull(basicAttachmentList) ? basicAttachmentList = new ArrayList<>() : basicAttachmentList;
|
|
basicAttachmentList = Objects.isNull(basicAttachmentList) ? basicAttachmentList = new ArrayList<>() : basicAttachmentList;
|
|
for (ExamCardDetail examCardDetail : examCardDetailList) {
|
|
for (ExamCardDetail examCardDetail : examCardDetailList) {
|
|
createPdfUtil.getCardAttachmentId(examCardDetail, attachmentIds);
|
|
createPdfUtil.getCardAttachmentId(examCardDetail, attachmentIds);
|
|
@@ -251,7 +245,15 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
String cardContent = createPdfUtil.replaceHtmlTemplete(examCardDetail);
|
|
String cardContent = createPdfUtil.replaceHtmlTemplete(examCardDetail);
|
|
String studentContent = cardContent;
|
|
String studentContent = cardContent;
|
|
|
|
|
|
|
|
+ PdfDto pdfDto = null;
|
|
for (int i = 1; i <= examPrintPlan.getBackupCount(); i++) {
|
|
for (int i = 1; i <= examPrintPlan.getBackupCount(); i++) {
|
|
|
|
+ //获取试卷pdf
|
|
|
|
+ pdfDto = createPdfUtil.getPaperPdf(paperType, examTaskDetail, examPrintPlan.getBackupCount(), paperPdfTempList, backupPaperTempPdfList);
|
|
|
|
+ examDetailCourse.setPaperPagesA3(Objects.nonNull(pdfDto) ? pdfDto.getPageCount() : examDetailCourse.getPaperPagesA3());
|
|
|
|
+ paperPdfList.addAll(paperPdfTempList);
|
|
|
|
+ backupPaperPdfList.addAll(backupPaperTempPdfList);
|
|
|
|
+
|
|
|
|
+ //获取题卡
|
|
BasicAttachment basicAttachment = createPdfUtil.cardHtml(String.format("%02d", i), cardContent, paperType, examDetail, examDetailCourse, examCard, jsonArray, sysUser.getId(), cardPdfTempList);
|
|
BasicAttachment basicAttachment = createPdfUtil.cardHtml(String.format("%02d", i), cardContent, paperType, examDetail, examDetailCourse, examCard, jsonArray, sysUser.getId(), cardPdfTempList);
|
|
examDetailCourse.setCardPagesA3(basicAttachment.getPages());
|
|
examDetailCourse.setCardPagesA3(basicAttachment.getPages());
|
|
basicAttachmentList.add(basicAttachment);
|
|
basicAttachmentList.add(basicAttachment);
|
|
@@ -662,7 +664,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
|
|
|
// 处理试卷样品
|
|
// 处理试卷样品
|
|
List<Map> paperInfo = JSONObject.parseArray(examTaskDetail.getPaperAttachmentIds(), Map.class);
|
|
List<Map> paperInfo = JSONObject.parseArray(examTaskDetail.getPaperAttachmentIds(), Map.class);
|
|
- if (Objects.isNull(paperInfo)){
|
|
|
|
|
|
+ if (Objects.isNull(paperInfo)) {
|
|
throw ExceptionResultEnum.ERROR.exception("试卷信息不存在");
|
|
throw ExceptionResultEnum.ERROR.exception("试卷信息不存在");
|
|
}
|
|
}
|
|
System.out.println("paperInfo = " + JSON.toJSONString(paperInfo));
|
|
System.out.println("paperInfo = " + JSON.toJSONString(paperInfo));
|
|
@@ -746,7 +748,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
}
|
|
}
|
|
FileCopyUtils.copy(bytes, localFile);
|
|
FileCopyUtils.copy(bytes, localFile);
|
|
}
|
|
}
|
|
- count ++;
|
|
|
|
|
|
+ count++;
|
|
}
|
|
}
|
|
ZipUtil.zip(zipLocalRootPath, zipFile.getPath(), true);
|
|
ZipUtil.zip(zipLocalRootPath, zipFile.getPath(), true);
|
|
ossUtil.ossUpload(dirNameTmp, zipFile, BinaryUtil.toBase64String(HexUtils.decodeHex(DigestUtils.md5Hex(new FileInputStream(zipFile)))));
|
|
ossUtil.ossUpload(dirNameTmp, zipFile, BinaryUtil.toBase64String(HexUtils.decodeHex(DigestUtils.md5Hex(new FileInputStream(zipFile)))));
|