From aca5d3b1ff81b9c1072a82a768cb339a6880e01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Thu, 30 Mar 2023 22:12:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91OTA=E5=A4=87=E6=A1=88?= =?UTF-8?q?=E5=B7=A5=E5=85=B7-=E8=BD=A6=E8=BE=86=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/OtaBaSjGgnrfsServiceImpl.java | 8 +-- .../service/impl/OtaBaSjListServiceImpl.java | 6 +- .../impl/OtaBaSjSjmbclServiceImpl.java | 8 +-- .../impl/OtaBaSjSjyxpgServiceImpl.java | 60 +++++++++---------- 4 files changed, 38 insertions(+), 44 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjGgnrfsServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjGgnrfsServiceImpl.java index 3b056ab13..2cd2a3801 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjGgnrfsServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjGgnrfsServiceImpl.java @@ -277,10 +277,10 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl attList = JSONArray.parseArray(attStr, AttachmentEO.class); - if (ObjectUtils.isNotEmpty(attList)) { - for (AttachmentEO aeo : attList) { - List ossFileList = ossFileService.getFileInfos(aeo.getId()); + if(StringUtils.isNotEmpty(attStr)){ + String[] strs = attStr.split(","); + for (String str : strs) { + List ossFileList = ossFileService.getFileInfos(str); for (OSSFile ossFile : ossFileList) { String filePath = ossFile.getUrl(); boolean b = CosBootUtil.doesObjectExist(filePath); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjListServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjListServiceImpl.java index 2178ab1c9..84def1daf 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjListServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjListServiceImpl.java @@ -187,7 +187,7 @@ public class OtaBaSjListServiceImpl extends ServiceImpl attList = JSONArray.parseArray(attStr, AttachmentEO.class); - if (ObjectUtils.isNotEmpty(attList)) { - for (AttachmentEO aeo : attList) { - List ossFileList = ossFileService.getFileInfos(aeo.getId()); + if (StringUtils.isNotEmpty(attStr)) { + String[] strs = attStr.split(","); + for (String str : strs) { + List ossFileList = ossFileService.getFileInfos(str); for (OSSFile ossFile : ossFileList) { String filePath = ossFile.getUrl(); boolean b = CosBootUtil.doesObjectExist(filePath); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjyxpgServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjyxpgServiceImpl.java index 0acf2c91e..dcd0e7a11 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjyxpgServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjyxpgServiceImpl.java @@ -291,7 +291,7 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl attList = JSONArray.parseArray(attStr, AttachmentEO.class); - if (ObjectUtils.isNotEmpty(attList)) { - for (AttachmentEO aeo : attList) { - List ossFileList = ossFileService.getFileInfos(aeo.getId()); - for (OSSFile ossFile : ossFileList) { - String filePath = ossFile.getUrl(); - boolean b = CosBootUtil.doesObjectExist(filePath); - if (b) { - InputStream download = CosBootUtil.download(filePath); - ImportFileUtil.writeToLocal(attFile1.getCanonicalPath() + "/" + ossFile.getFileName(), download); - } - } - } - } - } String attStr1 = pg.getBgfj(); - if(StringUtils.isNotEmpty(attStr1)){ - List attList = JSONArray.parseArray(attStr1, AttachmentEO.class); - if (ObjectUtils.isNotEmpty(attList)) { - for (AttachmentEO aeo : attList) { - List ossFileList = ossFileService.getFileInfos(aeo.getId()); - for (OSSFile ossFile : ossFileList) { - String filePath = ossFile.getUrl(); - boolean b = CosBootUtil.doesObjectExist(filePath); - if (b) { - InputStream download = CosBootUtil.download(filePath); - ImportFileUtil.writeToLocal(attFile2.getCanonicalPath() + "/" + ossFile.getFileName(), download); - } + if (StringUtils.isNotEmpty(attStr1)) { + String[] strs = attStr1.split(","); + for (String str : strs) { + List ossFileList = ossFileService.getFileInfos(str); + for (OSSFile ossFile : ossFileList) { + String filePath = ossFile.getUrl(); + boolean b = CosBootUtil.doesObjectExist(filePath); + if (b) { + InputStream download = CosBootUtil.download(filePath); + ImportFileUtil.writeToLocal(attFile1.getCanonicalPath() + "/" + ossFile.getFileName(), download); + } + } + } + } + String attStr2 = pg.getBgfj(); + if (StringUtils.isNotEmpty(attStr2)) { + String[] strs = attStr2.split(","); + for (String str : strs) { + List ossFileList = ossFileService.getFileInfos(str); + for (OSSFile ossFile : ossFileList) { + String filePath = ossFile.getUrl(); + boolean b = CosBootUtil.doesObjectExist(filePath); + if (b) { + InputStream download = CosBootUtil.download(filePath); + ImportFileUtil.writeToLocal(attFile2.getCanonicalPath() + "/" + ossFile.getFileName(), download); } } } } - wb.write(new FileOutputStream(file)); wb.close(); }