bing 1 жил өмнө
parent
commit
218a2c2a7a

+ 7 - 0
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/basics/service/impl/PtAreaServiceImpl.java

@@ -101,6 +101,13 @@ public class PtAreaServiceImpl implements IPtAreaService {
         if (baseMapper.selectCount(lqw) > 0) {
             throw new ServiceException("区域名称重复");
         }
+        //父节点不能是楼层 04
+        if(entity.getParentId()!=null){
+            PtArea ptArea = baseMapper.selectById(entity.getParentId());
+            if(ptArea!=null && "04".equals(ptArea.getAreaType())){
+                throw new ServiceException("楼层不能作为父节点");
+            }
+        }
     }
 
     /**