Merge remote-tracking branch 'base-version/main' into dev
This commit is contained in:
@@ -76,4 +76,7 @@ public class DeptSaveReqVO {
|
||||
@Schema(description = "部门来源类型", example = "1")
|
||||
private Integer deptSource;
|
||||
|
||||
@Schema(description = "内部使用:延迟生成部门编码", hidden = true)
|
||||
private Boolean delayCodeGeneration;
|
||||
|
||||
}
|
||||
|
||||
@@ -94,8 +94,9 @@ public class UserController {
|
||||
|
||||
@GetMapping({"/list-all-simple", "/simple-list"})
|
||||
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项")
|
||||
public CommonResult<List<UserSimpleRespVO>> getSimpleUserList() {
|
||||
List<AdminUserDO> list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus(), SIMPLE_LIST_LIMIT);
|
||||
public CommonResult<List<UserSimpleRespVO>> getSimpleUserList(
|
||||
@RequestParam(value = "keyword", required = false) String keyword) {
|
||||
List<AdminUserDO> list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus(), SIMPLE_LIST_LIMIT, keyword);
|
||||
return success(UserConvert.INSTANCE.convertSimpleList(list));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@ public class UserPageReqVO extends PageParam {
|
||||
@Schema(description = "用户账号,模糊匹配", example = "zt")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "用户昵称,模糊匹配", example = "张三")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "工号,模糊匹配", example = "A00123")
|
||||
private String workcode;
|
||||
|
||||
|
||||
@@ -114,12 +114,15 @@ public interface DeptMapper extends BaseMapperX<DeptDO> {
|
||||
* @param parentId 父部门ID
|
||||
* @return 编码最大的子部门
|
||||
*/
|
||||
default DeptDO selectLastChildByCode(Long parentId) {
|
||||
return selectOne(new LambdaQueryWrapper<DeptDO>()
|
||||
default DeptDO selectLastChildByCode(Long parentId, String prefix) {
|
||||
LambdaQueryWrapper<DeptDO> wrapper = new LambdaQueryWrapper<DeptDO>()
|
||||
.eq(DeptDO::getParentId, parentId)
|
||||
.isNotNull(DeptDO::getCode)
|
||||
.orderByDesc(DeptDO::getCode)
|
||||
.last("LIMIT 1"));
|
||||
.isNotNull(DeptDO::getCode);
|
||||
if (StrUtil.isNotBlank(prefix)) {
|
||||
wrapper.likeRight(DeptDO::getCode, prefix);
|
||||
}
|
||||
wrapper.orderByDesc(DeptDO::getCode).last("LIMIT 1");
|
||||
return selectOne(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,6 +40,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
MPJLambdaWrapperX<AdminUserDO> query = new MPJLambdaWrapperX<>();
|
||||
query.leftJoin(UserDeptDO.class, UserDeptDO::getUserId, AdminUserDO::getId);
|
||||
query.likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername());
|
||||
query.likeIfPresent(AdminUserDO::getNickname, reqVO.getNickname());
|
||||
query.likeIfPresent(AdminUserDO::getWorkcode, reqVO.getWorkcode());
|
||||
query.likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile());
|
||||
query.eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus());
|
||||
@@ -70,9 +71,16 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
return selectList(new LambdaQueryWrapperX<AdminUserDO>().like(AdminUserDO::getNickname, nickname));
|
||||
}
|
||||
|
||||
default List<AdminUserDO> selectListByStatus(Integer status, Integer limit) {
|
||||
default List<AdminUserDO> selectListByStatus(Integer status, Integer limit, String keyword) {
|
||||
LambdaQueryWrapperX<AdminUserDO> query = new LambdaQueryWrapperX<AdminUserDO>()
|
||||
.eq(AdminUserDO::getStatus, status);
|
||||
if (StrUtil.isNotBlank(keyword)) {
|
||||
String trimmed = keyword.trim();
|
||||
query.and(w -> w.like(AdminUserDO::getNickname, trimmed)
|
||||
.or().like(AdminUserDO::getUsername, trimmed)
|
||||
.or().like(AdminUserDO::getMobile, trimmed)
|
||||
.or().like(AdminUserDO::getWorkcode, trimmed));
|
||||
}
|
||||
if (limit != null && limit > 0) {
|
||||
query.last("LIMIT " + limit);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -193,10 +193,14 @@ public interface AdminUserService {
|
||||
* @param status 状态
|
||||
* @return 用户们
|
||||
*/
|
||||
List<AdminUserDO> getUserListByStatus(Integer status, Integer limit);
|
||||
List<AdminUserDO> getUserListByStatus(Integer status, Integer limit, String keyword);
|
||||
|
||||
default List<AdminUserDO> getUserListByStatus(Integer status, Integer limit) {
|
||||
return getUserListByStatus(status, limit, null);
|
||||
}
|
||||
|
||||
default List<AdminUserDO> getUserListByStatus(Integer status) {
|
||||
return getUserListByStatus(status, null);
|
||||
return getUserListByStatus(status, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -664,8 +664,8 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserDO> getUserListByStatus(Integer status, Integer limit) {
|
||||
List<AdminUserDO> users = userMapper.selectListByStatus(status, limit);
|
||||
public List<AdminUserDO> getUserListByStatus(Integer status, Integer limit, String keyword) {
|
||||
List<AdminUserDO> users = userMapper.selectListByStatus(status, limit, keyword);
|
||||
fillUserDeptInfo(users);
|
||||
return users;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user