Merge remote-tracking branch 'origin/main' into main

main
rong.liu 11 months ago
commit d40f448e8d
  1. 46
      nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java
  2. 11
      users/src/main/java/com/huoran/users/service/impl/HrUserAccountServiceImpl.java

@ -119,23 +119,6 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
data.put("token", JwtUtils.getJwtToken(userAccount.getId().toString()));
userExists = true; // 如果用户存在,将标志位设为true
break; // 如果找到用户,就不需要继续查找
}else {
//根据手机号查询用户
UserAccount userAccountByPhone = baseMapper.selectAccount(appletCallbackReq.getPhone(),platformId.toString());
if (userAccountByPhone!= null){
if (!userAccount.getIsEnable()){
throw new CustomException(ExceptionEnum.ACCOUNT_DISABLED);
}
//邀请添加用户没有openid,登录更新openId
baseMapper.updateAccountOpenId(openid,userAccountByPhone.getId());
//更新登录时间
baseMapper.updateUserInfo(userAccount.getUserId());
data.put("state", "login");
data.put("platformId", platformId);
data.put("token", JwtUtils.getJwtToken(userAccount.getId().toString()));
userExists = true; // 如果用户存在,将标志位设为true
break; // 如果找到用户,就不需要继续查找
}
}
}
@ -156,16 +139,29 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
if (userAccount != null){
return R.error("该用户已存在");
}
Map<String, Object> data = new HashedMap<String, Object>();
if (appletCallbackReq.getPhone()!= null){
UserAccount userAccountByPhone = baseMapper.selectAccount(appletCallbackReq.getPhone(),appletCallbackReq.getPlatformId().toString());
//根据手机号查询用户
if (userAccountByPhone != null){
return R.error("该用户已存在");
if (!userAccountByPhone.getIsEnable()){
throw new CustomException(ExceptionEnum.ACCOUNT_DISABLED);
}
//邀请添加用户没有openid,登录更新openId
baseMapper.updateAccountOpenId(appletCallbackReq.getOpenId(),userAccountByPhone.getId());
//更新登录时间
baseMapper.updateUserInfo(userAccountByPhone.getUserId());
data.put("token", JwtUtils.getJwtToken(userAccountByPhone.getId().toString()));
data.put("openId", appletCallbackReq.getOpenId());
//TODO 团队信息待处理
// data.put("teamId",platformTeamClassification.getId());
// data.put("teamName",teamName);
}
Map<String, Object> data = new HashedMap<String, Object>();
String randomNumbers = cn.hutool.core.util.RandomUtil.randomNumbers(6);
}
String randomNumber5 = cn.hutool.core.util.RandomUtil.randomNumbers(5);
String randomNumber6 = cn.hutool.core.util.RandomUtil.randomNumbers(6);
String randomNumber7 = cn.hutool.core.util.RandomUtil.randomNumbers(7);
Integer accountId ;
String userName = "";
@ -175,18 +171,18 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
if (StringUtils.isNotBlank(appletCallbackReq.getOrganizationName())){
userName = appletCallbackReq.getOrganizationName();
}else {
userName = "幼儿园" + randomNumbers;
userName = "幼儿园" + randomNumber5;
}
break;
case 6:
if (StringUtils.isNotBlank(appletCallbackReq.getOrganizationName())){
userName = appletCallbackReq.getOrganizationName();
}else {
userName = "供应商" + randomNumbers;
userName = "供应商" + randomNumber6;
}
break;
case 7:
userName = "个人" + randomNumbers;
userName = "个人" + randomNumber7;
break;
}
@ -195,7 +191,7 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
// 如果平台ID不是7,添加供应商/幼儿园信息和团队信息,默认添加个人端信息
if (appletCallbackReq.getPlatformId() != 7) {
//添加个人端信息
String personalUserName = "个人" + randomNumbers;
String personalUserName = "个人" + randomNumber7;
addUserInfo(personalUserName, 7, appletCallbackReq.getOpenId(), appletCallbackReq.getPhone());
// 添加供应商/幼儿园信息

@ -409,9 +409,14 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
List<HrUserAccount> userAccountList = hrUserAccountMapper.selectList(new QueryWrapper<HrUserAccount>()
.eq("app_open_id", openId));
//查询用户信息
HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(userAccountList.get(0).getUserId());
hrUserInfo.setPhone(userAccountList.get(0).getPhone());
//查询个人端用户信息
Integer userId = null;
for (HrUserAccount hrUserAccount : userAccountList) {
if (hrUserAccount.getPlatformId().equals("7")){
userId = hrUserAccount.getUserId();
}
}
HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(userId);
hrUserInfo.setAuthentication("未认证");
UserAuthenticationInformation authenticationInformation = userAuthenticationInformationMapper.selectOne(

Loading…
Cancel
Save