| | |
| | | DappMemberEntity member = dappMemberDao.selectByAddress(connectDto.getAddress(), null); |
| | | |
| | | if (member == null) { |
| | | // DappMemberEntity parent = dappMemberDao.selectMemberInfoByInviteId(connectDto.getInviteId()); |
| | | // if (parent == null) { |
| | | // throw new FebsException("邀请人不存在"); |
| | | // } |
| | | if (!"asdf4321".equals(connectDto.getInviteId())) { |
| | | DappMemberEntity parent = dappMemberDao.selectMemberInfoByInviteId(connectDto.getInviteId()); |
| | | if (parent == null) { |
| | | throw new FebsException("recommender is not exist"); |
| | | } |
| | | |
| | | throw new FebsException(MessageSourceUtils.getString("system_regist_error")); |
| | | // member = insertMember(connectDto.getAddress(), null); |
| | | List<DappMemberEntity> child = dappMemberDao.selectChildMemberDirectOrNot(connectDto.getInviteId(), 1); |
| | | if (child.size() == 6) { |
| | | throw new FebsException("Invite Code is Invalid"); |
| | | } |
| | | } |
| | | member = insertMember(connectDto.getAddress(), null); |
| | | } |
| | | |
| | | // if (member.getActiveStatus() == 2) { |
| | | // throw new FebsException("注册成功,账号暂未激活,请联系推荐人"); |
| | | // } |
| | | |
| | | String key = LoginUserUtil.getLoginKey(connectDto.getAddress(), connectDto.getNonce(), connectDto.getSign()); |
| | | redisUtils.set(connectDto.getAddress(), member); |
| | |
| | | member.setBalance(ChainService.getInstance(ChainEnum.BSC_TFC.name()).balanceOf(address)); |
| | | member.setUsdtBalance(ChainService.getInstance(ChainEnum.BSC_USDT.name()).balanceOf(address)); |
| | | |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.DIC_TYPE_SYSTEM_SETTING, AppContants.DIC_VALUE_SYSTEM_NODE_CNT_LIMIT); |
| | | int nodeCntLimit = Integer.parseInt(dic.getValue()); |
| | | |
| | | List<DappMemberEntity> memberCount = dappMemberDao.selectList(null); |
| | | if (memberCount.size() <= (nodeCntLimit + 4)) { |
| | | member.setNodeType(1); |
| | | } else { |
| | | member.setNodeType(2); |
| | | } |
| | | dappMemberDao.insert(member); |
| | | |
| | | DappWalletCoinEntity walletCoin = new DappWalletCoinEntity(); |
| | |
| | | String ids = ""; |
| | | String feeProfitIds = ""; |
| | | |
| | | int i = 1; |
| | | List<DataDictionaryCustom> feeProfitDic = dataDictionaryCustomMapper.selectDicByType(AppContants.DIC_TYPE_DISTRIBUTE_PROP); |
| | | while (!flag && StringUtils.isNotBlank(parentId)) { |
| | | if (StrUtil.isBlank(ids)) { |
| | | ids += parentId; |
| | |
| | | ids += ("," + parentId); |
| | | } |
| | | |
| | | if (i <= feeProfitDic.size()) { |
| | | if (StrUtil.isBlank(feeProfitIds)) { |
| | | feeProfitIds += parentId; |
| | | } else { |
| | | feeProfitIds += ("," + parentId); |
| | | } |
| | | if (StrUtil.isBlank(feeProfitIds)) { |
| | | feeProfitIds += parentId; |
| | | } else { |
| | | feeProfitIds += ("," + parentId); |
| | | } |
| | | |
| | | i++; |
| | | DappMemberEntity parentMember = dappMemberDao.selectMemberInfoByInviteId(parentId); |
| | | if (parentMember == null) { |
| | | break; |