Sfoglia il codice sorgente

!199 简化逻辑判断
Merge pull request !199 from 光速蜗牛/master

若依 3 anni fa
parent
commit
17246d8a27

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java

@@ -139,7 +139,7 @@ public class SysDeptServiceImpl implements ISysDeptService
139
     public boolean hasChildByDeptId(Long deptId)
139
     public boolean hasChildByDeptId(Long deptId)
140
     {
140
     {
141
         int result = deptMapper.hasChildByDeptId(deptId);
141
         int result = deptMapper.hasChildByDeptId(deptId);
142
-        return result > 0 ? true : false;
142
+        return result > 0;
143
     }
143
     }
144
 
144
 
145
     /**
145
     /**

+ 2 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java

@@ -259,7 +259,7 @@ public class SysMenuServiceImpl implements ISysMenuService
259
     public boolean hasChildByMenuId(Long menuId)
259
     public boolean hasChildByMenuId(Long menuId)
260
     {
260
     {
261
         int result = menuMapper.hasChildByMenuId(menuId);
261
         int result = menuMapper.hasChildByMenuId(menuId);
262
-        return result > 0 ? true : false;
262
+        return result > 0;
263
     }
263
     }
264
 
264
 
265
     /**
265
     /**
@@ -272,7 +272,7 @@ public class SysMenuServiceImpl implements ISysMenuService
272
     public boolean checkMenuExistRole(Long menuId)
272
     public boolean checkMenuExistRole(Long menuId)
273
     {
273
     {
274
         int result = roleMenuMapper.checkMenuExistRole(menuId);
274
         int result = roleMenuMapper.checkMenuExistRole(menuId);
275
-        return result > 0 ? true : false;
275
+        return result > 0;
276
     }
276
     }
277
 
277
 
278
     /**
278
     /**