日志: 我收的到页面 部门列表接口
This commit is contained in:
parent
167b983d1d
commit
69d719b3f4
@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
|
||||
@ -19,6 +20,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -150,6 +152,17 @@ public class UserController {
|
||||
return success(user);
|
||||
}
|
||||
|
||||
@PostMapping("/getByDeptId")
|
||||
@Operation(summary = "根据部门编号获得用户详情")
|
||||
@Parameter(name = "deptId", description = "部门编号", required = true, example = "117")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:query')")
|
||||
public CommonResult<List<UserRespVO>> getListUserByDeptId(@RequestParam("deptId") Long deptId) {
|
||||
|
||||
List<AdminUserDO> user = userService.getListUserByDeptId(deptId);
|
||||
|
||||
return success(BeanUtils.toBean(user, UserRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@Operation(summary = "导出用户")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:export')")
|
||||
|
@ -53,6 +53,12 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
return selectList(AdminUserDO::getDeptId, deptIds);
|
||||
}
|
||||
|
||||
default List<AdminUserDO> selectListByDeptId(Long deptId, Long userId) {
|
||||
return selectList(new LambdaQueryWrapperX<AdminUserDO>()
|
||||
.eq(AdminUserDO::getDeptId, deptId)
|
||||
.ne(AdminUserDO::getId, userId));
|
||||
}
|
||||
|
||||
void emptyOpenId(@Param("openId") String openId);
|
||||
|
||||
List<UserRespVO> selectByDeptIds(Collection<Long> deptIds);
|
||||
|
@ -146,13 +146,21 @@ public interface AdminUserService {
|
||||
List<AdminUserDO> getUserListByDeptIds(Collection<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 获得指定岗位的用户数组
|
||||
* 获得指定部门组的用户数组
|
||||
*
|
||||
* @param deptIds 岗位数组
|
||||
* @param deptIds 部门数组
|
||||
* @return 用户数组
|
||||
*/
|
||||
List<UserRespVO> getUserByDeptIds(Collection<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 获得指定部门的用户数组(除去当前登录者用户)
|
||||
*
|
||||
* @param deptId 部门编号
|
||||
* @return 用户数组
|
||||
*/
|
||||
List<AdminUserDO> getListUserByDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 获得指定岗位的用户数组
|
||||
*
|
||||
|
@ -43,6 +43,7 @@ import java.util.stream.Collectors;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
@ -256,6 +257,12 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
return userMapper.selectByDeptIds(deptIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserDO> getListUserByDeptId(Long deptId) {
|
||||
|
||||
return userMapper.selectListByDeptId(deptId, getLoginUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserDO> getUserListByPostIds(Collection<Long> postIds) {
|
||||
if (CollUtil.isEmpty(postIds)) {
|
||||
|
Loading…
Reference in New Issue
Block a user