组织机构权限
This commit is contained in:
parent
0902ca2bef
commit
22cbc8ec7d
|
|
@ -92,11 +92,17 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||||
// 管理员和省公司可查看所有数据
|
// 管理员和省公司可查看所有数据
|
||||||
if (userId != null && deptId != null
|
// if (userId != null && deptId != null
|
||||||
&& !userId.equals(ADMIN_ID)
|
// && !userId.equals(ADMIN_ID)
|
||||||
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
|
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
|
||||||
dept.setDeptId(deptId);
|
// dept.setDeptId(deptId);
|
||||||
|
// }
|
||||||
|
if(ADMIN_ID.equals(userId)){
|
||||||
|
dept.setCompanyId(1L);
|
||||||
|
}else{
|
||||||
|
dept.setCompanyId(deptId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return deptMapper.selectDeptList(dept);
|
return deptMapper.selectDeptList(dept);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<include refid="selectDeptVo"/>
|
<include refid="selectDeptVo"/>
|
||||||
where d.del_flag = '0'
|
where d.del_flag = '0'
|
||||||
<if test="companyId != null and companyId != 0">
|
<if test="companyId != null and companyId != 0">
|
||||||
AND (find_in_set(#{companyId}, ancestors) or dept_id = #{companyId})
|
<!-- AND (find_in_set(#{companyId}, ancestors) or dept_id = #{companyId})-->
|
||||||
|
and d.dept_id in
|
||||||
|
(
|
||||||
|
select dept_id from sys_dept where dept_id = #{companyId}
|
||||||
|
union
|
||||||
|
select dept_id from sys_dept where parent_id = #{companyId}
|
||||||
|
union
|
||||||
|
select dept_id from sys_dept where find_in_set(#{companyId}, ancestors)
|
||||||
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null and deptId != 0">
|
<if test="deptId != null and deptId != 0">
|
||||||
AND dept_id = #{deptId}
|
AND dept_id = #{deptId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue