Эх сурвалжийг харах

bug - 批量下载没试卷空指针

caozixuan 2 жил өмнө
parent
commit
6317980d8f

+ 9 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DownloadServiceImpl.java

@@ -241,11 +241,16 @@ public class DownloadServiceImpl implements DownloadService {
                     Long cardId = paper.getCardId();
                     Long attachmentId = paper.getAttachmentId();
                     BasicAttachment basicAttachment = basicAttachmentService.getById(attachmentId);
+                    String paperName = null;
+                    String paperSuffix = null;
+                    String paperPath = null;
+                    if (Objects.nonNull(basicAttachment)){
+                        paperName = basicAttachment.getName();
+                        paperSuffix = basicAttachment.getType();
+                        JSONObject jsonObject = JSONObject.parseObject(basicAttachment.getPath());
+                        paperPath = (String) jsonObject.get(SystemConstant.PATH);
+                    }
                     String paperType = paper.getName();
-                    String paperName = basicAttachment.getName();
-                    String paperSuffix = basicAttachment.getType();
-                    JSONObject jsonObject = JSONObject.parseObject(basicAttachment.getPath());
-                    String paperPath = (String) jsonObject.get(SystemConstant.PATH);
 
                     boolean exposureStatus;
                     if (exposedPaperTypeList.contains(paperType)) {