浏览代码

Merge branch 'dev' into release
update

wangliang 4 年之前
父节点
当前提交
6ce0bf41d6

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

@@ -237,7 +237,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                                 String studentContent = cardContent;
 
                                 for (int i = 1; i <= examPrintPlan.getBackupCount(); i++) {
-                                    basicAttachmentList.add(createPdfUtil.cardHtml(cardContent, paperType, examDetailCourse, examCard, jsonArray, sysUser.getId(), cardPdfTempList));
+                                    basicAttachmentList.add(createPdfUtil.cardHtml(cardContent, paperType, examDetail, examDetailCourse, examCard, jsonArray, sysUser.getId(), cardPdfTempList));
                                 }
                                 cardPdfList.addAll(cardPdfTempList);
 
@@ -541,7 +541,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             // 组装exam_student数据
             examDetailService.disposeExamStudentByExaminationExcel(dataList, userId);
 
-            map.put("examDetailIdList",examDetailIdList);
+            map.put("examDetailIdList", examDetailIdList);
             map.put("dataCount", dataList.size());
         } catch (Exception e) {
             redisTemplate.opsForValue().set(key, value);

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

@@ -460,7 +460,7 @@ public class CreatePdfUtil {
         studentHtml = studentHtml.replaceAll("\\$\\{paperType\\}", GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(paperType), false));
         studentHtml = studentHtml.replaceAll("\\$\\{paperTypeName\\}", paperType);
         studentHtml = studentHtml.replaceAll("\\$\\{studentCode\\}", t.getStudentCode());
-        studentHtml = studentHtml.replaceAll("\\$\\{name\\}", t.getStudentName());
+        studentHtml = studentHtml.replaceAll("\\$\\{studentName\\}", t.getStudentName());
         studentHtml = studentHtml.replaceAll("\\$\\{courseName\\}", examCard.getCourseName());
 
         //学生题卡
@@ -483,17 +483,17 @@ public class CreatePdfUtil {
      * @return
      * @throws IOException
      */
-    public BasicAttachment cardHtml(String cardContent, String paperType, ExamDetailCourse examDetailCourse, ExamCard examCard, JSONArray jsonArray, Long userId, List<PdfDto> cardPdfList) throws IOException {
+    public BasicAttachment cardHtml(String cardContent, String paperType, ExamDetail examDetail, ExamDetailCourse examDetailCourse, ExamCard examCard, JSONArray jsonArray, Long userId, List<PdfDto> cardPdfList) throws IOException {
         //通用题卡
         String cardTemp = cardContent;
         cardTemp = cardTemp.replaceAll("\\$\\{paperTypeName\\}", paperType);
         //随机生成试卷条码并将图片转成base64
         cardTemp = cardTemp.replaceAll("\\$\\{paperType\\}", GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(paperType), false));
         //通用题卡生成卷袋贴条码
-        String paperCode = examDetailCourse.getPaperNumber();
-        String paperCodeImg = GoogleBarCodeUtil.createBarCode(paperCode, false);
-        String paperCodeDiv = "<div class=\"page-box page-box-0\"><div class=\"package-number\" style=\"position: absolute;width: 200px;height: 40px;top: 80px;right: 35px;transform: rotate(-90deg);transform-origin: center right;text-align: center;z-index: 99;\"><img src=\"data:image/png;base64," + paperCodeImg + "\" style=\"display: block; height: 28px; width: 100%\" /><p style=\"line-height: 1; font-size: 12px; margin: 0;\">" + paperCode + "</p></div>";
-        cardTemp = cardTemp.replaceAll("<div class=\"page-box page-box-0\">", paperCodeDiv);
+        String packageCode = examDetail.getPackageCode();
+        String packageCodeImg = GoogleBarCodeUtil.createBarCode(packageCode, false);
+        String packageCodeDiv = "<div class=\"page-box page-box-0\"><div class=\"package-number\" style=\"position: absolute;width: 200px;height: 40px;top: 80px;right: 35px;transform: rotate(-90deg);transform-origin: center right;text-align: center;z-index: 99;\"><img src=\"data:image/png;base64," + packageCodeImg + "\" style=\"display: block; height: 28px; width: 100%\" /><p style=\"line-height: 1; font-size: 12px; margin: 0;\">" + packageCode + "</p></div>";
+        cardTemp = cardTemp.replaceAll("<div class=\"page-box page-box-0\">", packageCodeDiv);
         BasicAttachment cardAttachment = basicAttachmentService.saveAttachmentHtml(examCard.getSchoolId() + "|" + examCard.getCourseCode(), cardTemp, userId, cardPdfList);
         JSONObject object = new JSONObject();
         object.put("name", paperType);