|
@@ -61,9 +61,9 @@ public class DatabaseServiceImpl implements DatabaseService {
|
|
//有package则在服务器固定路径new file.mkdir
|
|
//有package则在服务器固定路径new file.mkdir
|
|
UUID uuid = UUID.randomUUID();
|
|
UUID uuid = UUID.randomUUID();
|
|
String filePath = "/mnt/newdatadrive/data/runtime/jar-instance/zplma/tempFile/" + uuid + "/";
|
|
String filePath = "/mnt/newdatadrive/data/runtime/jar-instance/zplma/tempFile/" + uuid + "/";
|
|
- filePath = filePath + packageName;
|
|
|
|
- String zipPath = filePath;
|
|
|
|
|
|
+ String zipPath = filePath + packageName;
|
|
String delPath = filePath;
|
|
String delPath = filePath;
|
|
|
|
+ filePath = zipPath;
|
|
if ("dev".equals(active)) {
|
|
if ("dev".equals(active)) {
|
|
filePath = "D:\\caimei-workSpace\\file\\" + uuid + "\\";
|
|
filePath = "D:\\caimei-workSpace\\file\\" + uuid + "\\";
|
|
zipPath = filePath + packageName;
|
|
zipPath = filePath + packageName;
|
|
@@ -102,7 +102,7 @@ public class DatabaseServiceImpl implements DatabaseService {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
FileZipUtils.deleteFile(new File(delPath));
|
|
FileZipUtils.deleteFile(new File(delPath));
|
|
- return ResponseJson.success();
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -137,7 +137,7 @@ public class DatabaseServiceImpl implements DatabaseService {
|
|
fileTreeVo.setAuthUserId(authUserId);
|
|
fileTreeVo.setAuthUserId(authUserId);
|
|
fileTreeVo.setMime(mime);
|
|
fileTreeVo.setMime(mime);
|
|
fileMapper.insertNewFile(fileTreeVo);
|
|
fileMapper.insertNewFile(fileTreeVo);
|
|
- if(mime.contains("image")){
|
|
|
|
|
|
+ if (mime.contains("image")) {
|
|
//图片保存缩略图
|
|
//图片保存缩略图
|
|
asyncService.insertScreenshot(fileTreeVo);
|
|
asyncService.insertScreenshot(fileTreeVo);
|
|
}
|
|
}
|
|
@@ -192,8 +192,7 @@ public class DatabaseServiceImpl implements DatabaseService {
|
|
//文件夹
|
|
//文件夹
|
|
List<FileTreeVo> fileTree = fileMapper.findFileTree(fileId, null, null);
|
|
List<FileTreeVo> fileTree = fileMapper.findFileTree(fileId, null, null);
|
|
fileTree.forEach(f -> {
|
|
fileTree.forEach(f -> {
|
|
- OSSUtils.deleteSingleFile(f.getOssName());
|
|
|
|
- fileMapper.deleteFileTreeById(f.getId());
|
|
|
|
|
|
+ deleteFilesById(f.getId());
|
|
});
|
|
});
|
|
fileMapper.deleteFileTreeById(fileId);
|
|
fileMapper.deleteFileTreeById(fileId);
|
|
} else {
|
|
} else {
|
|
@@ -235,11 +234,11 @@ public class DatabaseServiceImpl implements DatabaseService {
|
|
}
|
|
}
|
|
//有package则在服务器固定路径new file.mkdir
|
|
//有package则在服务器固定路径new file.mkdir
|
|
UUID uuid = UUID.randomUUID();
|
|
UUID uuid = UUID.randomUUID();
|
|
- String filePath = "/mnt/newdatadrive/data/runtime/jar-instance/zplma/tempFile/" + uuid;
|
|
|
|
- String zipPath = filePath;
|
|
|
|
|
|
+ String zipPath = "/mnt/newdatadrive/data/runtime/jar-instance/zplma/tempFile/" + uuid;
|
|
|
|
+ String filePath = zipPath;
|
|
if ("dev".equals(active)) {
|
|
if ("dev".equals(active)) {
|
|
- filePath = "D:\\caimei-workSpace\\file\\" + uuid;
|
|
|
|
- zipPath = filePath;
|
|
|
|
|
|
+ zipPath = "D:\\caimei-workSpace\\file\\" + uuid;
|
|
|
|
+ filePath = zipPath;
|
|
}
|
|
}
|
|
boolean mkdirs = new File(filePath).mkdirs();
|
|
boolean mkdirs = new File(filePath).mkdirs();
|
|
Assert.isTrue(mkdirs, "文件夹创建失败");
|
|
Assert.isTrue(mkdirs, "文件夹创建失败");
|
|
@@ -262,6 +261,8 @@ public class DatabaseServiceImpl implements DatabaseService {
|
|
if ("dev".equals(active)) {
|
|
if ("dev".equals(active)) {
|
|
myPath = filePath + "\\" + fileTreeVo.getFileName();
|
|
myPath = filePath + "\\" + fileTreeVo.getFileName();
|
|
}
|
|
}
|
|
|
|
+ boolean dirs = new File(myPath).mkdirs();
|
|
|
|
+ Assert.isTrue(dirs, "文件夹创建失败");
|
|
recursion(param, myPath);
|
|
recursion(param, myPath);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -292,9 +293,10 @@ public class DatabaseServiceImpl implements DatabaseService {
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+ file.delete();
|
|
FileZipUtils.deleteFile(new File(zipPath));
|
|
FileZipUtils.deleteFile(new File(zipPath));
|
|
}
|
|
}
|
|
- return ResponseJson.error("请勾选多个文件");
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -350,7 +352,7 @@ public class DatabaseServiceImpl implements DatabaseService {
|
|
if ("dev".equals(active)) {
|
|
if ("dev".equals(active)) {
|
|
filePath = finalFilePath + "\\" + aPackage.getFileName();
|
|
filePath = finalFilePath + "\\" + aPackage.getFileName();
|
|
} else {
|
|
} else {
|
|
- filePath = finalFilePath + aPackage.getFileName() + "/";
|
|
|
|
|
|
+ filePath = finalFilePath + "/" + aPackage.getFileName();
|
|
}
|
|
}
|
|
File fil = new File(filePath.toString());
|
|
File fil = new File(filePath.toString());
|
|
fil.mkdirs();
|
|
fil.mkdirs();
|