|
@@ -67,6 +67,9 @@ public class CreatePdfUtil {
|
|
|
* @param printCount
|
|
|
*/
|
|
|
public void createCheckIn(BasicAttachment basicAttachment, List<PdfDto> ordinaryPdfList, Integer printCount) throws IOException, DocumentException {
|
|
|
+ if (Objects.isNull(basicAttachment)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("找不到附件");
|
|
|
+ }
|
|
|
String type = basicAttachment.getType();
|
|
|
JSONObject jsonObject = JSONObject.parseObject(basicAttachment.getPath());
|
|
|
if (Objects.nonNull(type) && Objects.equals(type, SystemConstant.PDF_PREFIX)) {
|
|
@@ -94,6 +97,9 @@ public class CreatePdfUtil {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public void createPaperPackage(BasicAttachment basicAttachment, String schoolName, ExamDetailCourse examDetailCourse, List<ExamStudent> examStudentList, List<PdfDto> variablePdfList, Integer printCount) throws IOException {
|
|
|
+ if (Objects.isNull(basicAttachment)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("找不到附件");
|
|
|
+ }
|
|
|
Map<String, Object> htmlMap = new HashMap<>();
|
|
|
htmlMap.put("examDetailCourseId", examDetailCourse.getId());
|
|
|
htmlMap.put("schoolName", schoolName);
|
|
@@ -135,6 +141,9 @@ public class CreatePdfUtil {
|
|
|
* @param printCount
|
|
|
*/
|
|
|
public void createSignBook(BasicAttachment basicAttachment, String schoolName, ExamDetailCourse examDetailCourse, List<ExamStudent> examStudentList, List<PdfDto> variablePdfList, Integer printCount) throws IOException {
|
|
|
+ if (Objects.isNull(basicAttachment)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("找不到附件");
|
|
|
+ }
|
|
|
Map<String, Object> htmlMap = new HashMap<>();
|
|
|
htmlMap.put("examDetailCourseId", examDetailCourse.getId());
|
|
|
htmlMap.put("schoolName", schoolName);
|
|
@@ -250,6 +259,9 @@ public class CreatePdfUtil {
|
|
|
if (Objects.nonNull(object.get("attachmentId"))) {
|
|
|
Long attachmentId = Long.parseLong((String) (object.get("attachmentId")));
|
|
|
BasicAttachment basicAttachment = basicAttachmentService.getById(attachmentId);
|
|
|
+ if (Objects.isNull(basicAttachment)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("找不到附件");
|
|
|
+ }
|
|
|
File file = commonService.getFile(basicAttachment.getPath(), false);
|
|
|
int pageCount = PdfUtil.addPdfPage(file);
|
|
|
pdfList[0].add(new PdfDto(file.getPath(), PageSizeEnum.A3, pageCount));
|