Explorar el Código

权限代码恢复

liubo hace 3 años
padre
commit
b15a2c6d13

+ 1 - 13
zd-modules/zd-modules-system/src/main/java/com/zd/system/controller/SysDeptController.java

@@ -252,19 +252,7 @@ public class SysDeptController extends BaseController {
      */
     @GetMapping("/builds/list")
     public AjaxResult buildsList() {
-        SysUser sysuser  =  tokenService.getLoginUser().getSysUser();
-        SysDept sysDept = deptService.selectDeptById(sysuser.getDept().getDeptId());
-        Long deptId =null;
-        //查询登录用户所属的院校的deptid
-        if("0".equals(sysDept.getAncestors())){
-            deptId=sysDept.getDeptId();
-        }else{
-            deptId=Long.valueOf(sysDept.getAncestors().split(",")[1]);
-        }
-
-        SysDept dept = new SysDept();
-        dept.setDeptId(deptId);
-        List<SysDept> depts = deptService.selectBuildsList(dept);
+        List<SysDept> depts = deptService.selectBuildsList(new SysDept());
         return AjaxResult.success(depts);
     }
 

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

@@ -400,6 +400,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
     }
 
     @Override
+    @DataScope(deptAlias = "d", permi = PerPrefix.SYSTEM_DEPT)
     public List<SysDept> selectBuildsList(SysDept dept) {
         return deptMapper.selectBuildsList(dept);
     }

+ 2 - 1
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -156,7 +156,8 @@
     <select id="selectBuildsList" resultMap="SysDeptResult">
         <include refid="selectDeptVo"/>
         where d.del_flag = '0' and
-        d.parent_id in (select dept_id from sys_dept where parent_id = #{deptId})
+        d.parent_id in (select dept_id from sys_dept where parent_id = 100)
+        ${params.dataScope}
     </select>
 
     <select id="selectLevelByUserId" resultType="java.lang.Integer">