|
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.qmth.boot.tools.models.ByteArray;
|
|
import com.qmth.boot.tools.models.ByteArray;
|
|
import com.qmth.distributed.print.business.bean.createPdf.PrintPathVo;
|
|
import com.qmth.distributed.print.business.bean.createPdf.PrintPathVo;
|
|
import com.qmth.distributed.print.business.bean.dto.*;
|
|
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.FilePathVo;
|
|
import com.qmth.teachcloud.common.bean.vo.OriginalVo;
|
|
import com.qmth.teachcloud.common.bean.vo.OriginalVo;
|
|
import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
|
|
import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
|
|
@@ -1271,21 +1272,24 @@ public class CreatePdfUtil {
|
|
Long userId, List<PdfDto> examStudentPdfList, BasicCardRule basicCardRule,
|
|
Long userId, List<PdfDto> examStudentPdfList, BasicCardRule basicCardRule,
|
|
List<File> fileTempList) throws IOException {
|
|
List<File> fileTempList) throws IOException {
|
|
String studentHtml = studentContent;
|
|
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()));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|