|
@@ -1304,15 +1304,14 @@ public class CreatePdfUtil {
|
|
|
* @param cardPdfList 备用题卡集合
|
|
|
* @param basicCardRule 题卡规则对象
|
|
|
*/
|
|
|
- public BasicAttachment cardHtml(String sequence, String cardContent, ExamDetail examDetail, ExamDetailCourse
|
|
|
- examDetailCourse, JSONArray jsonArray, Long userId, List<PdfDto> cardPdfList, BasicCardRule basicCardRule) throws
|
|
|
+ public BasicAttachment cardHtml(String sequence, String cardContent, ExamDetail examDetail, ExamDetailCourse examDetailCourse, String paperType, JSONArray jsonArray, Long userId, List<PdfDto> cardPdfList, BasicCardRule basicCardRule) throws
|
|
|
IOException {
|
|
|
//通用题卡
|
|
|
String cardTemp = cardContent;
|
|
|
- cardTemp = cardTemp.replaceAll("\\$\\{paperTypeName\\}", examDetailCourse.getPaperType());
|
|
|
+ cardTemp = cardTemp.replaceAll("\\$\\{paperTypeName\\}", paperType);
|
|
|
//随机生成试卷条码并将图片转成base64
|
|
|
- if (Objects.nonNull(examDetailCourse.getPaperType())) {
|
|
|
- cardTemp = cardTemp.replaceAll("\\$\\{paperType\\}", GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(examDetailCourse.getPaperType()), false));
|
|
|
+ if (Objects.nonNull(paperType)) {
|
|
|
+ cardTemp = cardTemp.replaceAll("\\$\\{paperType\\}", GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(paperType), false));
|
|
|
}
|
|
|
if (Objects.nonNull(basicCardRule) && Objects.nonNull(basicCardRule.getExtendFields())) {
|
|
|
JSONArray jsonObjectExtend = (JSONArray) JSONArray.parse(basicCardRule.getExtendFields());//扩展字段
|
|
@@ -1359,7 +1358,7 @@ public class CreatePdfUtil {
|
|
|
|
|
|
BasicAttachment cardAttachment = printCommonService.saveAttachmentHtml(examDetail.getSchoolId() + "|" + examDetailCourse.getCourseCode(), cardTemp, userId, cardPdfList);
|
|
|
JSONObject object = new JSONObject();
|
|
|
- object.put("name", examDetailCourse.getPaperType());
|
|
|
+ object.put("name", paperType);
|
|
|
object.put("examDetailCourseId", examDetailCourse.getId());
|
|
|
object.put("attachmentId", cardAttachment.getId());
|
|
|
object.put("packageCode", packageCode);
|