diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java index 4f49b21..4edfbd3 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java @@ -119,23 +119,6 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl data = new HashedMap(); + 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 data = new HashedMap(); - 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 userAccountList = hrUserAccountMapper.selectList(new QueryWrapper() .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(