wangliang %!s(int64=4) %!d(string=hai) anos
pai
achega
2b347fb2a4

+ 6 - 8
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -27,7 +27,6 @@ import com.qmth.distributed.print.common.util.HexUtils;
 import com.qmth.distributed.print.common.util.ResultUtil;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.time.DateUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
@@ -331,13 +330,14 @@ public class TaskLogicServiceImpl implements TaskLogicService {
      * @param examDetail
      * @param basicSchool
      * @param ftlList
-     * @param examDetailCourseListIds
+     * @param examDetailCourseList
      * @param list
      * @throws IOException
      * @throws DocumentException
      */
     @Transactional
-    public void createA4File(ExamPrintPlan examPrintPlan, ExamDetail examDetail, BasicSchool basicSchool, Set<File> ftlList, List<Long> examDetailCourseListIds, List<PdfDto>... list) throws IOException, DocumentException {
+    public void createA4File(ExamPrintPlan examPrintPlan, ExamDetail examDetail, BasicSchool basicSchool, Set<File> ftlList, List<ExamDetailCourse> examDetailCourseList, List<PdfDto>... list) throws IOException, DocumentException {
+        List<Long> examDetailCourseListIds = examDetailCourseList.stream().map(s -> s.getId()).collect(Collectors.toList());
         if (Objects.nonNull(examPrintPlan.getOrdinaryContent())) {
             //获取普通印品
             JSONArray jsonArrayOrdinary = JSONArray.parseArray(examPrintPlan.getOrdinaryContent());
@@ -366,9 +366,9 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     BasicAttachment basicAttachment = basicAttachmentService.getById(attachmentId);
                     ftlList.add(commonService.getFile(basicAttachment.getPath(), false));
                     if (Objects.nonNull(type) && Objects.equals(type.toUpperCase(), "SIGN")) {//签到表
-                        createPdfUtil.createSignBook(basicAttachment, basicSchool.getName(), examDetail, examStudentCourseDtoList, list[1], (Integer) jsonObjectVariable.get("backupCount"));
+                        createPdfUtil.createSignBook(basicAttachment, basicSchool.getName(), examDetail, examStudentCourseDtoList, list[1], (Integer) jsonObjectVariable.get("backupCount"), examDetailCourseList);
                     } else if (Objects.nonNull(type) && Objects.equals(type.toUpperCase(), "PACKAGE")) {//卷袋贴
-                        createPdfUtil.createPaperPackage(tag, basicAttachment, basicSchool.getName(), examDetail, examStudentCourseDtoList, list[1], (Integer) jsonObjectVariable.get("backupCount"));
+                        createPdfUtil.createPaperPackage(tag, basicAttachment, basicSchool.getName(), examDetail, examStudentCourseDtoList, list[1], (Integer) jsonObjectVariable.get("backupCount"), examDetailCourseList);
                     }
                 }
             }
@@ -438,8 +438,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     examDetailCourseQueryWrapper.lambda().eq(ExamDetailCourse::getExamDetailId, examDetail.getId());
                 }
                 List<ExamDetailCourse> examDetailCourseList = detailCourseService.list(examDetailCourseQueryWrapper);
-                List<Long> examDetailCourseListIds = examDetailCourseList.stream().map(s -> s.getId()).collect(Collectors.toList());
-
                 List<PdfDto> variablePdfList = new ArrayList<>();//变量印品(签到表、卷袋贴)
                 List<PdfDto> ordinaryPdfList = new ArrayList<>();//普通印品(登记表)
                 List<PdfDto> paperPdfList = new ArrayList<>();//所有试卷
@@ -460,7 +458,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                         paperPdfList,
                         examStudentPdfList);
 
-                createA4File(examPrintPlan, examDetail, basicSchool, ftlList, examDetailCourseListIds, ordinaryPdfList, variablePdfList);
+                createA4File(examPrintPlan, examDetail, basicSchool, ftlList, examDetailCourseList, ordinaryPdfList, variablePdfList);
 
                 //合并pdf
                 String dirNameA3 = createPdfUtil.mergeA3Pdf(paperPdfList, examStudentPdfList, backupPaperPdfList, cardPdfList);

+ 14 - 24
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePdfUtil.java

@@ -97,26 +97,22 @@ public class CreatePdfUtil {
      * @param examStudentList
      * @param variablePdfList
      * @param printCount
+     * @param examDetailCourseList
      * @throws IOException
      */
-    public void createPaperPackage(boolean tag, BasicAttachment basicAttachment, String schoolName, ExamDetail examDetail, List<ExamStudentCourseDto> examStudentList, List<PdfDto> variablePdfList, Integer printCount) throws IOException {
+    public void createPaperPackage(boolean tag, BasicAttachment basicAttachment, String schoolName, ExamDetail examDetail, List<ExamStudentCourseDto> examStudentList, List<PdfDto> variablePdfList, Integer printCount, List<ExamDetailCourse> examDetailCourseList) throws IOException {
         if (Objects.isNull(basicAttachment)) {
             throw ExceptionResultEnum.ATTACHMENT_IS_NULL.exception();
         }
         Map<String, Object> htmlMap = new HashMap<>();
-        if (Objects.nonNull(examStudentList) && examStudentList.size() > 0) {
-            Set<Long> examDetailCourseIds = new HashSet<>();
-            Set<String> courseCodes = new HashSet<>(), courseNames = new HashSet<>();
-            for (ExamStudentCourseDto examStudentCourseDto : examStudentList) {
-                examDetailCourseIds.add(examStudentCourseDto.getExamDetailCourseId());
-                courseCodes.add(examStudentCourseDto.getPaperNumber());
-                courseNames.add(examStudentCourseDto.getCourseName());
-            }
-            htmlMap.put("examDetailCourseId", StringUtils.join(examDetailCourseIds, ", "));
+        if (Objects.nonNull(examDetailCourseList) && examDetailCourseList.size() > 0) {
+//            Set<Long> examDetailCourseIds = new HashSet<>();
+//            htmlMap.put("examDetailCourseId", StringUtils.join(examDetailCourseIds, ", "));
+            Set<String> paperNumbers = examDetailCourseList.stream().map(s -> s.getPaperNumber()).collect(Collectors.toSet());
+            Set<String> courseNames = examDetailCourseList.stream().map(s -> s.getCourseName()).collect(Collectors.toSet());
             htmlMap.put("courseName", String.join(", ", courseNames));
-            htmlMap.put("courseCode", String.join(", ", courseCodes));
+            htmlMap.put("courseCode", String.join(", ", paperNumbers));
         } else {
-            htmlMap.put("examDetailCourseId", "");
             htmlMap.put("courseName", "");
             htmlMap.put("courseCode", "");
         }
@@ -207,25 +203,19 @@ public class CreatePdfUtil {
      * @param examStudentList
      * @param variablePdfList
      * @param printCount
+     * @param examDetailCourseList
      */
-    public void createSignBook(BasicAttachment basicAttachment, String schoolName, ExamDetail examDetail, List<ExamStudentCourseDto> examStudentList, List<PdfDto> variablePdfList, Integer printCount) throws IOException {
+    public void createSignBook(BasicAttachment basicAttachment, String schoolName, ExamDetail examDetail, List<ExamStudentCourseDto> examStudentList, List<PdfDto> variablePdfList, Integer printCount, List<ExamDetailCourse> examDetailCourseList) throws IOException {
         if (Objects.isNull(basicAttachment)) {
             throw ExceptionResultEnum.ATTACHMENT_IS_NULL.exception();
         }
         Map<String, Object> htmlMap = new HashMap<>();
-        if (Objects.nonNull(examStudentList) && examStudentList.size() > 0) {
-            Set<Long> examDetailCourseIds = new HashSet<>();
-            Set<String> courseCodes = new HashSet<>(), courseNames = new HashSet<>();
-            for (ExamStudentCourseDto examStudentCourseDto : examStudentList) {
-                examDetailCourseIds.add(examStudentCourseDto.getExamDetailCourseId());
-                courseCodes.add(examStudentCourseDto.getPaperNumber());
-                courseNames.add(examStudentCourseDto.getCourseName());
-            }
-            htmlMap.put("examDetailCourseId", StringUtils.join(examDetailCourseIds, ", "));
+        if (Objects.nonNull(examDetailCourseList) && examDetailCourseList.size() > 0) {
+            Set<String> paperNumbers = examDetailCourseList.stream().map(s -> s.getPaperNumber()).collect(Collectors.toSet());
+            Set<String> courseNames = examDetailCourseList.stream().map(s -> s.getCourseName()).collect(Collectors.toSet());
             htmlMap.put("courseName", String.join(", ", courseNames));
-            htmlMap.put("courseCode", String.join(", ", courseCodes));
+            htmlMap.put("courseCode", String.join(", ", paperNumbers));
         } else {
-            htmlMap.put("examDetailCourseId", "");
             htmlMap.put("courseName", "");
             htmlMap.put("courseCode", "");
         }

+ 0 - 75
hs_err_pid8534.log

@@ -1,75 +0,0 @@
-#
-# A fatal error has been detected by the Java Runtime Environment:
-#
-#  SIGBUS (0xa) at pc=0x00000001003e6b90, pid=8534, tid=0x000000000000d903
-#
-# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
-# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode bsd-amd64 compressed oops)
-# Problematic frame:
-# V  [libjvm.dylib+0xdbb90]
-#
-# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
-#
-# If you would like to submit a bug report, please visit:
-#   http://bugreport.java.com/bugreport/crash.jsp
-#
-
----------------  T H R E A D  ---------------
-
-Current thread (0x00007f868077a000):  JavaThread "taskThreadPool2" [_thread_in_vm, id=55555, stack(0x0000700014367000,0x0000700014467000)]
-
-siginfo: si_signo: 10 (SIGBUS), si_code: 2 (BUS_ADRERR), si_addr: 0x000000012589657c
-
-Registers:
-RAX=0x0000000125896594, RBX=0x0000000000000010, RCX=0x000000079e5905f0, RDX=0x0000000000000000
-RSP=0x0000700014465148, RBP=0x0000700014465190, RSI=0x000000079e5905d8, RDI=0x000000012589657c
-R8 =0x0000000000000009, R9 =0x0000000000000010, R10=0x000000010d829ba7, R11=0x000000010d841ac0
-R12=0x0000000000000000, R13=0x00007f868077a000, R14=0x00007000144651c0, R15=0x000000012589657c
-RIP=0x00000001003e6b90, EFLAGS=0x0000000000010257, ERR=0x0000000000000004
-  TRAPNO=0x000000000000000e
-
-Top of Stack: (sp=0x0000700014465148)
-0x0000700014465148:   000000010088e23d 00007000144651e0
-0x0000700014465158:   00007f868077a000 00007f868077a000
-0x0000700014465168:   0000000000000024 0000000000000000
-0x0000700014465178:   0000700014465298 0000700014465360
-0x0000700014465188:   00007f868077a000 00007000144651e0
-0x0000700014465198:   000000010d829c21 0000000000000024
-0x00007000144651a8:   000000074008ec40 0000000000000000
-0x00007000144651b8:   00000001003ad650 000000079e5905c8
-0x00007000144651c8:   00007f868077a000 0000700014465378
-0x00007000144651d8:   0000000125657998 0000700014465320
-0x00007000144651e8:   000000010d841b54 00007f8683037c70
-0x00007000144651f8:   00000001003ad650 0000000125656708
-0x0000700014465208:   00000001256566b8 00007000144653b8
-0x0000700014465218:   0000000325656708 000000079e58fa10
-0x0000700014465228:   00007f868077a000 0000000000000003
-0x0000700014465238:   000000079e58fa10 0000000000000010
-0x0000700014465248:   000000012589657c 0000000000000024
-0x0000700014465258:   0000000000000024 000000079e5905c8
-0x0000700014465268:   0000000000000000 0000000000000010
-0x0000700014465278:   00007f868077a000 0000700014465320
-0x0000700014465288:   000000010d42633d 000000010d42633d
-0x0000700014465298:   0000000000000024 00007000144652e0
-0x00007000144652a8:   0000000000000000 0000700014465320
-0x00007000144652b8:   0000000000000010 0000700014465320
-0x00007000144652c8:   000000079e5905c8 000000012589657c
-0x00007000144652d8:   000000079e5867e0 00007000144652e0
-0x00007000144652e8:   0000000106c99ff5 0000700014465360
-0x00007000144652f8:   0000000106c9d7b0 0000000000000000
-0x0000700014465308:   0000000106c9a028 0000700014465298
-0x0000700014465318:   0000700014465348 00007000144653a8
-0x0000700014465328:   000000010d4260c0 0000000000000051
-0x0000700014465338:   00000000000275cd 000000000002757c 
-
-Instructions: (pc=0x00000001003e6b90)
-0x00000001003e6b70:   48 8b 74 d0 08 48 89 74 d1 08 48 83 c2 01 75 f0
-0x00000001003e6b80:   49 f7 c0 01 00 00 00 74 06 8b 70 08 89 71 08 c3
-0x00000001003e6b90:   48 8b 74 d0 e8 48 89 74 d1 e8 48 8b 74 d0 f0 48
-0x00000001003e6ba0:   89 74 d1 f0 48 8b 74 d0 f8 48 89 74 d1 f8 48 8b 
-
-Register to memory mapping:
-
-RAX=0x0000000125896594 is an unknown value
-RBX=0x0000000000000010 is an unknown value
-RCX=0x000000079e5905f0 is an oop

+ 0 - 1
test

@@ -1 +0,0 @@
-test