Commit fc9205cd by guojuxing

单点登录创建运维账号修复:根据手机号和账号类型查询

parent 12a56d13
...@@ -127,6 +127,18 @@ public interface UserApiService { ...@@ -127,6 +127,18 @@ public interface UserApiService {
ServiceResponse<UserDTO> listUserByPhoneNumber(String nationCode, String phoneNumber, Integer enterpriseId); ServiceResponse<UserDTO> listUserByPhoneNumber(String nationCode, String phoneNumber, Integer enterpriseId);
/**
* 获取运维账号
* @Title: getUserByPhoneNumber

* @Description:

* @author guojuxing
* @param nationCode 手机区号
* @param phoneNumber 手机号码
* @param enterpriseId 商户ID
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.UserDTO>


*/
ServiceResponse<UserDTO> getUserByPhoneNumber(String nationCode, String phoneNumber, Integer enterpriseId);
ServiceResponse<UserDTO> login(String nationCode, String phoneNumber, Integer enterpriseId, String password); ServiceResponse<UserDTO> login(String nationCode, String phoneNumber, Integer enterpriseId, String password);
/** /**
......
...@@ -358,6 +358,23 @@ public class UserApiServiceImpl implements UserApiService { ...@@ -358,6 +358,23 @@ public class UserApiServiceImpl implements UserApiService {
} }
@Override @Override
public ServiceResponse<UserDTO> getUserByPhoneNumber(String nationCode, String phoneNumber, Integer enterpriseId) {
if (enterpriseId == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户数据为空");
}
List<TabSysUser> list = this.userService.listUserByPhoneNumberAndEnterprise(phoneNumber, nationCode,
enterpriseId);
if (CollectionUtils.isNotEmpty(list)) {
for (TabSysUser tabSysUser : list) {
if (tabSysUser.getLoginType() == 1) {
return ServiceResponse.success(EntityUtil.changeEntityNew(UserDTO.class, tabSysUser));
}
}
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<UserDTO> login(String nationCode, String phoneNumber, Integer enterpriseId, public ServiceResponse<UserDTO> login(String nationCode, String phoneNumber, Integer enterpriseId,
String password) { String password) {
TabSysUser user = this.userService.login(nationCode, phoneNumber, enterpriseId, password); TabSysUser user = this.userService.login(nationCode, phoneNumber, enterpriseId, password);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment