|
@@ -63,15 +63,23 @@ public class SysOrgController {
|
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation("获取组织分页")
|
|
@ApiOperation("获取组织分页")
|
|
|
@GetMapping("/sys/org/queryList")
|
|
@GetMapping("/sys/org/queryList")
|
|
|
- public CommonResult<List<SysOrg>> queryList() {
|
|
|
|
|
- return CommonResult.data(sysOrgService.queyrList());
|
|
|
|
|
|
|
+ public CommonResult<List<SysOrg>> queryList(HttpServletRequest req) {
|
|
|
|
|
+ Map param=new HashMap();
|
|
|
|
|
+ String category="COLLEGE";
|
|
|
|
|
+ if(StringUtils.isNotEmpty(req.getParameter("category")))category=req.getParameter("category");
|
|
|
|
|
+ param.put("category",category);
|
|
|
|
|
+ return CommonResult.data(sysOrgService.queyrList(param));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation("获取-业务用组织分页")
|
|
@ApiOperation("获取-业务用组织分页")
|
|
|
@GetMapping("/bus/org/queryList")
|
|
@GetMapping("/bus/org/queryList")
|
|
|
- public CommonResult<List<SysOrg>> queryBusList() {
|
|
|
|
|
- return CommonResult.data(sysOrgService.queyrList());
|
|
|
|
|
|
|
+ public CommonResult<List<SysOrg>> queryBusList(HttpServletRequest req) {
|
|
|
|
|
+ Map param=new HashMap();
|
|
|
|
|
+ String category="COLLEGE";
|
|
|
|
|
+ if(StringUtils.isNotEmpty(req.getParameter("category")))category=req.getParameter("category");
|
|
|
|
|
+ param.put("category",category);
|
|
|
|
|
+ return CommonResult.data(sysOrgService.queyrList(param));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -220,41 +228,48 @@ public class SysOrgController {
|
|
|
param.put("category",req.getParameter("category"));
|
|
param.put("category",req.getParameter("category"));
|
|
|
param.put("eduIdentity",req.getParameter("eduIdentity"));
|
|
param.put("eduIdentity",req.getParameter("eduIdentity"));
|
|
|
|
|
|
|
|
- Map result = new HashMap();
|
|
|
|
|
- String collegeParentId = "0";
|
|
|
|
|
- if(StringUtils.isNotEmpty(req.getParameter("collegeParentId")))collegeParentId=req.getParameter("collegeParentId");
|
|
|
|
|
- //用于装当前单位的map
|
|
|
|
|
- Map nowData = new HashMap();
|
|
|
|
|
- List<Map<String, Object>> tree = new ArrayList<>();
|
|
|
|
|
- //最终用来化成树的集合
|
|
|
|
|
- List<Map<String,Object>> dataList=new ArrayList<>();
|
|
|
|
|
- //查询该父级id的子级院系
|
|
|
|
|
- List<Map<String,Object>> orgList=sysOrgService.getOrgUserChildList(param);
|
|
|
|
|
- List<Map<String,Object>> userList=sysUserService.getOrgUserChildList(param);
|
|
|
|
|
- dataList.addAll(orgList);
|
|
|
|
|
- dataList.addAll(userList);
|
|
|
|
|
- for(Map one:dataList)
|
|
|
|
|
- {
|
|
|
|
|
- if(one.get("id").equals(collegeParentId))
|
|
|
|
|
|
|
+ List<Map<String,Object>> resultList= null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ Map result = new HashMap();
|
|
|
|
|
+ String collegeParentId = "0";
|
|
|
|
|
+ if(StringUtils.isNotEmpty(req.getParameter("collegeParentId")))collegeParentId=req.getParameter("collegeParentId");
|
|
|
|
|
+ //用于装当前单位的map
|
|
|
|
|
+ Map nowData = new HashMap();
|
|
|
|
|
+ List<Map<String, Object>> tree = new ArrayList<>();
|
|
|
|
|
+ //最终用来化成树的集合
|
|
|
|
|
+ List<Map<String,Object>> dataList=new ArrayList<>();
|
|
|
|
|
+ //查询该父级id的子级院系
|
|
|
|
|
+ List<Map<String,Object>> orgList=sysOrgService.getOrgUserChildList(param);
|
|
|
|
|
+ List<Map<String,Object>> userList=sysUserService.getOrgUserChildList(param);
|
|
|
|
|
+ System.out.println("----------------------------------------------------------------组织人员树数据打印开始");
|
|
|
|
|
+ dataList.addAll(orgList);
|
|
|
|
|
+ dataList.addAll(userList);
|
|
|
|
|
+ for(Map one:dataList)
|
|
|
{
|
|
{
|
|
|
- nowData=one;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ if(one.get("id").equals(collegeParentId))
|
|
|
|
|
+ {
|
|
|
|
|
+ nowData=one;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ System.out.println("----------------------------------------------------------------组织人员树数据打印逐条数据"+one);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- tree = TreeUtil.getThree(dataList,collegeParentId);
|
|
|
|
|
-
|
|
|
|
|
- //如果传进来的id不为空,则把传进来的id也作为一条数据
|
|
|
|
|
- List<Map<String,Object>> resultList=new ArrayList<>();
|
|
|
|
|
- if(nowData.get("id")!=null)
|
|
|
|
|
- {
|
|
|
|
|
- nowData.put("children",tree);
|
|
|
|
|
- resultList.add(nowData);
|
|
|
|
|
- result.put("result",resultList);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- resultList.addAll(tree);
|
|
|
|
|
|
|
+ tree = TreeUtil.getThree(dataList,collegeParentId);
|
|
|
|
|
+ System.out.println("----------------------------------------------------------------组织人员树数据打印树数据"+tree);
|
|
|
|
|
+ System.out.println("----------------------------------------------------------------组织人员树数据打印结束");
|
|
|
|
|
+ //如果传进来的id不为空,则把传进来的id也作为一条数据
|
|
|
|
|
+ resultList = new ArrayList<>();
|
|
|
|
|
+ if(nowData.get("id")!=null)
|
|
|
|
|
+ {
|
|
|
|
|
+ nowData.put("children",tree);
|
|
|
|
|
+ resultList.add(nowData);
|
|
|
|
|
+ result.put("result",resultList);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ resultList.addAll(tree);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
return CommonResult.data(resultList);
|
|
return CommonResult.data(resultList);
|
|
|
}
|
|
}
|