From 4bf04013e3fe086264cdcce4f56385c183994678 Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Tue, 12 Dec 2023 13:38:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E7=BB=93=E6=9E=84=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ebtp/extend/wps/controller/WpsController.java | 12 ++++++------ .../ebtp/extend/wps/service/impl/WpsServiceImpl.java | 9 ++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java index 3ed0db0..1f07e6c 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java @@ -216,13 +216,13 @@ public class WpsController { if(optional!=null&&optional.get()!=null){ AttachmentDetail detail = optional.get(); - List entityList = detail.get(fileId); - - Optional optional1 = attachmentClient.downloadFileByObjectId(entityList.get(0).getId()); - fileLength = String.valueOf(optional1.get().length); - fileName = entityList.get(0).getFilename(); - buf = optional1.get(); + if(entityList!=null&&entityList.size()>0) { + Optional optional1 = attachmentClient.downloadFileByObjectId(entityList.get(0).getId()); + fileLength = String.valueOf(optional1.get().length); + fileName = entityList.get(0).getFilename(); + buf = optional1.get(); + } } try{ diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java index 6081d65..05fc71e 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java @@ -652,13 +652,12 @@ public class WpsServiceImpl implements WpsService { Optional optional = attachmentClient.findByBusinessId(businessIdList); if(optional!=null&&optional.get()!=null) { - AttachmentDetail detail = optional.get(); - List entityList = detail.get(id); - - Optional optional1 = attachmentClient.downloadFileByObjectId(entityList.get(0).getId()); - return optional1.get(); + if(entityList!=null&&entityList.size()>0) { + Optional optional1 = attachmentClient.downloadFileByObjectId(entityList.get(0).getId()); + return optional1.get(); + } } return new byte[0]; }