xiaoyong931011
2022-11-01 6ade62a98d839c0de53be32ee68dfacdfab92768
src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java
@@ -530,6 +530,7 @@
            dappWalletCoinEntity.setAvailableAmount(AppContants.TOURIST_INIT_MONEY);
            dappWalletCoinEntity.setFrozenAmount(AppContants.INIT_MONEY);
            dappWalletCoinEntity.setTotalAmount(AppContants.TOURIST_INIT_MONEY);
            dappWalletCoinEntity.setWalletCode("USDT");
            dappWalletCoinDao.insert(dappWalletCoinEntity);
        }
@@ -594,7 +595,7 @@
        }else{
            memberInfoVo.setInviteId(dappMemberEntity.getInviteId());
            memberInfoVo.setIdentityCode(identity);
            memberInfoVo.setIdentity("会员");
            memberInfoVo.setIdentity("Member");
            memberInfoVo.setUsername(dappMemberEntity.getUsername());
        }
        if(ObjectUtil.isNotEmpty(dappMemberEntity.getTransferCode())){
@@ -795,6 +796,7 @@
        dappWalletCoinEntity.setAvailableAmount(AppContants.INIT_MONEY);
        dappWalletCoinEntity.setFrozenAmount(AppContants.INIT_MONEY);
        dappWalletCoinEntity.setTotalAmount(AppContants.INIT_MONEY);
        dappWalletCoinEntity.setWalletCode("USDT");
        dappWalletCoinDao.insert(dappWalletCoinEntity);
        return new FebsResponse().success().message(MessageSourceUtils.getString("register_err_006"));
@@ -816,7 +818,7 @@
                if(DataDictionaryEnum.LEVEL_TM.getCode().equals(identity)){
                    apiMyTeammateInfoListVo.setLevelName("游客");
                }else{
                    apiMyTeammateInfoListVo.setLevelName("会员");
                    apiMyTeammateInfoListVo.setLevelName("Member");
                }
            }
        }
@@ -981,6 +983,27 @@
        return memberCoinChargeEntityIPage;
    }
    @Override
    public FebsResponse payUsdt(DappMemberEntity memberEntity) {
        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberEntity.getId());
        if(ObjectUtil.isEmpty(dappMemberEntity)){
            return new FebsResponse().fail().message("会员信息不存在");
        }
        BigDecimal coinNumber = memberEntity.getCoinNumber() == null ? BigDecimal.ZERO : memberEntity.getCoinNumber();
        if(BigDecimal.ZERO.compareTo(coinNumber) >= 0){
            return new FebsResponse().fail().message("请输入正确的金额");
        }
        DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberEntity.getId());
        if(ObjectUtil.isEmpty(dappWalletCoinEntity)){
            return new FebsResponse().fail().message("会员账户不存在");
        }
        dappWalletCoinDao.addTotalAndaddAvailableById(dappWalletCoinEntity.getId(),coinNumber);
        DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(memberEntity.getId(), coinNumber, "充值", 10);
        dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
        return new FebsResponse().success().message("操作成功");
    }
    public String generateAsaToken(String token) {
        RSA rsa = new RSA(null, AppContants.PUBLIC_KEY);
        return rsa.encryptBase64(token + "_" + System.currentTimeMillis(), KeyType.PublicKey);