From 553c29ab8a46c9a07e3657fdd36a81a6bfde1afe Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 23 九月 2021 19:13:58 +0800
Subject: [PATCH] update 整合 satoken 权限、鉴权一体化框架

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
index edcad0b..cbafcf4 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
@@ -10,7 +10,6 @@
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
-import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -121,7 +120,7 @@
      * @return 瀛愰儴闂ㄦ暟
      */
     @Override
-    public int selectNormalChildrenDeptById(Long deptId) {
+    public long selectNormalChildrenDeptById(Long deptId) {
         return count(new LambdaQueryWrapper<SysDept>()
                 .eq(SysDept::getStatus, 0)
                 .apply("find_in_set({0}, ancestors)", deptId));
@@ -135,7 +134,7 @@
      */
     @Override
     public boolean hasChildByDeptId(Long deptId) {
-        int result = count(new LambdaQueryWrapper<SysDept>()
+        long result = count(new LambdaQueryWrapper<SysDept>()
                 .eq(SysDept::getParentId, deptId)
                 .last("limit 1"));
         return result > 0;
@@ -149,7 +148,7 @@
      */
     @Override
     public boolean checkDeptExistUser(Long deptId) {
-        int result = userMapper.selectCount(new LambdaQueryWrapper<SysUser>()
+        long result = userMapper.selectCount(new LambdaQueryWrapper<SysUser>()
                 .eq(SysUser::getDeptId, deptId));
         return result > 0;
     }
@@ -179,15 +178,12 @@
      * @param deptId 閮ㄩ棬id
      */
     @Override
-    public void checkDeptDataScope(Long deptId)
-    {
-        if (!SysUser.isAdmin(SecurityUtils.getUserId()))
-        {
+    public void checkDeptDataScope(Long deptId) {
+        if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
             SysDept dept = new SysDept();
             dept.setDeptId(deptId);
             List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
-            if (StringUtils.isEmpty(depts))
-            {
+            if (StringUtils.isEmpty(depts)) {
                 throw new ServiceException("娌℃湁鏉冮檺璁块棶閮ㄩ棬鏁版嵁锛�");
             }
         }

--
Gitblit v1.9.3