Merge pull request #2659 from dataease/pr@dev@perf_move_map_file

perf(仪表板): 复制地图坐标文件判断是否已存在
This commit is contained in:
fit2cloud-chenyw 2022-07-21 18:34:17 +08:00 committed by GitHub
commit bfacd16d08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,10 @@ public class MapTransferService {
files.forEach(file -> {
String fileName = file.getName();
String newFilePath = dirPath + GLOBAL_CHINA_PREFIX + FILE_SEPARATOR + GLOBAL_CHINA_PREFIX + fileName;
FileUtil.move(file, new File(newFilePath), false);
File target = new File(newFilePath);
if(!target.exists()) {
FileUtil.move(file, target, true);
}
});
});
}
@ -104,8 +107,10 @@ public class MapTransferService {
String targetPath = targetDirPath + fileName;
File targetFile = new File(targetPath);
if (!targetFile.exists()) {
FileUtil.move(sourceFile, targetFile, true);
}
FileUtil.move(sourceFile, targetFile, false);
}