|
@@ -64,12 +64,36 @@ public class RasterServerImpl implements RasterServer {
|
|
|
@Override
|
|
|
public R deleteById(Long fileId) {
|
|
|
// 删除服务器文件
|
|
|
+ // 删除服务器文件
|
|
|
Optional<OutputFileEntity> e = outputFileRepository.findById(fileId);
|
|
|
if (!e.isPresent()) {
|
|
|
return new R(50002, MsgCode.E50002);
|
|
|
}
|
|
|
OutputFileEntity fileEntity = e.get();
|
|
|
// 文件
|
|
|
+ if (fileEntity.getUploadPath() != null) {
|
|
|
+ FileUtils.delFolder(fileEntity.getUploadPath());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fileEntity.getCoordGeneralPath() != null) {
|
|
|
+ FileUtils.delFolder(fileEntity.getCoordGeneralPath());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fileEntity.getUnZipPath() != null) {
|
|
|
+ FileUtils.delFolder(fileEntity.getUnZipPath());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fileEntity.getGeojsonPath() != null) {
|
|
|
+ FileUtils.delFolder(fileEntity.getGeojsonPath());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fileEntity.getCoordStrictPath() != null) {
|
|
|
+ FileUtils.delFolder(fileEntity.getCoordStrictPath());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fileEntity.getSlicePath() != null) {
|
|
|
+ FileUtils.delFolder(fileEntity.getSlicePath());
|
|
|
+ }
|
|
|
|
|
|
|
|
|
// 删除数据库记录
|
|
@@ -77,6 +101,7 @@ public class RasterServerImpl implements RasterServer {
|
|
|
fileRepository.deleteById(fileEntity.getUploadId());
|
|
|
|
|
|
return new R(200, MsgCode.SUCCESS);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|