|
@@ -79,6 +79,39 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
return deptMapper.selectDeptList(dept);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询部门管理数据
|
|
|
+ *
|
|
|
+ * @param dept 部门信息
|
|
|
+ * @return 部门信息集合
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @DataScope(deptAlias = "d")
|
|
|
+ public List<SysDept> selectDeptListAndF(SysDept dept) {
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
+ Long deptId = loginUser.getDeptId();
|
|
|
+ if (!String.valueOf(loginUser.getUserId()).equals("1")) {
|
|
|
+ List<Long> deptList = new ArrayList<>();
|
|
|
+ //获取到子孙级部门id
|
|
|
+ if (deptService.hasChildByDeptId(deptId)) {
|
|
|
+ List<Long> children = deptService.getDeptChildren(deptId);
|
|
|
+ System.err.println(children.size());
|
|
|
+ deptList.addAll(children);
|
|
|
+ }
|
|
|
+ //查询上一级到顶级
|
|
|
+ SysDept sysDept = deptService.selectById(deptId);
|
|
|
+ String[] split = sysDept.getAncestors().split(",");
|
|
|
+ if (split.length > 1) {
|
|
|
+ for (String s : split) {
|
|
|
+ deptList.add(Long.valueOf(s));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ deptList.add(deptId);
|
|
|
+ dept.setDeptList(deptList);
|
|
|
+ }
|
|
|
+ return deptMapper.selectDeptList(dept);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询部门管理数据
|
|
|
*
|