소스 검색

区域功能

bing 1 년 전
부모
커밋
218a2c2a7a
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/basics/service/impl/PtAreaServiceImpl.java

+ 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("楼层不能作为父节点");
+            }
+        }
     }
 
     /**