|
@@ -25,6 +25,7 @@ import com.platform.dao.entity.firm.FirmProducer;
|
|
|
import com.platform.dao.entity.upms.SysMenu;
|
|
|
import com.platform.dao.entity.upms.SysUser;
|
|
|
import com.platform.dao.enums.SysRoleCodeEnum;
|
|
|
+import com.platform.dao.mapper.upms.SysDeptMapper;
|
|
|
import com.platform.dao.util.ExcelUtil;
|
|
|
import com.platform.dao.util.TreeUtil;
|
|
|
import com.platform.dao.vo.SysUserVO;
|
|
@@ -77,6 +78,8 @@ public class SysUserController {
|
|
|
|
|
|
private final SysUserDeptService sysUserDeptService;
|
|
|
|
|
|
+ private final SysDeptMapper sysDeptMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 获取当前用户全部信息
|
|
|
*
|
|
@@ -241,9 +244,30 @@ public class SysUserController {
|
|
|
@GetMapping("/page")
|
|
|
@SysLog("分页查询用户列表")
|
|
|
public R<MyPage<SysUserVO>> getSysUserPage(@RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "20") int pageSize, SysUserDTO sysUserDTO) {
|
|
|
+ List<String> deptIds = new ArrayList<>();
|
|
|
+ if (sysUserDTO.getDeptId()!=null&&!sysUserDTO.getDeptId().equals("")){
|
|
|
+ deptIds.add(sysUserDTO.getDeptId());
|
|
|
+ deptIds = getDeptIds(deptIds);
|
|
|
+ sysUserDTO.setDeptIds(deptIds);
|
|
|
+ }else if ("".equals(sysUserDTO.getDeptId())){
|
|
|
+ sysUserDTO.setDeptId(null);
|
|
|
+ }
|
|
|
return new R<>(sysUserService.selectVOPageInfo(sysUserDTO, pageNum, pageSize));
|
|
|
}
|
|
|
|
|
|
+ private List<String> getDeptIds(List<String> ids){
|
|
|
+ if (ids!=null&&ids.size()>0) {
|
|
|
+ List<String> childIds = sysDeptMapper.getChildIds(ids);
|
|
|
+ ids.addAll(childIds);
|
|
|
+ if (childIds!=null&&childIds.size()>0){
|
|
|
+ getDeptIds(childIds);
|
|
|
+ }else {
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询用户列表
|
|
|
*
|