对外报告-修改选择人员和部门
This commit is contained in:
+48
@@ -21,6 +21,7 @@ import com.jero.common.system.util.JwtUtil;
|
|||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.common.system.vo.SysDepartTreeModel;
|
import com.jero.common.system.vo.SysDepartTreeModel;
|
||||||
import com.jero.common.system.vo.SysDepartUserTreeModel;
|
import com.jero.common.system.vo.SysDepartUserTreeModel;
|
||||||
|
import com.jero.common.system.vo.SysUserTreeModel;
|
||||||
import com.jero.common.util.ImportExcelUtil;
|
import com.jero.common.util.ImportExcelUtil;
|
||||||
import com.jero.common.util.PasswordUtil;
|
import com.jero.common.util.PasswordUtil;
|
||||||
import com.jero.common.util.RedisUtil;
|
import com.jero.common.util.RedisUtil;
|
||||||
@@ -63,6 +64,7 @@ import java.io.IOException;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 用户表 前端控制器
|
* 用户表 前端控制器
|
||||||
@@ -1533,7 +1535,53 @@ public class SysUserController {
|
|||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 查询数据 查出所有部门及其用户
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "用户管理-查出所有部门及其用户")
|
||||||
|
@RequestMapping(value = "/queryUserTreeList", method = RequestMethod.GET)
|
||||||
|
public Result<List<DepartUserTree>> queryUserTreeList(String cut) {
|
||||||
|
Result<List<DepartUserTree>> result = new Result<>();
|
||||||
|
List<DepartUserTree> dutList = new ArrayList<>();
|
||||||
|
List<SysDepartTreeModel> departTreeModelList = sysDepartService.queryTreeList(cut);
|
||||||
|
for (SysDepartTreeModel sdtm: departTreeModelList) {
|
||||||
|
dutList.addAll(findChildNode(sdtm));
|
||||||
|
}
|
||||||
|
result.setResult(dutList);
|
||||||
|
result.setSuccess(true);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<DepartUserTree> findChildNode(SysDepartTreeModel sdtModel) {
|
||||||
|
List<DepartUserTree> resList = new ArrayList<>();
|
||||||
|
DepartUserTree dut = new DepartUserTree();
|
||||||
|
dut.setId(sdtModel.getId());
|
||||||
|
dut.setName(sdtModel.getDepartName());
|
||||||
|
dut.setParentId(sdtModel.getParentId());
|
||||||
|
dut.setType("Depart");
|
||||||
|
resList.add(dut);
|
||||||
|
|
||||||
|
List<String> departIds = new ArrayList<>();
|
||||||
|
departIds.add(sdtModel.getId());
|
||||||
|
List<SysUser> sysUserList = sysUserService.getUserListByDepIds(departIds);
|
||||||
|
for (SysUser user: sysUserList) {
|
||||||
|
DepartUserTree dut1 = new DepartUserTree();
|
||||||
|
dut1.setId(user.getId());
|
||||||
|
dut1.setName(user.getUsername());
|
||||||
|
dut1.setParentId(sdtModel.getId());
|
||||||
|
dut1.setType("User");
|
||||||
|
resList.add(dut1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sdtModel.getChildren() != null && sdtModel.getChildren().size() > 0) {
|
||||||
|
for (SysDepartTreeModel sdtModel1 : sdtModel.getChildren()) {
|
||||||
|
resList.addAll(findChildNode(sdtModel1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resList;
|
||||||
|
}
|
||||||
|
|
||||||
@AutoLog(value = "文档库推送部门和人员的模糊搜索")
|
@AutoLog(value = "文档库推送部门和人员的模糊搜索")
|
||||||
@ApiOperation(value="文档库推送部门和人员的模糊搜索", notes="文档库推送部门和人员的模糊搜索")
|
@ApiOperation(value="文档库推送部门和人员的模糊搜索", notes="文档库推送部门和人员的模糊搜索")
|
||||||
|
|||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
package com.jero.modules.system.entity;
|
||||||
|
|
||||||
|
public class DepartUserTree {
|
||||||
|
private String id;
|
||||||
|
private String parentId;
|
||||||
|
private String name;
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentId() {
|
||||||
|
return parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentId(String parentId) {
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "DepartUserTree{" +
|
||||||
|
"id='" + id + '\'' +
|
||||||
|
", parentId='" + parentId + '\'' +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", type='" + type + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user