|
@@ -58,20 +58,23 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
public List<SysDept> selectDeptList(SysDept dept) {
|
|
|
LoginUser loginUser = redisService.getCacheObject(CacheConstants.LOGIN_TOKEN_KEY + SecurityUtils.getToken());
|
|
|
SysUser sysUser = loginUser.getSysUser();
|
|
|
- List<SysRole> roles = sysUser.getRoles();
|
|
|
+ Long deptId = sysUser.getDeptId();
|
|
|
+/* List<SysRole> roles = sysUser.getRoles();
|
|
|
dept.setListByParentId(Boolean.TRUE);
|
|
|
for (SysRole role : roles) {
|
|
|
String dataScope = role.getDataScope();
|
|
|
if (DATA_SCOPE_ALL.equals(dataScope)){
|
|
|
dept.setListByParentId(Boolean.FALSE);
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
if (StringUtils.isNotEmpty(dept.getDeptName()) || StringUtils.isNotEmpty(dept.getStatus())) {
|
|
|
return deptMapper.selectDeptList(dept);
|
|
|
}
|
|
|
Long id = dept.getId();
|
|
|
if (id != null) {
|
|
|
dept.setParentId(id);
|
|
|
+ }else {
|
|
|
+ dept.setId(deptId);
|
|
|
}
|
|
|
List<SysDept> depts = deptMapper.selectDeptList(dept);
|
|
|
// 这里的逻辑是:根据id获取到这个下面的所有子部门,每个部门判断是否有下一级别
|