| | |
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.ruoyi.common.core.constant.UserConstants;
|
| | | import com.ruoyi.common.core.exception.CustomException;
|
| | | import com.ruoyi.common.core.utils.StringUtils;
|
| | | import com.ruoyi.common.datascope.annotation.DataScope;
|
| | | import com.ruoyi.system.api.domain.SysDept;
|
| | | import com.ruoyi.system.api.domain.SysRole;
|
| | | import com.ruoyi.system.domain.vo.TreeSelect;
|
| | | import com.ruoyi.system.mapper.SysDeptMapper;
|
| | | import com.ruoyi.system.mapper.SysRoleMapper;
|
| | | import com.ruoyi.system.service.ISysDeptService;
|
| | |
|
| | | /**
|
| | |
| | | {
|
| | | @Autowired
|
| | | private SysDeptMapper deptMapper;
|
| | |
|
| | | @Autowired
|
| | | private SysRoleMapper roleMapper;
|
| | |
|
| | | /**
|
| | | * 查询部门管理数据
|
| | |
| | | @Override
|
| | | public List<Integer> selectDeptListByRoleId(Long roleId)
|
| | | {
|
| | | return deptMapper.selectDeptListByRoleId(roleId);
|
| | | SysRole role = roleMapper.selectRoleById(roleId);
|
| | | return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | {
|
| | | if (hasChild(list, tChild))
|
| | | {
|
| | | // 判断是否有子节点
|
| | | Iterator<SysDept> it = childList.iterator();
|
| | | while (it.hasNext())
|
| | | {
|
| | | SysDept n = (SysDept) it.next();
|
| | | recursionFn(list, n);
|
| | | }
|
| | | recursionFn(list, tChild);
|
| | | }
|
| | | }
|
| | | }
|