|
@@ -82,7 +82,7 @@ public class CreatePdfUtil {
|
|
|
ordinaryPdfList.add(new PdfDto(localFile.getPath(), PageSizeEnum.A4, pageCount));
|
|
|
}
|
|
|
} else {
|
|
|
- basicAttachmentService.saveAttachmentPdf(basicAttachment, ordinaryPdfList, printCount);
|
|
|
+ basicAttachmentService.saveAttachmentPdf(basicAttachment, ordinaryPdfList, printCount, 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -152,7 +152,6 @@ public class CreatePdfUtil {
|
|
|
return 0;
|
|
|
}
|
|
|
}).get().getSiteNumber();
|
|
|
- minSite = Objects.isNull(minSite) ? "" : minSite;
|
|
|
|
|
|
String maxSite = examStudentList.stream().max((a, b) -> {
|
|
|
if (Objects.nonNull(a.getSiteNumber()) && Objects.nonNull(a.getSiteNumber())) {
|
|
@@ -161,17 +160,17 @@ public class CreatePdfUtil {
|
|
|
return 0;
|
|
|
}
|
|
|
}).get().getSiteNumber();
|
|
|
- maxSite = Objects.isNull(maxSite) ? "" : maxSite;
|
|
|
|
|
|
htmlMap.put("minSite", minSite);
|
|
|
htmlMap.put("maxSite", maxSite);
|
|
|
htmlMap.put("studentCount", examStudentList.size());
|
|
|
|
|
|
- htmlMap.put("tag", tag ? "订" : "");
|
|
|
+ htmlMap.put("tag", tag ? "订" : null);
|
|
|
|
|
|
htmlMap.computeIfAbsent("basicAttachment", v -> basicAttachment);
|
|
|
htmlMap.computeIfAbsent("variablePdfList", v -> variablePdfList);
|
|
|
htmlMap.computeIfAbsent("printCount", v -> printCount);
|
|
|
+ htmlMap.computeIfAbsent("sequence", v -> 1);
|
|
|
freemarkerUtil.createPaperPackage(htmlMap);
|
|
|
}
|
|
|
|
|
@@ -244,11 +243,13 @@ public class CreatePdfUtil {
|
|
|
for (int j = 0; j < htmlTableCount; j++) {
|
|
|
ExamStudentDto examStudentDto = gson.fromJson(gson.toJson(subStudents.get(j)), ExamStudentDto.class);
|
|
|
examStudentDto.setIndex(j + 1);
|
|
|
+ examStudentDto.setExtendFields(getClassName(examStudentDto.getExtendFields()));
|
|
|
examStudentList1.add(examStudentDto);
|
|
|
}
|
|
|
for (int j = htmlTableCount; j < subStudents.size(); j++) {
|
|
|
ExamStudentDto examStudentDto = gson.fromJson(gson.toJson(subStudents.get(j)), ExamStudentDto.class);
|
|
|
examStudentDto.setIndex(j + 1);
|
|
|
+ examStudentDto.setExtendFields(getClassName(examStudentDto.getExtendFields()));
|
|
|
examStudentList2.add(examStudentDto);
|
|
|
}
|
|
|
if (examStudentList1.size() > examStudentList2.size()) {
|
|
@@ -265,6 +266,7 @@ public class CreatePdfUtil {
|
|
|
htmlMap.computeIfAbsent("basicAttachment", v -> basicAttachment);
|
|
|
htmlMap.computeIfAbsent("variablePdfList", v -> variablePdfList);
|
|
|
htmlMap.computeIfAbsent("printCount", v -> printCount);
|
|
|
+ htmlMap.computeIfAbsent("sequence", v -> 2);
|
|
|
freemarkerUtil.createSignBook(htmlMap);
|
|
|
}
|
|
|
|
|
@@ -513,4 +515,20 @@ public class CreatePdfUtil {
|
|
|
jsonArray.add(object);
|
|
|
return cardAttachment;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取班级名称
|
|
|
+ *
|
|
|
+ * @param extendCloumn
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String getClassName(String extendCloumn) {
|
|
|
+ List<Map> mapList = JSONObject.parseArray(extendCloumn, Map.class);
|
|
|
+ for (Map map : mapList) {
|
|
|
+ if (Objects.equals("className", map.get("code").toString())) {
|
|
|
+ return map.get("value").toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|