|
@@ -31,9 +31,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -99,12 +97,14 @@ public class SysUserController extends BaseController {
|
|
|
@GetMapping("/tree4dept")
|
|
@GetMapping("/tree4dept")
|
|
|
public UserTreeVO tree4dept() {
|
|
public UserTreeVO tree4dept() {
|
|
|
SysDept dept = new SysDept();
|
|
SysDept dept = new SysDept();
|
|
|
- Map<String, Object> params = new HashMap<>(3);
|
|
|
|
|
- String dataScope = StringUtils.format(
|
|
|
|
|
- " AND {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
|
|
|
|
|
- "d", SecurityUtils.getDeptId(), SecurityUtils.getDeptId());
|
|
|
|
|
- params.put("dataScope", dataScope);
|
|
|
|
|
- dept.setParams(params);
|
|
|
|
|
|
|
+// 注释掉这一段 是查询本部门及下级子部门用的
|
|
|
|
|
+// Map<String, Object> params = new HashMap<>(3);
|
|
|
|
|
+// String dataScope = StringUtils.format(
|
|
|
|
|
+// " AND {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
|
|
|
|
|
+// "d", SecurityUtils.getDeptId(), SecurityUtils.getDeptId());
|
|
|
|
|
+// params.put("dataScope", dataScope);
|
|
|
|
|
+// dept.setParams(params);
|
|
|
|
|
+ dept.setDeptId(SecurityUtils.getDeptId());
|
|
|
List<SysDept> deptList = deptService.selectDeptChildrenList(dept);
|
|
List<SysDept> deptList = deptService.selectDeptChildrenList(dept);
|
|
|
List<SysDept> list = deptService.buildDeptTree(deptList);
|
|
List<SysDept> list = deptService.buildDeptTree(deptList);
|
|
|
SysDept tree = list.get(0);
|
|
SysDept tree = list.get(0);
|