|
@@ -281,7 +281,7 @@ public class CreatePdfUtil {
|
|
|
* @param attachmentIds
|
|
|
*/
|
|
|
public void getCardAttachmentId(ExamCardDetail examCardDetail, Set<Long> attachmentIds) {
|
|
|
- if (Objects.nonNull(examCardDetail.getAttachmentId())) {
|
|
|
+ if (Objects.nonNull(examCardDetail.getAttachmentId()) && !Objects.equals("", examCardDetail.getAttachmentId())) {
|
|
|
JSONObject jsonObjectCard = JSONObject.parseObject(examCardDetail.getAttachmentId());
|
|
|
JSONArray jsonArrayCard = (JSONArray) jsonObjectCard.get("card");
|
|
|
for (int i = 0; i < jsonArrayCard.size(); i++) {
|
|
@@ -561,7 +561,6 @@ public class CreatePdfUtil {
|
|
|
* 通用题卡html
|
|
|
*
|
|
|
* @param cardContent
|
|
|
- * @param paperType
|
|
|
* @param examDetailCourse
|
|
|
* @param examCard
|
|
|
* @param jsonArray
|
|
@@ -570,12 +569,12 @@ public class CreatePdfUtil {
|
|
|
* @return
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
- public BasicAttachment cardHtml(String sequence, String cardContent, String paperType, ExamDetail examDetail, ExamDetailCourse examDetailCourse, ExamCard examCard, JSONArray jsonArray, Long userId, List<PdfDto> cardPdfList) throws IOException {
|
|
|
+ public BasicAttachment cardHtml(String sequence, String cardContent, ExamDetail examDetail, ExamDetailCourse examDetailCourse, ExamCard examCard, JSONArray jsonArray, Long userId, List<PdfDto> cardPdfList) throws IOException {
|
|
|
//通用题卡
|
|
|
String cardTemp = cardContent;
|
|
|
- cardTemp = cardTemp.replaceAll("\\$\\{paperTypeName\\}", paperType);
|
|
|
+ cardTemp = cardTemp.replaceAll("\\$\\{paperTypeName\\}", examDetailCourse.getPaperType());
|
|
|
//随机生成试卷条码并将图片转成base64
|
|
|
- cardTemp = cardTemp.replaceAll("\\$\\{paperType\\}", GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(paperType), false));
|
|
|
+ cardTemp = cardTemp.replaceAll("\\$\\{paperType\\}", GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(examDetailCourse.getPaperType()), false));
|
|
|
//通用题卡生成卷袋贴条码
|
|
|
String packageCode = examDetail.getPackageCode() + sequence;
|
|
|
String packageCodeImg = GoogleBarCodeUtil.createBarCode(packageCode, false);
|
|
@@ -583,7 +582,7 @@ public class CreatePdfUtil {
|
|
|
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);
|
|
|
+ object.put("name", examDetailCourse.getPaperType());
|
|
|
object.put("examDetailCourseId", examDetailCourse.getId());
|
|
|
object.put("attachmentId", cardAttachment.getId());
|
|
|
object.put("packageCode", packageCode);
|