From d7724781676ab540d01f7128f42d2057c4a228f1 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 5 May 2023 17:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/helper/impl/UserInfoHelperImpl.java | 3 ++- .../ningdatech/pmapi/user/service/IUserInfoService.java | 2 ++ .../pmapi/user/service/impl/UserInfoServiceImpl.java | 17 ++++++++++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java index 2172558..1551e98 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java @@ -143,7 +143,8 @@ public class UserInfoHelperImpl implements UserInfoHelper { @Override public UserFullInfoDTO getUserFullInfoByEmployeeCode(String employeeCode) { - return getUserFullInfoByEmployeeCode(employeeCode); + UserInfo userInfo = userInfoService.getUserInfoByEmployeeCode(employeeCode); + return getUserFullInfo(userInfo); } @Override diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java index a5ef005..c285c2c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java @@ -15,4 +15,6 @@ public interface IUserInfoService extends IService { UserInfo getUserInfoByPhoneNo(String phoneNo); + UserInfo getUserInfoByEmployeeCode(String employeeCode); + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java index 929cf3c..ba023a4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.user.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ningdatech.pmapi.user.entity.UserInfo; @@ -20,16 +21,22 @@ import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor public class UserInfoServiceImpl extends ServiceImpl implements IUserInfoService { - private final NdUserInfoMapper userInfoMapper; @Override public UserInfo getUserInfoByPhoneNo(String phoneNo) { if (StringUtils.isEmpty(phoneNo)) { return null; } - UserInfo userInfo = userInfoMapper - .selectOne(Wrappers.lambdaQuery(UserInfo.class) - .eq(UserInfo::getMobile, phoneNo)); - return userInfo; + LambdaQueryWrapper query = Wrappers.lambdaQuery(UserInfo.class) + .eq(UserInfo::getMobile, phoneNo); + return getOne(query); } + + @Override + public UserInfo getUserInfoByEmployeeCode(String employeeCode) { + LambdaQueryWrapper query = Wrappers.lambdaQuery(UserInfo.class) + .eq(UserInfo::getEmployeeCode, employeeCode); + return getOne(query); + } + }