From 3dbd512ddb63e4949388000f7579fd2c0d1bbc96 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Mon, 20 Feb 2023 09:27:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=9D=83=E9=99=90=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/user/manage/UserAuthLoginManage.java | 48 ++++++++++------------ 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java index 644e1c9..4f845ae 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java @@ -46,12 +46,14 @@ public class UserAuthLoginManage { * @return */ public UserFullInfoDTO queryUserInfoInPasswordAuth(String username) { + // TODO 目前账号密码登陆测试使用 强制用户登录 userId 1L + UserInfo userInfo = iUserInfoService.getById(1L); + if (Objects.isNull(userInfo)) { + return null; + } + // 返回用户全量信息 UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); -// userFullInfoDTO.setCompanyId(1L); - userFullInfoDTO.setUserId(1L); - userFullInfoDTO.setIdentifier("123456"); - userFullInfoDTO.setRealName("测试账号"); - userFullInfoDTO.setUsername("测试账号"); + userFullInfoDTOAssembler(userInfo, userFullInfoDTO); return userFullInfoDTO; } @@ -62,26 +64,14 @@ public class UserAuthLoginManage { * @return */ public UserFullInfoDTO queryUserInfoInPhoneNoAuth(String phoneNo) { -// UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) -// .eq(UserInfo::getMobile, phoneNo)); -// if (Objects.isNull(userInfo)) { -// return null; -// } -// -// UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); -// userFullInfoDTO.setCompanyId(1L); -// userFullInfoDTO.setUserId(userInfo.getId()); -// userFullInfoDTO.setIdentifier(userInfo.getRealName()); -// userFullInfoDTO.setRealName(userInfo.getRealName()); -// userFullInfoDTO.setUsername(userInfo.getRealName()); -// return userFullInfoDTO; - + UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) + .eq(UserInfo::getMobile, phoneNo)); + if (Objects.isNull(userInfo)) { + return null; + } + // 返回用户全量信息 UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); -// userFullInfoDTO.setCompanyId(1L); - userFullInfoDTO.setUserId(1L); - userFullInfoDTO.setIdentifier("123456"); - userFullInfoDTO.setRealName("测试账号"); - userFullInfoDTO.setUsername("测试账号"); + userFullInfoDTOAssembler(userInfo, userFullInfoDTO); return userFullInfoDTO; } @@ -92,8 +82,6 @@ public class UserAuthLoginManage { * @return */ public UserFullInfoDTO queryUserInfoInAccountIdAuth(String accountId) { - // 返回用户全量信息 - UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); // 获取用户信息 UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) @@ -101,7 +89,14 @@ public class UserAuthLoginManage { if (Objects.isNull(userInfo)) { return null; } + // 返回用户全量信息 + UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); + userFullInfoDTOAssembler(userInfo, userFullInfoDTO); + return userFullInfoDTO; + } + + private void userFullInfoDTOAssembler(UserInfo userInfo, UserFullInfoDTO userFullInfoDTO) { // 获取浙政钉雇员信息 组织信息 String employeeCode = userInfo.getEmployeeCode(); if (StringUtils.isNotBlank(employeeCode)) { @@ -140,6 +135,5 @@ public class UserAuthLoginManage { userFullInfoDTO.setIdentifier(userInfo.getRealName()); userFullInfoDTO.setRealName(userInfo.getRealName()); userFullInfoDTO.setUsername(userInfo.getRealName()); - return userFullInfoDTO; } }