|
@@ -547,7 +547,10 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
|
|
String savePath = fileUtils.getSystemPath(url);
|
|
String savePath = fileUtils.getSystemPath(url);
|
|
File directory = new File(tempPath);
|
|
File directory = new File(tempPath);
|
|
if (!directory.exists()) {
|
|
if (!directory.exists()) {
|
|
- directory.mkdir();
|
|
|
|
|
|
+ boolean success = directory.mkdir();
|
|
|
|
+ if (!success) {
|
|
|
|
+ throw new Exception("数据导出时创建文件夹失败");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
WebSocketServer.sendInfo(Response.websocket(true, ResponseEnum.PROJECT_EXPORT_TASK_SUCCESS), String.valueOf(userId));
|
|
WebSocketServer.sendInfo(Response.websocket(true, ResponseEnum.PROJECT_EXPORT_TASK_SUCCESS), String.valueOf(userId));
|
|
if (params.getProjectInfo()) {
|
|
if (params.getProjectInfo()) {
|
|
@@ -672,7 +675,10 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
|
|
String tempSavePath = fileUtils.getSystemPath(url);
|
|
String tempSavePath = fileUtils.getSystemPath(url);
|
|
File tempDirectory = new File(tempPath);
|
|
File tempDirectory = new File(tempPath);
|
|
if (!tempDirectory.exists()) {
|
|
if (!tempDirectory.exists()) {
|
|
- tempDirectory.mkdir();
|
|
|
|
|
|
+ boolean success = tempDirectory.mkdir();
|
|
|
|
+ if (!success) {
|
|
|
|
+ throw new Exception("数据导入时创建文件夹失败");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
projectImportStatusService.add(importId, userId, 2);
|
|
projectImportStatusService.add(importId, userId, 2);
|
|
ZipUtil.unzip(tempSavePath, tempPath);
|
|
ZipUtil.unzip(tempSavePath, tempPath);
|