wangliang 4 vuotta sitten
vanhempi
commit
0a73631dbe

+ 10 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePdfUtil.java

@@ -105,9 +105,16 @@ public class CreatePdfUtil {
         }
         Map<String, Object> htmlMap = new HashMap<>();
         if (Objects.nonNull(examStudentList) && examStudentList.size() > 0) {
-            htmlMap.put("examDetailCourseId", examStudentList.get(0).getExamDetailCourseId());
-            htmlMap.put("courseName", examStudentList.get(0).getCourseName());
-            htmlMap.put("courseCode", examStudentList.get(0).getCourseCode());
+            Set<Long> examDetailCourseIds = new HashSet<>();
+            Set<String> courseCodes = new HashSet<>(), courseNames = new HashSet<>();
+            for (ExamStudentCourseDto examStudentCourseDto : examStudentList) {
+                examDetailCourseIds.add(examStudentCourseDto.getExamDetailCourseId());
+                courseCodes.add(examStudentCourseDto.getCourseCode());
+                courseNames.add(examStudentCourseDto.getCourseName());
+            }
+            htmlMap.put("examDetailCourseId", StringUtils.join(examDetailCourseIds, ", "));
+            htmlMap.put("courseName", String.join(", ", courseNames));
+            htmlMap.put("courseCode", String.join(", ", courseCodes));
         } else {
             htmlMap.put("examDetailCourseId", "");
             htmlMap.put("courseName", "");