|
|
@@ -21,7 +21,7 @@ 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.LoginUserDetailVO; |
|
|
|
import com.ningdatech.kqapi.user.model.vo.UserDetailVO; |
|
|
|
import com.ningdatech.kqapi.user.service.IUserAuthService; |
|
|
|
import com.ningdatech.kqapi.user.service.IUserInfoService; |
|
|
@@ -36,7 +36,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.*; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@@ -158,27 +158,24 @@ public class UserInfoManage { |
|
|
|
.eq(StrUtil.isNotBlank(req.getMobile()), UserInfo::getMobile, req.getMobile()) |
|
|
|
.orderByDesc(UserInfo::getUpdateOn); |
|
|
|
Page<UserInfo> page = userInfoService.page(req.page(), query); |
|
|
|
PageVo<UserListVO> pageVo = new PageVo<>(); |
|
|
|
long total = page.getTotal(); |
|
|
|
pageVo.setTotal(total); |
|
|
|
if (total > 0) { |
|
|
|
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()); |
|
|
|
return res; |
|
|
|
}; |
|
|
|
pageVo.setRecords(CollUtils.convert(page.getRecords(), mapping)); |
|
|
|
if (page.getTotal() == 0) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
return pageVo; |
|
|
|
List<UserListVO> data = page.getRecords().stream().map(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()); |
|
|
|
return res; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
return PageVo.of(data, page.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
public UserBasicInfoVO getBasicInfo() { |
|
|
|
public LoginUserDetailVO loginUserDetail() { |
|
|
|
UserInfoDetails details = LoginUserUtil.loginUserDetail(); |
|
|
|
UserBasicInfoVO result = new UserBasicInfoVO(); |
|
|
|
LoginUserDetailVO result = new LoginUserDetailVO(); |
|
|
|
result.setUserId(details.getUserId()); |
|
|
|
result.setRealName(details.getRealName()); |
|
|
|
return result; |
|
|
@@ -189,8 +186,7 @@ public class UserInfoManage { |
|
|
|
.eq(UserAuth::getIdentifier, identifier) |
|
|
|
.ne(userId != null, UserAuth::getUserId, userId) |
|
|
|
.last(BizConst.LIMIT_1); |
|
|
|
UserAuth userAuth = userAuthService.getOne(query); |
|
|
|
if (Objects.nonNull(userAuth)) { |
|
|
|
if (userAuthService.count(query) > 0) { |
|
|
|
throw new BizException("当前账号已经注册"); |
|
|
|
} |
|
|
|
|
|
|
|