fix
Helius
2022-06-11 974b3d7af09e9911462c3e3adb816ddfeec24d2b
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -52,12 +52,16 @@
        Map<String, BigDecimal> map = dappFundFlowDao.selectAmountTotalByType(member.getId());
        WalletInfoVo walletInfo = new WalletInfoVo();
        List<DappMemberEntity> direct = dappMemberDao.selectChildMemberDirectOrNot(member.getInviteId(), 1);
        List<DappMemberEntity> notDirect = dappMemberDao.selectChildMemberDirectOrNot(member.getInviteId(), 2);
        BigDecimal childHoldAmount = dappMemberDao.selectChildHoldAmount(member.getInviteId());
        walletInfo.setTotalChild(10000);
        walletInfo.setDirectCnt(100);
        walletInfo.setTotalChildCoin(BigDecimal.valueOf(1));
        walletInfo.setTotalChild(notDirect.size());
        walletInfo.setDirectCnt(direct.size());
        walletInfo.setTotalChildCoin(childHoldAmount);
        walletInfo.setTeamReward(map.get("teamReward"));
        walletInfo.setMiningAmount(map.get("mine"));
        walletInfo.setInviteId(member.getInviteId());
        return walletInfo;
    }
@@ -213,8 +217,8 @@
        // 铸池中的币的剩余量
        BigDecimal makeCoinRemain = (BigDecimal) redisUtils.get(AppContants.REDIS_KEY_MAKE_POOL_CNT);
        String hasStart = redisUtils.getString(AppContants.SYSTEM_START_FLAG);
        if (transferDto.getId() == null) {
            String hasStart = redisUtils.getString(AppContants.SYSTEM_START_FLAG);
            if (DappFundFlowEntity.TYPE_SALE == transferDto.getType()) {
                if (!"start".equals(hasStart)) {
                    throw new FebsException("系统还未启动");
@@ -262,12 +266,18 @@
                // 修改用户24小时可售量
                redisUtils.set(AppContants.REDIS_KEY_COIN_REMAIN + member.getAddress(), saleCoinRemain);
            } else if (DappFundFlowEntity.TYPE_BUY == transferDto.getType()) {
                buyCoinRemain = buyCoinRemain.subtract(flow.getAmount());
                if ("start".equals(hasStart)) {
                    buyCoinRemain = buyCoinRemain.subtract(flow.getAmount());
                // 修改当日可购买量
                redisUtils.set(AppContants.REDIS_KEY_TRANSFER_POOL_VOL_REMAIN, buyCoinRemain);
                    // 修改当日可购买量
                    redisUtils.set(AppContants.REDIS_KEY_TRANSFER_POOL_VOL_REMAIN, buyCoinRemain);
                } else {
                    makeCoinRemain = makeCoinRemain.subtract(flow.getAmount());
                    // 修改铸池量
                    redisUtils.set(AppContants.REDIS_KEY_MAKE_POOL_CNT, makeCoinRemain);
                }
            } else {
                throw new FebsException("参数错误");
            }
        } else {
@@ -280,6 +290,15 @@
    public Map<String, BigDecimal> calPrice() {
        DappMemberEntity member = LoginUserUtil.getAppUser();
        String hasStart = redisUtils.getString(AppContants.SYSTEM_START_FLAG);
        if (!"start".equals(hasStart)) {
            HashMap<String, BigDecimal> map = new HashMap<>();
            map.put("x", new BigDecimal("0.075"));
            map.put("y", new BigDecimal("100000"));
            return map;
        }
        ContractChainService tfcInstance = ChainService.getInstance(ChainEnum.BSC_TFC.name());
        // u剩余数量
        BigDecimal sourceU = ChainService.getInstance(ChainEnum.BSC_USDT.name()).balanceOf(ChainEnum.BSC_USDT_SOURCE.getAddress());