|
|
@@ -11,8 +11,8 @@ import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.basic.util.CollUtils; |
|
|
|
import com.ningdatech.kqapi.common.constant.BizConst; |
|
|
|
import com.ningdatech.kqapi.common.enumeration.RoleEnum; |
|
|
|
import com.ningdatech.kqapi.security.constant.AuthTypeEnum; |
|
|
|
import com.ningdatech.kqapi.security.model.UserInfoDetails; |
|
|
|
import com.ningdatech.kqapi.user.model.entity.UserAuth; |
|
|
|
import com.ningdatech.kqapi.user.model.entity.UserInfo; |
|
|
|
import com.ningdatech.kqapi.user.model.enumerization.AccountStatus; |
|
|
@@ -20,8 +20,8 @@ import com.ningdatech.kqapi.user.model.po.ChangeAccountStatusReq; |
|
|
|
import com.ningdatech.kqapi.user.model.po.ModifyPasswordReq; |
|
|
|
import com.ningdatech.kqapi.user.model.po.SaveUserReq; |
|
|
|
import com.ningdatech.kqapi.user.model.po.UserListReq; |
|
|
|
import com.ningdatech.kqapi.user.model.vo.UserListVO; |
|
|
|
import com.ningdatech.kqapi.user.model.vo.UserBasicInfoVO; |
|
|
|
import com.ningdatech.kqapi.user.model.vo.ResUserListVO; |
|
|
|
import com.ningdatech.kqapi.user.model.vo.UserDetailVO; |
|
|
|
import com.ningdatech.kqapi.user.service.IUserAuthService; |
|
|
|
import com.ningdatech.kqapi.user.service.IUserInfoService; |
|
|
@@ -136,33 +136,30 @@ public class UserInfoManage { |
|
|
|
.userName(info.getUsername()) |
|
|
|
.avatarFileId(info.getAvatarFileId()) |
|
|
|
.phoneNo(info.getMobile()) |
|
|
|
.role(RoleEnum.valueOf(info.getRole())) |
|
|
|
.accountStatus(info.getAccountStatus()) |
|
|
|
.build(); |
|
|
|
} |
|
|
|
|
|
|
|
public PageVo<ResUserListVO> listUser(UserListReq req) { |
|
|
|
public PageVo<UserListVO> listUser(UserListReq req) { |
|
|
|
// 获取入参 |
|
|
|
String realName = req.getRealName(); |
|
|
|
// 获取区域列表 |
|
|
|
Wrapper<UserInfo> query = Wrappers.lambdaQuery(UserInfo.class) |
|
|
|
.like(StrUtil.isNotBlank(realName), UserInfo::getRealName, realName) |
|
|
|
.eq(StrUtil.isNotBlank(req.getMobile()), UserInfo::getMobile, req.getMobile()) |
|
|
|
.eq(req.getRole() != null, UserInfo::getRole, req.getRole()) |
|
|
|
.orderByDesc(UserInfo::getUpdateOn); |
|
|
|
Page<UserInfo> page = userInfoService.page(req.page(), query); |
|
|
|
PageVo<ResUserListVO> pageVo = new PageVo<>(); |
|
|
|
PageVo<UserListVO> pageVo = new PageVo<>(); |
|
|
|
long total = page.getTotal(); |
|
|
|
pageVo.setTotal(total); |
|
|
|
if (total > 0) { |
|
|
|
Function<UserInfo, ResUserListVO> mapping = r -> { |
|
|
|
ResUserListVO res = new ResUserListVO(); |
|
|
|
Function<UserInfo, UserListVO> mapping = r -> { |
|
|
|
UserListVO res = new UserListVO(); |
|
|
|
res.setUserId(r.getId()); |
|
|
|
res.setRealName(r.getRealName()); |
|
|
|
res.setCreateTime(r.getCreateOn()); |
|
|
|
res.setPhoneNo(r.getMobile()); |
|
|
|
res.setAccountStatus(r.getAccountStatus()); |
|
|
|
BizUtils.notBlank(r.getRole(), w -> res.setRole(RoleEnum.valueOf(w))); |
|
|
|
return res; |
|
|
|
}; |
|
|
|
pageVo.setRecords(CollUtils.convert(page.getRecords(), mapping)); |
|
|
@@ -171,15 +168,10 @@ public class UserInfoManage { |
|
|
|
} |
|
|
|
|
|
|
|
public UserBasicInfoVO getBasicInfo() { |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
UserInfo userInfo = userInfoService.getById(userId); |
|
|
|
UserInfoDetails details = LoginUserUtil.loginUserDetail(); |
|
|
|
UserBasicInfoVO result = new UserBasicInfoVO(); |
|
|
|
result.setUserId(userId); |
|
|
|
result.setRealName(userInfo.getRealName()); |
|
|
|
BizUtils.notBlank(userInfo.getRole(), role -> { |
|
|
|
result.setRole(RoleEnum.valueOf(role)); |
|
|
|
result.setRoleName(result.getRole().getDisplayName()); |
|
|
|
}); |
|
|
|
result.setUserId(details.getUserId()); |
|
|
|
result.setRealName(details.getRealName()); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|