|
@@ -230,7 +230,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
examTaskDetail.setRelatePaperType(paperType);
|
|
|
|
|
|
//获取试卷pdf
|
|
|
- boolean tag = createPdfUtil.getPaperPdf(paperType, examTaskDetail, examPrintPlan.getBackupCount(), paperPdfTempList, backupPaperTempPdfList);
|
|
|
+ PdfDto pdfDto = createPdfUtil.getPaperPdf(paperType, examTaskDetail, examPrintPlan.getBackupCount(), paperPdfTempList, backupPaperTempPdfList);
|
|
|
+ examDetailCourse.setPaperPagesA3(pdfDto.getPageCount());
|
|
|
paperPdfList.addAll(paperPdfTempList);
|
|
|
backupPaperPdfList.addAll(backupPaperTempPdfList);
|
|
|
|
|
@@ -243,7 +244,9 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
String studentContent = cardContent;
|
|
|
|
|
|
for (int i = 1; i <= examPrintPlan.getBackupCount(); i++) {
|
|
|
- basicAttachmentList.add(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());
|
|
|
+ basicAttachmentList.add(basicAttachment);
|
|
|
}
|
|
|
cardPdfList.addAll(cardPdfTempList);
|
|
|
|
|
@@ -265,7 +268,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
if (Objects.nonNull(type) && Objects.equals(type.toUpperCase(), "SIGN")) {//签到表
|
|
|
createPdfUtil.createSignBook(basicAttachment, basicSchool.getName(), examDetail, examDetailCourse, examStudentList, variablePdfList, (Integer) jsonObjectVariable.get("backupCount"));
|
|
|
} else if (Objects.nonNull(type) && Objects.equals(type.toUpperCase(), "PACKAGE")) {//卷袋贴
|
|
|
- createPdfUtil.createPaperPackage(tag, basicAttachment, basicSchool.getName(), examDetail, examDetailCourse, examStudentList, variablePdfList, (Integer) jsonObjectVariable.get("backupCount"));
|
|
|
+ createPdfUtil.createPaperPackage(pdfDto.isTag(), basicAttachment, basicSchool.getName(), examDetail, examDetailCourse, examStudentList, variablePdfList, (Integer) jsonObjectVariable.get("backupCount"));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -288,13 +291,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
examCardDetailService.saveOrUpdateBatch(examCardDetailList);
|
|
|
}
|
|
|
examTaskDetailService.saveOrUpdateBatch(examTaskDetailList);
|
|
|
-
|
|
|
- Integer paperPageA3 = 0;
|
|
|
- Integer cardPageA3 = 0;
|
|
|
- paperPageA3 = paperPageA3 + paperPdfTempList.stream().mapToInt(PdfDto::getPageCount).sum() + backupPaperTempPdfList.stream().mapToInt(PdfDto::getPageCount).sum();
|
|
|
- cardPageA3 = cardPageA3 + examStudentTempPdfList.stream().mapToInt(PdfDto::getPageCount).sum() + cardPdfTempList.stream().mapToInt(PdfDto::getPageCount).sum();
|
|
|
- examDetailCourse.setPaperPagesA3(paperPageA3);
|
|
|
- examDetailCourse.setCardPagesA3(cardPageA3);
|
|
|
}
|
|
|
detailCourseService.saveOrUpdateBatch(examDetailCourseList);
|
|
|
//合并pdf
|
|
@@ -447,7 +443,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
|
|
|
Cell cell = row.getCell(index);
|
|
|
String cellValue = String.valueOf(ExcelUtil.convert(cell));
|
|
|
- if (cellValue == null || cellValue.length() < 1 || cellValue.equals("null")){
|
|
|
+ if (cellValue == null || cellValue.length() < 1 || cellValue.equals("null")) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("excel中第[" + (r + 1) + "]行,第[" + (index + 1) + "]列,字段[" + name + "]必填");
|
|
|
}
|
|
|
|