wangliang 4 ani în urmă
părinte
comite
985ff2f1f9

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

@@ -228,7 +228,7 @@ public class CreatePdfUtil {
             for (int i = 0; i < jsonArrayCard.size(); i++) {
                 JSONObject object = (JSONObject) jsonArrayCard.get(i);
                 if (Objects.nonNull(object.get("attachmentId"))) {
-                    attachmentIds.add(Long.parseLong(String.valueOf(object.get("attachmentId"))));
+                    attachmentIds.add(Long.parseLong((String) (object.get("attachmentId"))));
                 }
             }
         }
@@ -244,12 +244,11 @@ public class CreatePdfUtil {
      * @throws IOException
      */
     public void getPaperPdf(ExamTaskDetail examTaskDetail, Integer backupCount, List<PdfDto>... pdfList) throws IOException {
-        JSONObject jsonObjectPaper = JSONObject.parseObject(examTaskDetail.getPaperAttachmentIds());
-        JSONArray jsonArrayPaper = jsonObjectPaper.getJSONArray("paper");
+        JSONArray jsonArrayPaper = JSONArray.parseArray(examTaskDetail.getPaperAttachmentIds());
         for (int i = 0; i < jsonArrayPaper.size(); i++) {
             JSONObject object = (JSONObject) jsonArrayPaper.get(i);
             if (Objects.nonNull(object.get("attachmentId"))) {
-                Long attachmentId = Long.parseLong(String.valueOf(object.get("attachmentId")));
+                Long attachmentId = Long.parseLong((String) (object.get("attachmentId")));
                 BasicAttachment basicAttachment = basicAttachmentService.getById(attachmentId);
                 File file = commonService.getFile(basicAttachment.getPath(), false);
                 int pageCount = PdfUtil.addPdfPage(file);