Selaa lähdekoodia

修改删除不按照类型划分

xiewj 2 vuotta sitten
vanhempi
commit
15876c62a8

+ 22 - 16
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/DirServiceImpl.java

@@ -100,21 +100,25 @@ public class DirServiceImpl extends IBaseServiceImpl<DirEntity, Long> implements
     public Result remove(Long id) {
         DirEntity entity = this.findById(id);
         String type = entity.getType();
-        if ("pano".equals(type)){
-            // 查询子节点
-            String dirs = getChildIdById(id);
-            BaseRuntimeException.isTrue(checkPanoUse(dirs), ErrorEnum.FAILURE_CODE_3101.code(), ErrorEnum.FAILURE_CODE_3101.message());
-
-            this.deleteById(id);
-
-        } else {
-            // 子目录跟子素材没有进行递归删除
-            //20230420 增加删除子目录
-            String dirs = getChildIdById(id);
-            this.deleteByIds(dirs);
-            fodderService.removeByDirIds(dirs);
-        }
-
+//        if ("pano".equals(type)){
+//            // 查询子节点
+//            String dirs = getChildIdById(id);
+//            BaseRuntimeException.isTrue(checkPanoUse(dirs), ErrorEnum.FAILURE_CODE_3101.code(), ErrorEnum.FAILURE_CODE_3101.message());
+//            this.deleteByIds(dirs);
+//            fodderService.removeByDirIds(dirs);
+//        } else {
+//            // 子目录跟子素材没有进行递归删除
+//            //20230420 增加删除子目录
+//            String dirs = getChildIdById(id);
+//            this.deleteByIds(dirs);
+//            fodderService.removeByDirIds(dirs);
+//        }
+        // 查询子节点
+        String dirs = getChildIdById(id);
+        log.info("删除类型{},dir-ids:{}",type,dirs);
+        BaseRuntimeException.isTrue(checkPanoUse(dirs), ErrorEnum.FAILURE_CODE_3101.code(), ErrorEnum.FAILURE_CODE_3101.message());
+        this.deleteByIds(dirs);
+        fodderService.removeByDirIds(dirs);
         return Result.success();
     }
 
@@ -126,7 +130,9 @@ public class DirServiceImpl extends IBaseServiceImpl<DirEntity, Long> implements
         String ids = null;
         if (list.size() > 0){
             for (String s : list) {
-                builder.append(s).append(",");
+                if (!s.equals("1")){
+                    builder.append(s).append(",");
+                }
             }
             ids = builder.toString();
             ids = StrUtil.subBefore(ids, ",", true);