|
@@ -110,6 +110,7 @@ public class CgglServiceImpl implements CgglService {
|
|
|
// 复制文件流
|
|
|
FileUtils.copyInputStreamToFile(file.getInputStream(), copyFile);
|
|
|
} catch (Exception e) {
|
|
|
+ System.out.println("成果包拷贝失败!");
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
QueryWrapper<EscalationFileDTO> wrapper = new QueryWrapper<>();
|
|
@@ -128,6 +129,7 @@ public class CgglServiceImpl implements CgglService {
|
|
|
curdto.setUnzippath(unzippath);
|
|
|
escalationFileMapper.update(curdto, wrapper);
|
|
|
} catch (Exception r) {
|
|
|
+ System.out.println("上传压缩包或者解压失败!");
|
|
|
r.printStackTrace();
|
|
|
curdto.setStatus("2");
|
|
|
curdto.setRemark("上传压缩包或者解压失败");
|
|
@@ -533,7 +535,7 @@ public class CgglServiceImpl implements CgglService {
|
|
|
//TODO 整理成果包树状结构
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
List<EscalationFolderDTO> datas = new ArrayList<>();
|
|
|
- findFolder(new File(fileDir), map, datas);
|
|
|
+ findFolder(new File(fileDir), map, datas, temp);
|
|
|
//递归生成树结构
|
|
|
datas = buildFolderTree(datas);
|
|
|
return RequestResult.success("获取成功", datas);
|
|
@@ -735,14 +737,14 @@ public class CgglServiceImpl implements CgglService {
|
|
|
/**
|
|
|
* 递归文件
|
|
|
*/
|
|
|
- private static void findFolder(File file, Map<String, String> map, List<EscalationFolderDTO> allFile) {
|
|
|
+ private static void findFolder(File file, Map<String, String> map, List<EscalationFolderDTO> allFile, String temp) {
|
|
|
map.put(file.getAbsolutePath(), StringUtils.getUUID());
|
|
|
if (file.isDirectory()) {
|
|
|
EscalationFolderDTO data = new EscalationFolderDTO();
|
|
|
data.setId(map.get(file.getAbsolutePath()));
|
|
|
data.setPid(map.get(file.getParent()));
|
|
|
data.setName(file.getName());
|
|
|
- data.setFilepath(StringUtils.getFileStaticPath(file.getAbsolutePath()));
|
|
|
+ data.setFilepath(StringUtils.getGhFileStaticPath(file.getAbsolutePath(), temp));
|
|
|
data.setIsparent(true);
|
|
|
if (file.getName().toLowerCase().indexOf(".gdb") > 0) {
|
|
|
data.setFilepath(file.getAbsolutePath());
|
|
@@ -756,7 +758,7 @@ public class CgglServiceImpl implements CgglService {
|
|
|
allFile.add(data);
|
|
|
File[] files = file.listFiles();
|
|
|
for (File f : files) {
|
|
|
- findFolder(f, map, allFile);
|
|
|
+ findFolder(f, map, allFile, temp);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -775,7 +777,7 @@ public class CgglServiceImpl implements CgglService {
|
|
|
data.setId(map.get(file.getAbsolutePath()));
|
|
|
data.setPid(map.get(file.getParent()));
|
|
|
data.setName(file.getName());
|
|
|
- data.setFilepath(StringUtils.getFileStaticPath(file.getAbsolutePath()));
|
|
|
+ data.setFilepath(StringUtils.getGhFileStaticPath(file.getAbsolutePath(), temp));
|
|
|
data.setIsparent(false);
|
|
|
allFile.add(data);
|
|
|
}
|