From cc2624d08e422c36a4f93cc15d0ca0f0b7b4951a Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 17 一月 2022 15:46:28 +0800
Subject: [PATCH] update 优化加载字典缓存数据

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java |   71 +++++++++++++++++------------------
 1 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
index bf8ab3e..70fda9a 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
@@ -1,109 +1,108 @@
 package com.ruoyi.system.service;
 
-import java.util.List;
-import com.ruoyi.common.core.domain.TreeSelect;
+import cn.hutool.core.lang.tree.Tree;
 import com.ruoyi.common.core.domain.entity.SysDept;
+
+import java.util.List;
 
 /**
  * 閮ㄩ棬绠$悊 鏈嶅姟灞�
- * 
- * @author ruoyi
+ *
+ * @author Lion Li
  */
-public interface ISysDeptService
-{
+public interface ISysDeptService {
     /**
      * 鏌ヨ閮ㄩ棬绠$悊鏁版嵁
-     * 
+     *
      * @param dept 閮ㄩ棬淇℃伅
      * @return 閮ㄩ棬淇℃伅闆嗗悎
      */
-    public List<SysDept> selectDeptList(SysDept dept);
-
-    /**
-     * 鏋勫缓鍓嶇鎵�闇�瑕佹爲缁撴瀯
-     * 
-     * @param depts 閮ㄩ棬鍒楄〃
-     * @return 鏍戠粨鏋勫垪琛�
-     */
-    public List<SysDept> buildDeptTree(List<SysDept> depts);
+    List<SysDept> selectDeptList(SysDept dept);
 
     /**
      * 鏋勫缓鍓嶇鎵�闇�瑕佷笅鎷夋爲缁撴瀯
-     * 
+     *
      * @param depts 閮ㄩ棬鍒楄〃
      * @return 涓嬫媺鏍戠粨鏋勫垪琛�
      */
-    public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
+    List<Tree<Long>> buildDeptTreeSelect(List<SysDept> depts);
 
     /**
      * 鏍规嵁瑙掕壊ID鏌ヨ閮ㄩ棬鏍戜俊鎭�
-     * 
+     *
      * @param roleId 瑙掕壊ID
      * @return 閫変腑閮ㄩ棬鍒楄〃
      */
-    public List<Integer> selectDeptListByRoleId(Long roleId);
+    List<Long> selectDeptListByRoleId(Long roleId);
 
     /**
      * 鏍规嵁閮ㄩ棬ID鏌ヨ淇℃伅
-     * 
+     *
      * @param deptId 閮ㄩ棬ID
      * @return 閮ㄩ棬淇℃伅
      */
-    public SysDept selectDeptById(Long deptId);
+    SysDept selectDeptById(Long deptId);
 
     /**
      * 鏍规嵁ID鏌ヨ鎵�鏈夊瓙閮ㄩ棬锛堟甯哥姸鎬侊級
-     * 
+     *
      * @param deptId 閮ㄩ棬ID
      * @return 瀛愰儴闂ㄦ暟
      */
-    public int selectNormalChildrenDeptById(Long deptId);
+    long selectNormalChildrenDeptById(Long deptId);
 
     /**
      * 鏄惁瀛樺湪閮ㄩ棬瀛愯妭鐐�
-     * 
+     *
      * @param deptId 閮ㄩ棬ID
      * @return 缁撴灉
      */
-    public boolean hasChildByDeptId(Long deptId);
+    boolean hasChildByDeptId(Long deptId);
 
     /**
      * 鏌ヨ閮ㄩ棬鏄惁瀛樺湪鐢ㄦ埛
-     * 
+     *
      * @param deptId 閮ㄩ棬ID
      * @return 缁撴灉 true 瀛樺湪 false 涓嶅瓨鍦�
      */
-    public boolean checkDeptExistUser(Long deptId);
+    boolean checkDeptExistUser(Long deptId);
 
     /**
      * 鏍¢獙閮ㄩ棬鍚嶇О鏄惁鍞竴
-     * 
+     *
      * @param dept 閮ㄩ棬淇℃伅
      * @return 缁撴灉
      */
-    public String checkDeptNameUnique(SysDept dept);
+    String checkDeptNameUnique(SysDept dept);
+
+    /**
+     * 鏍¢獙閮ㄩ棬鏄惁鏈夋暟鎹潈闄�
+     *
+     * @param deptId 閮ㄩ棬id
+     */
+    void checkDeptDataScope(Long deptId);
 
     /**
      * 鏂板淇濆瓨閮ㄩ棬淇℃伅
-     * 
+     *
      * @param dept 閮ㄩ棬淇℃伅
      * @return 缁撴灉
      */
-    public int insertDept(SysDept dept);
+    int insertDept(SysDept dept);
 
     /**
      * 淇敼淇濆瓨閮ㄩ棬淇℃伅
-     * 
+     *
      * @param dept 閮ㄩ棬淇℃伅
      * @return 缁撴灉
      */
-    public int updateDept(SysDept dept);
+    int updateDept(SysDept dept);
 
     /**
      * 鍒犻櫎閮ㄩ棬绠$悊淇℃伅
-     * 
+     *
      * @param deptId 閮ㄩ棬ID
      * @return 缁撴灉
      */
-    public int deleteDeptById(Long deptId);
+    int deleteDeptById(Long deptId);
 }

--
Gitblit v1.9.3