Explorar o código

Merge branch 'dev' of http://git.qmth.com.cn/wangliang/distributed-print-service into dev

xiaof %!s(int64=4) %!d(string=hai) anos
pai
achega
87ca27fb8a

+ 3 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/OrgCenterDataDisposeService.java

@@ -1,5 +1,7 @@
 package com.qmth.distributed.print.business.service;
 
+import org.springframework.scheduling.annotation.Async;
+
 import java.io.IOException;
 
 /**
@@ -9,5 +11,6 @@ import java.io.IOException;
  */
 public interface OrgCenterDataDisposeService {
 
+    @Async
     void updateSchoolInfo() throws IOException;
 }

+ 12 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePdfUtil.java

@@ -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));

+ 1 - 1
distributed-print/src/main/resources/application.properties

@@ -80,7 +80,7 @@ prefix.url.basic=admin/basic
 prefix.url.exam=admin/exam
 prefix.url.data=admin/data
 prefix.url.work=admin/work
-prefix.url.client=client
+prefix.url.client=admin/client
 
 #\u65E5\u5FD7\u914D\u7F6E
 com.qmth.logging.root-level=info