Browse Source

3.3.0 fix

xiaofei 1 năm trước cách đây
mục cha
commit
cf37dd376e

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

@@ -1167,7 +1167,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     public void resetExamDetail(Long entityId, CreatePdfTypeEnum type, ExamDetailStatusEnum status, boolean clearPaperType) {
         // 清掉客户端产生的数据,包含缓存状态、校验状态
         ExamDetail examDetail = this.getById(entityId);
-        if (CreatePdfTypeEnum.ALL.equals(type) || CreatePdfTypeEnum.PAPER.equals(type) || CreatePdfTypeEnum.CARD.equals(type)) {
+        if (CreatePdfTypeEnum.ALL.equals(type) || CreatePdfTypeEnum.PAPER.equals(type) || CreatePdfTypeEnum.CARD_A3.equals(type)) {
             QueryWrapper<ClientStatus> clientStatusQueryWrapper = new QueryWrapper<>();
             clientStatusQueryWrapper.lambda().eq(ClientStatus::getSchoolId, examDetail.getSchoolId())
                     .eq(ClientStatus::getExamDetailId, entityId);
@@ -1190,7 +1190,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             if (CreatePdfTypeEnum.ALL.equals(type) || CreatePdfTypeEnum.PAPER.equals(type)) {
                 lambdaUpdateWrapper.set(ExamDetail::getAttachmentId, null);
             }
-            if (CreatePdfTypeEnum.ALL.equals(type) || CreatePdfTypeEnum.CARD.equals(type)) {
+            if (CreatePdfTypeEnum.ALL.equals(type) || CreatePdfTypeEnum.CARD_A3.equals(type)) {
                 lambdaUpdateWrapper.set(ExamDetail::getCardAttachmentId, null);
             }
             if (CreatePdfTypeEnum.ALL.equals(type)) {

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

@@ -333,7 +333,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
 
             // 题卡数据组装
             basicAttachmentList = Objects.isNull(basicAttachmentList) ? new ArrayList<>() : basicAttachmentList;
-            if ((CreatePdfTypeEnum.ALL.equals(createPdfType) || CreatePdfTypeEnum.CARD.equals(createPdfType)) && printContent.contains("CARD")) {
+            if ((CreatePdfTypeEnum.ALL.equals(createPdfType) || CreatePdfTypeEnum.CARD_A3.equals(createPdfType)) && printContent.contains("CARD")) {
                 Map<String, ExamCard> examCardDetailMap = new HashMap<>();
                 Map<String, String> cardContentMap = new HashMap<>();
                 for (String s : examDetailCourse.getPaperType().split(",")) {

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

@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.qmth.boot.tools.models.ByteArray;
 import com.qmth.distributed.print.business.bean.createPdf.PrintPathVo;
 import com.qmth.distributed.print.business.bean.dto.*;
+import com.qmth.distributed.print.business.enums.ExamNumberStyleEnum;
 import com.qmth.teachcloud.common.bean.vo.FilePathVo;
 import com.qmth.teachcloud.common.bean.vo.OriginalVo;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
@@ -1271,21 +1272,24 @@ public class CreatePdfUtil {
                                            Long userId, List<PdfDto> examStudentPdfList, BasicCardRule basicCardRule,
                                            List<File> fileTempList) throws IOException {
         String studentHtml = studentContent;
-        // 生成学生考号条码并将图片转成base64
-        studentHtml = studentHtml.replaceAll("\\$\\{studentCodeBarcode\\}", examStudent != null && examStudent.getStudentCode() != null ? GoogleBarCodeUtil.createBarCode(examStudent.getStudentCode(), false) : "");
-        studentHtml = studentHtml.replaceAll("\\$\\{ticketNumberBarcode\\}", examStudent != null && examStudent.getTicketNumber() != null ? GoogleBarCodeUtil.createBarCode(examStudent.getTicketNumber(), false) : "");
-        studentHtml = studentHtml.replaceAll("\\$\\{examNumber\\}", examStudent != null && examStudent.getStudentCode() != null ? GoogleBarCodeUtil.createBarCode(examStudent.getStudentCode(), false) : "");
-        studentHtml = studentHtml.replaceAll("\\$\\{examNumberStr\\}", examStudent != null && examStudent.getStudentCode() != null ? examStudent.getStudentCode() : "");
-        // 随机生成学生试卷条码并将图片转成base64
-        studentHtml = studentHtml.replaceAll("\\$\\{paperType\\}", examStudent != null && examStudent.getPaperType() != null ? GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(examStudent.getPaperType()), false) : StringUtils.isNotBlank(paperType) ? GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(paperType), false) : "");
-        // 替换考生卷型
-        studentHtml = studentHtml.replaceAll("\\$\\{paperTypeName\\}", examStudent != null && examStudent.getPaperType() != null ? examStudent.getPaperType() : StringUtils.isNotBlank(paperType) ? paperType : "");
 
-        // 根据题卡规则必选字段,替换相应值,没有则“”
-        List<StudentExtendDto> studentExtendDtos = createExtendObject(examDetail, examStudent, basicCardRule);
-        if (studentExtendDtos != null) {
-            for (StudentExtendDto extendDto : studentExtendDtos) {
-                studentHtml = studentHtml.replaceAll("\\$\\{" + extendDto.getFieldName() + "\\}", String.valueOf(extendDto.getValue()));
+        if (!ExamNumberStyleEnum.FILL.equals(basicCardRule.getExamNumberStyle())) {
+            // 生成学生考号条码并将图片转成base64
+            studentHtml = studentHtml.replaceAll("\\$\\{studentCodeBarcode\\}", examStudent != null && examStudent.getStudentCode() != null ? GoogleBarCodeUtil.createBarCode(examStudent.getStudentCode(), false) : "");
+            studentHtml = studentHtml.replaceAll("\\$\\{ticketNumberBarcode\\}", examStudent != null && examStudent.getTicketNumber() != null ? GoogleBarCodeUtil.createBarCode(examStudent.getTicketNumber(), false) : "");
+            studentHtml = studentHtml.replaceAll("\\$\\{examNumber\\}", examStudent != null && examStudent.getStudentCode() != null ? GoogleBarCodeUtil.createBarCode(examStudent.getStudentCode(), false) : "");
+            studentHtml = studentHtml.replaceAll("\\$\\{examNumberStr\\}", examStudent != null && examStudent.getStudentCode() != null ? examStudent.getStudentCode() : "");
+            // 随机生成学生试卷条码并将图片转成base64
+            studentHtml = studentHtml.replaceAll("\\$\\{paperType\\}", examStudent != null && examStudent.getPaperType() != null ? GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(examStudent.getPaperType()), false) : StringUtils.isNotBlank(paperType) ? GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(paperType), false) : "");
+            // 替换考生卷型
+            studentHtml = studentHtml.replaceAll("\\$\\{paperTypeName\\}", examStudent != null && examStudent.getPaperType() != null ? examStudent.getPaperType() : StringUtils.isNotBlank(paperType) ? paperType : "");
+
+            // 根据题卡规则必选字段,替换相应值,没有则“”
+            List<StudentExtendDto> studentExtendDtos = createExtendObject(examDetail, examStudent, basicCardRule);
+            if (studentExtendDtos != null) {
+                for (StudentExtendDto extendDto : studentExtendDtos) {
+                    studentHtml = studentHtml.replaceAll("\\$\\{" + extendDto.getFieldName() + "\\}", String.valueOf(extendDto.getValue()));
+                }
             }
         }
 

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/CreatePdfTypeEnum.java

@@ -10,7 +10,7 @@ public enum CreatePdfTypeEnum {
 
     ALL("全部"),
     PAPER("试卷"),
-    CARD("题卡"),
+    CARD_A3("题卡"),
     SIGN("签到表"),
     PACKAGE("卷袋贴"),
     CHECK_IN("登记表");