From 133d62c55cc0f4835d34f53727287cb56bde29b8 Mon Sep 17 00:00:00 2001 From: sxlong Date: Fri, 29 Nov 2024 14:18:12 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=BC=82=E5=B8=B8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E8=BF=94=E5=9B=9E=E6=96=B9=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indicator/service/EDDataService.java | 6 ++--- .../service/impl/EDDataServiceImpl.java | 24 +++++++++---------- .../service/facade/EDDataFacadeImpl.java | 6 ++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/service/EDDataService.java b/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/service/EDDataService.java index d1ba4ba..66c1335 100644 --- a/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/service/EDDataService.java +++ b/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/service/EDDataService.java @@ -34,7 +34,7 @@ public interface EDDataService { * @param edDataInfo * @return */ - Boolean createDataInfo(EDDataInfo edDataInfo) throws FileNotFoundException; + Boolean createDataInfo(EDDataInfo edDataInfo) throws Exception; /** * 获取文件信息列表 @@ -55,7 +55,7 @@ public interface EDDataService { * @param parames * @return */ - Boolean updateFileInfo(EDDataParams parames) throws FileNotFoundException; + Boolean updateFileInfo(EDDataParams parames) throws Exception; /** * 获取子文件数量 @@ -69,7 +69,7 @@ public interface EDDataService { * @param parames * @return */ - Boolean uploadFile(EDDataParams parames) throws FileNotFoundException; + Boolean uploadFile(EDDataParams parames) throws Exception; /** * 文件下载 diff --git a/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/service/impl/EDDataServiceImpl.java b/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/service/impl/EDDataServiceImpl.java index 3ee23f8..d1e4cf1 100644 --- a/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/service/impl/EDDataServiceImpl.java +++ b/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/service/impl/EDDataServiceImpl.java @@ -145,14 +145,14 @@ public class EDDataServiceImpl implements EDDataService { * @param edDataInfo * @return */ - public Boolean createDataInfo(EDDataInfo edDataInfo) throws FileNotFoundException + public Boolean createDataInfo(EDDataInfo edDataInfo) throws Exception { // 获取上级目录的名称 Category categoryParent = new Category(); categoryParent.setCategoryId(edDataInfo.getCategoryId()); List categoryParentList = categoryRepository.selectCategories(categoryParent); if(categoryParentList.size() < 1) { - throw new FileNotFoundException("上级文件夹不存在"); + throw new Exception("上级文件夹不存在"); } else { @@ -170,7 +170,7 @@ public class EDDataServiceImpl implements EDDataService { for(EDDataInfo fileInfo : childFileInfoList) { if(fileInfo.getDataName().equals(edDataInfo.getDataName())){ - throw new FileNotFoundException("文件夹已存在"); + throw new Exception("文件夹已存在"); } } @@ -216,19 +216,19 @@ public class EDDataServiceImpl implements EDDataService { * @param parames * @return */ - public Boolean updateFileInfo(EDDataParams parames) throws FileNotFoundException + public Boolean updateFileInfo(EDDataParams parames) throws Exception { String dataStoragePath = getDataStoragePath(); if (!FileUtil.exist(dataStoragePath)){ - throw new FileNotFoundException("数据存储文件夹不存在"); + throw new Exception("数据存储文件夹不存在"); } EDDataParams paramesFind = new EDDataParams(); paramesFind.setDataId(parames.getDataId()); List edDataInfoList = edDataRepository.getDataInfoList(paramesFind); if(edDataInfoList.size() < 1) { - throw new FileNotFoundException("文件信息不存在"); + throw new Exception("文件信息不存在"); } EDDataInfo edDataInfo = edDataInfoList.get(0); @@ -236,7 +236,7 @@ public class EDDataServiceImpl implements EDDataService { String fileStorageFullPath = dataStoragePath + filePathOfFolder + File.separator + edDataInfo.getDataName(); if (!FileUtil.exist(fileStorageFullPath)){ - throw new FileNotFoundException("文件不存在"); + throw new Exception("文件不存在"); } String fileNameNew = parames.getName(); @@ -288,7 +288,7 @@ public class EDDataServiceImpl implements EDDataService { * @param parames * @return */ - public Boolean uploadFile(EDDataParams parames) throws FileNotFoundException + public Boolean uploadFile(EDDataParams parames) throws Exception { // 获取目录编码ID @@ -299,7 +299,7 @@ public class EDDataServiceImpl implements EDDataService { // 检查文件是否为空 if (fileInput == null || fileInput.isEmpty()) { - throw new FileNotFoundException("上传的文件为空"); + throw new Exception("上传的文件为空"); } // 获取文件名 @@ -320,7 +320,7 @@ public class EDDataServiceImpl implements EDDataService { for(EDDataInfo fileInfo : childFileInfoList) { if(fileInfo.getDataName().equals(fileFullName)){ - throw new FileNotFoundException("上传的文件已存在"); + throw new Exception("上传的文件已存在"); } } @@ -413,7 +413,7 @@ public class EDDataServiceImpl implements EDDataService { fileParames.setSaveStatus("failure"); edDataRepository.updateFileInfo(fileParames); log.info("文件保存失败: " + fileSaveFullPath); - throw new FileNotFoundException(e.getMessage()); + throw new Exception(e.getMessage()); } } @@ -575,7 +575,7 @@ public class EDDataServiceImpl implements EDDataService { log.error("文件加密错误..", e); } - log.info("目录树数据+文件数据已成功复制到目标目录。" + zipPathFileName); + log.info("目录树数据+文件数据已成功复制到目标目录。" + enCodeZipPathFileName); } catch (Exception e) { log.error("导出数据异常..", e); diff --git a/service/src/main/java/com/electromagnetic/industry/software/data/manage/service/facade/EDDataFacadeImpl.java b/service/src/main/java/com/electromagnetic/industry/software/data/manage/service/facade/EDDataFacadeImpl.java index 6a8d8bf..ecbafeb 100644 --- a/service/src/main/java/com/electromagnetic/industry/software/data/manage/service/facade/EDDataFacadeImpl.java +++ b/service/src/main/java/com/electromagnetic/industry/software/data/manage/service/facade/EDDataFacadeImpl.java @@ -91,7 +91,7 @@ public class EDDataFacadeImpl implements EDDataFacade { try { return ElectromagneticResultUtil.success(edDataService.createDataInfo(edDataInfo)); - } catch (FileNotFoundException e) { + } catch (Exception e) { log.error("创建文件夹失败。。。", e); return ElectromagneticResultUtil.fail("500", e.getMessage()); } @@ -129,7 +129,7 @@ public class EDDataFacadeImpl implements EDDataFacade { try { EDDataParams parames= EDDataMappers.INSTANCE.getEDDataParames(request); return ElectromagneticResultUtil.success(edDataService.updateFileInfo(parames)); - } catch (FileNotFoundException e) { + } catch (Exception e) { log.error("文件信息更新失败。。。", e); return ElectromagneticResultUtil.fail("500", e.getMessage()); } @@ -163,7 +163,7 @@ public class EDDataFacadeImpl implements EDDataFacade { try { EDDataParams parames= EDDataMappers.INSTANCE.getEDDataParames(request); return ElectromagneticResultUtil.success(edDataService.uploadFile(parames)); - } catch (FileNotFoundException e) { + } catch (Exception e) { log.error("上传文件失败。。。", e); return ElectromagneticResultUtil.fail("500", e.getMessage()); }