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(); }