|
|
|
@ -97,6 +97,7 @@ public class UserService implements IUserService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 企业登录 |
|
|
|
* |
|
|
|
* @return 返回用户信息 |
|
|
|
*/ |
|
|
|
private UserVo.UserSign wxEnterpriseLogin(String identifier, String credential, String redirect) { |
|
|
|
@ -309,7 +310,6 @@ public class UserService implements IUserService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 账号登录 |
|
|
|
*/ |
|
|
|
@ -448,6 +448,7 @@ public class UserService implements IUserService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取企业微信信息,并绑定用户 |
|
|
|
* |
|
|
|
* @param identifyType 登录类型 |
|
|
|
* @param userid userId |
|
|
|
* @param corpId corpId |
|
|
|
@ -813,6 +814,54 @@ public class UserService implements IUserService { |
|
|
|
return userSignVo; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 绑定手机号(不用验证码) |
|
|
|
* |
|
|
|
* @param currentUserId userId |
|
|
|
* @param wxPhone 手机号 |
|
|
|
* @return 用户id和认证类型 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public UserVo.UserSign bindingPhoneNoCode(Long currentUserId, UserDto.WxBindingPhone wxPhone) { |
|
|
|
UserVo.UserSign userSignVo; |
|
|
|
//查找该用户以前绑定的手机
|
|
|
|
SysAuthExample authExample = new SysAuthExample(); |
|
|
|
authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) |
|
|
|
.andUserIdEqualTo(currentUserId); |
|
|
|
List<SysAuth> authList = authDao.selectByExample(authExample); |
|
|
|
if (CollectionUtil.isNotEmpty(authList)) { |
|
|
|
throw new BaseException(CodeEnum.ALREADY_BINDING_PHONE); |
|
|
|
} else { |
|
|
|
//改手机对应账户,如果有,提示
|
|
|
|
List<SysAuth> phoneList; |
|
|
|
SysAuthExample phoneExample = new SysAuthExample(); |
|
|
|
phoneExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) |
|
|
|
.andIdentifierEqualTo(wxPhone.getPhone()); |
|
|
|
phoneList = authDao.selectByExample(phoneExample); |
|
|
|
if (CollectionUtil.isNotEmpty(phoneList)) { |
|
|
|
throw new BaseException(CodeEnum.MERGE_WX_PHONE); |
|
|
|
} else { |
|
|
|
//绑定 添加auth
|
|
|
|
SysAuth auth = new SysAuth(); |
|
|
|
auth.setId(snowflake.nextId()); |
|
|
|
auth.setUserId(currentUserId); |
|
|
|
auth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Phone.value); |
|
|
|
auth.setIdentifier(wxPhone.getPhone()); |
|
|
|
authDao.insertSelective(auth); |
|
|
|
|
|
|
|
//给所有手机号一样的角色添加userId
|
|
|
|
relevanceUserService.relevancePhone(wxPhone.getPhone(), currentUserId); |
|
|
|
//返回值
|
|
|
|
userSignVo = new UserVo.UserSign(); |
|
|
|
userSignVo.setAuthId(auth.getId()); |
|
|
|
userSignVo.setUserId(auth.getUserId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return userSignVo; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 更改绑定手机号 |
|
|
|
*/ |
|
|
|
@ -931,6 +980,7 @@ public class UserService implements IUserService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 通过用户查找手机号 |
|
|
|
* |
|
|
|
* @param userId userId |
|
|
|
* @return 手机号 |
|
|
|
*/ |
|
|
|
@ -1030,6 +1080,7 @@ public class UserService implements IUserService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 合并账号 |
|
|
|
* |
|
|
|
* @param currentUserId userId |
|
|
|
* @param mergePhone 手机号和合并方式 |
|
|
|
* @return 用户id |
|
|
|
@ -1143,6 +1194,7 @@ public class UserService implements IUserService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改用户信息(添加微信信息) |
|
|
|
* |
|
|
|
* @return 返回信息 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
|