| | |
| | | @Override |
| | | public void userBuyReward(Long id) { |
| | | // 系统未启动不参与 |
| | | String hasStart = redisUtils.getString(AppContants.SYSTEM_START_FLAG); |
| | | if (!"start".equals(hasStart)) { |
| | | if (!systemHasStart()) { |
| | | return; |
| | | } |
| | | |
| | |
| | | DappMemberEntity member = dappMemberDao.selectById(fundFlow.getMemberId()); |
| | | DappMemberEntity referer = dappMemberDao.selectMemberInfoByInviteId(member.getRefererId()); |
| | | if (referer == null || "admin".equals(referer.getAccountType())) { |
| | | return; |
| | | } |
| | | |
| | | if (!hasProfit(referer.getAddress())) { |
| | | return; |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | BigDecimal balance = ChainService.getInstance(ChainEnum.BSC_TFC.name()).balanceOf(member.getAddress()); |
| | | BigDecimal usdtBalance = balance.multiply(newestPrice()); |
| | | |
| | | DataDictionaryCustom data = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.DIC_TYPE_SYSTEM_SETTING, AppContants.DIC_VALUE_MINI_HOLD_COIN_LIMIT); |
| | | BigDecimal miniLimit = new BigDecimal(data.getValue()); |
| | | if (usdtBalance.compareTo(miniLimit) < 0) { |
| | | if (!hasProfit(parent.getAddress())) { |
| | | return; |
| | | } |
| | | |
| | |
| | | return new BigDecimal("0.05"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean hasProfit(String address) { |
| | | BigDecimal balance = ChainService.getInstance(ChainEnum.BSC_TFC.name()).balanceOf(address); |
| | | BigDecimal usdtBalance = balance.multiply(newestPrice()); |
| | | |
| | | DataDictionaryCustom data = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.DIC_TYPE_SYSTEM_SETTING, AppContants.DIC_VALUE_MINI_HOLD_COIN_LIMIT); |
| | | BigDecimal miniLimit = new BigDecimal(data.getValue()); |
| | | if (usdtBalance.compareTo(miniLimit) < 0) { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |