Merge branch 'develop' into develop_comac
This commit is contained in:
commit
2898fda58f
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 文件下载
|
||||
|
|
|
|||
|
|
@ -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<Category> 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<EDDataInfo> 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);
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue