| | |
| | | |
| | | /** |
| | | * 根据条件获取用户列表 |
| | | * * todo: type : 1: 获取检测人员信息 |
| | | * type : 2: 获取当前登录用户部门下的所有用户 |
| | | * @param user |
| | | * @param type |
| | | * * todo: type : 1: 获取检测人员信息 |
| | | * type : 2: 获取当前登录用户部门下的所有用户 |
| | | * |
| | | * @param user 用户 |
| | | * @param type 类型 |
| | | * @param departmentId 部门ID |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<User> selectUserCondition(User user, String type) { |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | public List<User> selectUserCondition(User user, String type, Integer departmentId) { |
| | | |
| | | switch (type) { |
| | | case "1": |
| | | return baseMapper.selectQualityUserList(); |
| | | case "2": |
| | | return baseMapper.selectDepartmentLimsUserList(SecurityUtils.getUserId().intValue()); |
| | | } |
| | | if (!StringUtils.isNotEmpty(type)) { |
| | | return baseMapper.selectUserCondition(QueryWrappers.queryWrappers(user), type); |
| | | } |
| | | |
| | | switch (type) { |
| | | |
| | | case "1": |
| | | // 检测人员 |
| | | return baseMapper.selectQualityUserList(); |
| | | |
| | | case "2": |
| | | Long currentUserId = SecurityUtils.getUserId(); |
| | | boolean isAdmin = SecurityUtils.isAdmin(currentUserId); |
| | | |
| | | // 管理员判断,传入部门ID就查对应的部门否则查询全部 |
| | | if (isAdmin) { |
| | | if (departmentId != null) { |
| | | return baseMapper.selectUserByDepartmentId(departmentId); |
| | | } |
| | | return baseMapper.selectUserCondition(QueryWrappers.queryWrappers(user), type); |
| | | } |
| | | return baseMapper.selectDepartmentLimsUserList(currentUserId.intValue()); |
| | | } |
| | | |
| | | return baseMapper.selectUserCondition(QueryWrappers.queryWrappers(user), type); |