Compare commits
No commits in common. "97a7302c7bf31797cb6aeab7aeb38bea04e8280c" and "4d09ba9d2c8a7727ac369f3f042c3074650aa25d" have entirely different histories.
97a7302c7b
...
4d09ba9d2c
|
|
@ -34,7 +34,7 @@ public interface EDDataService {
|
||||||
* @param edDataInfo
|
* @param edDataInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean createDataInfo(EDDataInfo edDataInfo) throws Exception;
|
Boolean createDataInfo(EDDataInfo edDataInfo) throws FileNotFoundException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取文件信息列表
|
* 获取文件信息列表
|
||||||
|
|
@ -55,7 +55,7 @@ public interface EDDataService {
|
||||||
* @param parames
|
* @param parames
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean updateFileInfo(EDDataParams parames) throws Exception;
|
Boolean updateFileInfo(EDDataParams parames) throws FileNotFoundException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取子文件数量
|
* 获取子文件数量
|
||||||
|
|
@ -69,7 +69,7 @@ public interface EDDataService {
|
||||||
* @param parames
|
* @param parames
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean uploadFile(EDDataParams parames) throws Exception;
|
Boolean uploadFile(EDDataParams parames) throws FileNotFoundException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件下载
|
* 文件下载
|
||||||
|
|
|
||||||
|
|
@ -145,14 +145,14 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
* @param edDataInfo
|
* @param edDataInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean createDataInfo(EDDataInfo edDataInfo) throws Exception
|
public Boolean createDataInfo(EDDataInfo edDataInfo) throws FileNotFoundException
|
||||||
{
|
{
|
||||||
// 获取上级目录的名称
|
// 获取上级目录的名称
|
||||||
Category categoryParent = new Category();
|
Category categoryParent = new Category();
|
||||||
categoryParent.setCategoryId(edDataInfo.getCategoryId());
|
categoryParent.setCategoryId(edDataInfo.getCategoryId());
|
||||||
List<Category> categoryParentList = categoryRepository.selectCategories(categoryParent);
|
List<Category> categoryParentList = categoryRepository.selectCategories(categoryParent);
|
||||||
if(categoryParentList.size() < 1) {
|
if(categoryParentList.size() < 1) {
|
||||||
throw new Exception("上级文件夹不存在");
|
throw new FileNotFoundException("上级文件夹不存在");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -170,7 +170,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
for(EDDataInfo fileInfo : childFileInfoList)
|
for(EDDataInfo fileInfo : childFileInfoList)
|
||||||
{
|
{
|
||||||
if(fileInfo.getDataName().equals(edDataInfo.getDataName())){
|
if(fileInfo.getDataName().equals(edDataInfo.getDataName())){
|
||||||
throw new Exception("文件夹已存在");
|
throw new FileNotFoundException("文件夹已存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -216,19 +216,19 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
* @param parames
|
* @param parames
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean updateFileInfo(EDDataParams parames) throws Exception
|
public Boolean updateFileInfo(EDDataParams parames) throws FileNotFoundException
|
||||||
{
|
{
|
||||||
|
|
||||||
String dataStoragePath = getDataStoragePath();
|
String dataStoragePath = getDataStoragePath();
|
||||||
if (!FileUtil.exist(dataStoragePath)){
|
if (!FileUtil.exist(dataStoragePath)){
|
||||||
throw new Exception("数据存储文件夹不存在");
|
throw new FileNotFoundException("数据存储文件夹不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
EDDataParams paramesFind = new EDDataParams();
|
EDDataParams paramesFind = new EDDataParams();
|
||||||
paramesFind.setDataId(parames.getDataId());
|
paramesFind.setDataId(parames.getDataId());
|
||||||
List<EDDataInfo> edDataInfoList = edDataRepository.getDataInfoList(paramesFind);
|
List<EDDataInfo> edDataInfoList = edDataRepository.getDataInfoList(paramesFind);
|
||||||
if(edDataInfoList.size() < 1) {
|
if(edDataInfoList.size() < 1) {
|
||||||
throw new Exception("文件信息不存在");
|
throw new FileNotFoundException("文件信息不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
EDDataInfo edDataInfo = edDataInfoList.get(0);
|
EDDataInfo edDataInfo = edDataInfoList.get(0);
|
||||||
|
|
@ -236,7 +236,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
String fileStorageFullPath = dataStoragePath + filePathOfFolder + File.separator + edDataInfo.getDataName();
|
String fileStorageFullPath = dataStoragePath + filePathOfFolder + File.separator + edDataInfo.getDataName();
|
||||||
|
|
||||||
if (!FileUtil.exist(fileStorageFullPath)){
|
if (!FileUtil.exist(fileStorageFullPath)){
|
||||||
throw new Exception("文件不存在");
|
throw new FileNotFoundException("文件不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
String fileNameNew = parames.getName();
|
String fileNameNew = parames.getName();
|
||||||
|
|
@ -288,7 +288,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
* @param parames
|
* @param parames
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean uploadFile(EDDataParams parames) throws Exception
|
public Boolean uploadFile(EDDataParams parames) throws FileNotFoundException
|
||||||
{
|
{
|
||||||
|
|
||||||
// 获取目录编码ID
|
// 获取目录编码ID
|
||||||
|
|
@ -299,7 +299,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
|
|
||||||
// 检查文件是否为空
|
// 检查文件是否为空
|
||||||
if (fileInput == null || fileInput.isEmpty()) {
|
if (fileInput == null || fileInput.isEmpty()) {
|
||||||
throw new Exception("上传的文件为空");
|
throw new FileNotFoundException("上传的文件为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取文件名
|
// 获取文件名
|
||||||
|
|
@ -320,7 +320,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
for(EDDataInfo fileInfo : childFileInfoList)
|
for(EDDataInfo fileInfo : childFileInfoList)
|
||||||
{
|
{
|
||||||
if(fileInfo.getDataName().equals(fileFullName)){
|
if(fileInfo.getDataName().equals(fileFullName)){
|
||||||
throw new Exception("上传的文件已存在");
|
throw new FileNotFoundException("上传的文件已存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -413,7 +413,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
fileParames.setSaveStatus("failure");
|
fileParames.setSaveStatus("failure");
|
||||||
edDataRepository.updateFileInfo(fileParames);
|
edDataRepository.updateFileInfo(fileParames);
|
||||||
log.info("文件保存失败: " + fileSaveFullPath);
|
log.info("文件保存失败: " + fileSaveFullPath);
|
||||||
throw new Exception(e.getMessage());
|
throw new FileNotFoundException(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -575,7 +575,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
log.error("文件加密错误..", e);
|
log.error("文件加密错误..", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("目录树数据+文件数据已成功复制到目标目录。" + enCodeZipPathFileName);
|
log.info("目录树数据+文件数据已成功复制到目标目录。" + zipPathFileName);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
log.error("导出数据异常..", e);
|
log.error("导出数据异常..", e);
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return ElectromagneticResultUtil.success(edDataService.createDataInfo(edDataInfo));
|
return ElectromagneticResultUtil.success(edDataService.createDataInfo(edDataInfo));
|
||||||
} catch (Exception e) {
|
} catch (FileNotFoundException e) {
|
||||||
log.error("创建文件夹失败。。。", e);
|
log.error("创建文件夹失败。。。", e);
|
||||||
return ElectromagneticResultUtil.fail("500", e.getMessage());
|
return ElectromagneticResultUtil.fail("500", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -129,7 +129,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
||||||
try {
|
try {
|
||||||
EDDataParams parames= EDDataMappers.INSTANCE.getEDDataParames(request);
|
EDDataParams parames= EDDataMappers.INSTANCE.getEDDataParames(request);
|
||||||
return ElectromagneticResultUtil.success(edDataService.updateFileInfo(parames));
|
return ElectromagneticResultUtil.success(edDataService.updateFileInfo(parames));
|
||||||
} catch (Exception e) {
|
} catch (FileNotFoundException e) {
|
||||||
log.error("文件信息更新失败。。。", e);
|
log.error("文件信息更新失败。。。", e);
|
||||||
return ElectromagneticResultUtil.fail("500", e.getMessage());
|
return ElectromagneticResultUtil.fail("500", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -163,7 +163,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
||||||
try {
|
try {
|
||||||
EDDataParams parames= EDDataMappers.INSTANCE.getEDDataParames(request);
|
EDDataParams parames= EDDataMappers.INSTANCE.getEDDataParames(request);
|
||||||
return ElectromagneticResultUtil.success(edDataService.uploadFile(parames));
|
return ElectromagneticResultUtil.success(edDataService.uploadFile(parames));
|
||||||
} catch (Exception e) {
|
} catch (FileNotFoundException e) {
|
||||||
log.error("上传文件失败。。。", e);
|
log.error("上传文件失败。。。", e);
|
||||||
return ElectromagneticResultUtil.fail("500", e.getMessage());
|
return ElectromagneticResultUtil.fail("500", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue