|
@@ -527,14 +527,14 @@ public class CreatePdfUtil {
|
|
* @param attachmentIds
|
|
* @param attachmentIds
|
|
* @param studentContent
|
|
* @param studentContent
|
|
* @param t
|
|
* @param t
|
|
- * @param paperType
|
|
|
|
- * @param examCard
|
|
|
|
|
|
+ * @param examDetail
|
|
|
|
+ * @param examDetailCourse
|
|
* @param userId
|
|
* @param userId
|
|
* @param examStudentPdfList
|
|
* @param examStudentPdfList
|
|
* @return
|
|
* @return
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
- public BasicAttachment examStudentHtml(Set<Long> attachmentIds, String studentContent, ExamStudent t, String paperType, ExamCard examCard, Long userId, List<PdfDto> examStudentPdfList) throws IOException {
|
|
|
|
|
|
+ public BasicAttachment examStudentHtml(Set<Long> attachmentIds, String studentContent, ExamStudent t, ExamDetail examDetail, ExamDetailCourse examDetailCourse, Long userId, List<PdfDto> examStudentPdfList) throws IOException {
|
|
if (Objects.nonNull(t.getAttachmentId())) {
|
|
if (Objects.nonNull(t.getAttachmentId())) {
|
|
attachmentIds.add(t.getAttachmentId());
|
|
attachmentIds.add(t.getAttachmentId());
|
|
}
|
|
}
|
|
@@ -554,18 +554,27 @@ public class CreatePdfUtil {
|
|
}
|
|
}
|
|
studentHtml = studentHtml.replaceAll("\\$\\{examNumberStr\\}", t.getTicketNumber());
|
|
studentHtml = studentHtml.replaceAll("\\$\\{examNumberStr\\}", t.getTicketNumber());
|
|
//随机生成学生试卷条码并将图片转成base64
|
|
//随机生成学生试卷条码并将图片转成base64
|
|
- if (Objects.nonNull(paperType)) {
|
|
|
|
- studentHtml = studentHtml.replaceAll("\\$\\{paperType\\}", GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(paperType), false));
|
|
|
|
|
|
+ if (Objects.nonNull(examDetailCourse.getPaperType())) {
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{paperType\\}", GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(examDetailCourse.getPaperType()), false));
|
|
}
|
|
}
|
|
- studentHtml = studentHtml.replaceAll("\\$\\{paperTypeName\\}", paperType);
|
|
|
|
|
|
+ Map<String, Object> map = ConvertUtil.analyzeDateAndTime(examDetail.getExamStartTime(), examDetail.getExamEndTime());
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{examDate\\}", Objects.nonNull(map.get("date")) ? (String) map.get("date") : "");
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{examTime\\}", Objects.nonNull(map.get("time")) ? (String) map.get("time") : "");
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{ticketNumber\\}", t.getTicketNumber());
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{siteNumber\\}", t.getSiteNumber());
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{paperTypeName\\}", examDetailCourse.getPaperType());
|
|
studentHtml = studentHtml.replaceAll("\\$\\{studentCode\\}", t.getStudentCode());
|
|
studentHtml = studentHtml.replaceAll("\\$\\{studentCode\\}", t.getStudentCode());
|
|
studentHtml = studentHtml.replaceAll("\\$\\{studentName\\}", t.getStudentName());
|
|
studentHtml = studentHtml.replaceAll("\\$\\{studentName\\}", t.getStudentName());
|
|
- studentHtml = studentHtml.replaceAll("\\$\\{courseName\\}", examCard.getCourseName());
|
|
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{courseName\\}", examDetailCourse.getCourseName());
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{courseCode\\}", examDetailCourse.getCourseCode());
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{examPlace\\}", examDetail.getExamPlace());
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{examRoom\\}", examDetail.getExamRoom());
|
|
|
|
+ studentHtml = studentHtml.replaceAll("\\$\\{paperNumber\\}", examDetailCourse.getPaperNumber());
|
|
|
|
|
|
//学生题卡
|
|
//学生题卡
|
|
- BasicAttachment examStudentAttachment = basicAttachmentService.saveAttachmentHtml(examCard.getSchoolId() + "|" + examCard.getCourseCode() + "|" + t.getTicketNumber(), studentHtml, userId, examStudentPdfList);
|
|
|
|
|
|
+ BasicAttachment examStudentAttachment = basicAttachmentService.saveAttachmentHtml(examDetail.getSchoolId() + "|" + examDetailCourse.getCourseCode() + "|" + t.getTicketNumber(), studentHtml, userId, examStudentPdfList);
|
|
t.setAttachmentId(examStudentAttachment.getId());
|
|
t.setAttachmentId(examStudentAttachment.getId());
|
|
- t.setPaperType(paperType);
|
|
|
|
|
|
+ t.setPaperType(examDetailCourse.getPaperType());
|
|
return examStudentAttachment;
|
|
return examStudentAttachment;
|
|
}
|
|
}
|
|
|
|
|