fix:资源要求-人员-奖惩记录,新增无员工信息问题
| | |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * todo: type : 1: 获取检测人员信息 |
| | | type : 2: 获取当前登录用户部门下的所有用户 |
| | | * |
| | | * @param user |
| | | * @param type |
| | | * @param type 1: 获取检测人员信息,2: 获取当前登录用户部门下的所有用户 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据条件获取用户列表") |
| | | @GetMapping("/selectUserCondition") |
| | | public Result selectUserCondition(User user, String type){ |
| | | return Result.success(userService.selectUserCondition(user, type)); |
| | | public Result selectUserCondition(User user, String type, Integer departmentId) { |
| | | return Result.success(userService.selectUserCondition(user, type, departmentId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<User> selectDepartmentLimsUserList(@Param("userId") Integer userId); |
| | | |
| | | /** |
| | | * 获取部门ID查询对应的部门人员 |
| | | * |
| | | * @param departmentId 部门ID |
| | | * @return |
| | | */ |
| | | List<User> selectUserByDepartmentId(@Param("departmentId") Integer departmentId); |
| | | |
| | | } |
| | | |
| | |
| | | * 根据条件获取用户列表 |
| | | * @param user |
| | | * @param type |
| | | * @param departmentId 部门ID |
| | | * @return |
| | | */ |
| | | List<User> selectUserCondition(User user, String type); |
| | | List<User> selectUserCondition(User user, String type, Integer departmentId); |
| | | |
| | | /** |
| | | * 获取当前登录的客户信息 |
| | |
| | | |
| | | /** |
| | | * 根据条件获取用户列表 |
| | | * * 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); |
| | |
| | | where u2.id = #{userId}) |
| | | </select> |
| | | |
| | | <select id="selectUserByDepartmentId" resultType="com.ruoyi.common.core.domain.entity.User" |
| | | parameterType="java.lang.Integer"> |
| | | select id, |
| | | dept_id, |
| | | account, |
| | | name, |
| | | name_en, |
| | | user_type, |
| | | email, |
| | | phone, |
| | | sex, |
| | | age, |
| | | signature_url, |
| | | picture_url, |
| | | status, |
| | | del_flag, |
| | | login_ip, |
| | | login_date, |
| | | depart_lims_id, |
| | | company, |
| | | is_custom |
| | | from user |
| | | where del_flag = '0' |
| | | and depart_lims_id is not null |
| | | and depart_lims_id != '' |
| | | and FIND_IN_SET(#{departmentId}, depart_lims_id) |
| | | </select> |
| | | |
| | | </mapper> |