From 6883aa84e51977eee193ee583944b29683130c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Thu, 30 Mar 2023 21:12:03 +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 --- .../ota/service/IOtaBaSjSjmbclService.java | 2 +- .../ota/service/IOtaBaSjSjyxpgService.java | 2 +- .../service/impl/OtaBaSjListServiceImpl.java | 10 ++- .../impl/OtaBaSjSjmbclServiceImpl.java | 42 +++++++-- .../impl/OtaBaSjSjmbcxServiceImpl.java | 17 +++- .../impl/OtaBaSjSjyxpgServiceImpl.java | 88 ++++++++++++++++++- 6 files changed, 149 insertions(+), 12 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjSjmbclService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjSjmbclService.java index 2b63a87ef..6d7d6a66c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjSjmbclService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjSjmbclService.java @@ -73,5 +73,5 @@ public interface IOtaBaSjSjmbclService extends IService { OtaBaSjSjmbcl importData(MultipartFile file, String otaId, String cut) throws Exception; - void exportData(File file, String otaId, String cut) throws Exception; + void exportData(File file, File mbclAttFile, String otaId, String cut) throws Exception; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjSjyxpgService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjSjyxpgService.java index fa3a37a04..78419ac34 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjSjyxpgService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjSjyxpgService.java @@ -73,5 +73,5 @@ public interface IOtaBaSjSjyxpgService extends IService { OtaBaSjSjyxpg parseFileList(List upLoadFiles, String otaId, String cut) throws Exception; - void exportData(File file, String otaId, String cut) throws Exception; + void exportData(File file, File attFile, File attFile2, String otaId, String cut) throws Exception; } 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 f28c2da4c..9d4b01f65 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 @@ -190,12 +190,16 @@ 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()); + for (OSSFile ossFile : ossFileList) { + String filePath = ossFile.getUrl(); + boolean b = CosBootUtil.doesObjectExist(filePath); + if (b) { + InputStream download = CosBootUtil.download(filePath); + ImportFileUtil.writeToLocal(mbclAttFile.getCanonicalPath() + "/" + ossFile.getFileName(), download); + } + } + } + } + wb.write(new FileOutputStream(file)); + wb.close(); + } } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjmbcxServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjmbcxServiceImpl.java index dc098de37..76a4b9dc6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjmbcxServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjmbcxServiceImpl.java @@ -245,9 +245,24 @@ public class OtaBaSjSjmbcxServiceImpl 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); + } + } + } + } + } + + wb.write(new FileOutputStream(file)); + wb.close(); + } } }