【8.1.7】【system】新增通过邮箱获取用户信息接口

dev-8.1.9
fengshuonan 2024-05-24 09:41:17 +08:00
parent 3dbcb13501
commit 7e2e6894fd
3 changed files with 37 additions and 1 deletions

View File

@ -190,4 +190,12 @@ public interface SysUserServiceApi {
*/
void simpleAddUser(AddUserDTO addUserDTO, Long orgId, Long positionId);
/**
*
*
* @author fengshuonan
* @since 2024/5/24 9:30
*/
UserInfoDetailDTO getUserDetailByEmail(String email);
}

View File

@ -73,7 +73,12 @@ public enum SysUserExceptionEnum implements AbstractExceptionEnum {
/**
* id
*/
ORG_ID_EMPTY_ERROR(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10012", "组织机构id为空请检查参数");
ORG_ID_EMPTY_ERROR(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10012", "组织机构id为空请检查参数"),
/**
*
*/
EMAIL_REPEAT(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10013", "用户邮箱存在重复");
/**
*

View File

@ -822,6 +822,29 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
BusinessLogUtil.addContent("用户详细信息如下:\n", simpleUser);
}
@Override
public UserInfoDetailDTO getUserDetailByEmail(String email) {
LambdaQueryWrapper<SysUser> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SysUser::getEmail, email);
lambdaQueryWrapper.select(SysUser::getUserId, SysUser::getRealName, SysUser::getNickName, SysUser::getAccount, SysUser::getBirthday, SysUser::getSex, SysUser::getEmail, SysUser::getPhone,
SysUser::getTel, SysUser::getSuperAdminFlag, SysUser::getStatusFlag, SysUser::getUserSort, SysUser::getMasterUserId);
List<SysUser> list = this.list(lambdaQueryWrapper);
if (ObjectUtil.isEmpty(list)) {
return null;
}
if (list.size() > 1) {
throw new ServiceException(SysUserExceptionEnum.EMAIL_REPEAT);
}
SysUser sysUser = list.get(0);
UserInfoDetailDTO userInfoDetailDTO = new UserInfoDetailDTO();
BeanUtil.copyProperties(sysUser, userInfoDetailDTO);
return userInfoDetailDTO;
}
/**
*
*