|
@@ -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", "");
|
|
|
}
|