| | |
| | | result.put("coinCnt", coinCnt); |
| | | result.put("sourceTFC", ChainService.getInstance(ChainEnum.BSC_TFC.name()).balanceOf(ChainEnum.BSC_TFC_SOURCE.getAddress())); |
| | | result.put("sourceUSDT", ChainService.getInstance(ChainEnum.BSC_USDT.name()).balanceOf(ChainEnum.BSC_USDT_SOURCE.getAddress())); |
| | | // BigInteger nftCount = ChainService.getInstance(ChainEnum.BSC_NFT_SDC.name()).totalSupplyNFT(); |
| | | // int count = nftCount == null ? 0 : nftCount.intValue(); |
| | | result.put("cardCnt", 1000); |
| | | result.put("nftPrice", AppContants.NFT_ACTIVE_PRICE); |
| | | return result; |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | DataDictionaryCustom data = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.DIC_TYPE_SYSTEM_SETTING, AppContants.DIC_VALUE_MINI_HOLD_COIN_LIMIT); |
| | | BigDecimal miniLimit = new BigDecimal(data.getValue()); |
| | | if (fundFlow.getTargetAmount().compareTo(miniLimit) < 0) { |
| | | return; |
| | | } |
| | | |
| | | if (!hasProfit(parent.getAddress())) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | DappMemberBoxRecordEntity memberBoxRecordEntity = new DappMemberBoxRecordEntity(); |
| | | memberBoxRecordEntity.setMemberId(parent.getId()); |
| | | memberBoxRecordEntity.setAddress(parent.getAddress()); |
| | | memberBoxRecordEntity.setFromMemberId(member.getId()); |
| | | memberBoxRecordEntity.setFromAddress(member.getAddress()); |
| | | this.dappMemberBoxRecordMapper.insert(memberBoxRecordEntity); |
| | | |
| | | if (box > 0) { |
| | | DappWalletCoinEntity walletCoin = dappWalletCoinDao.selectByMemberId(parent.getId()); |
| | | walletCoin.setBoxCnt(walletCoin.getBoxCnt() + box); |
| | | dappWalletCoinDao.updateById(walletCoin); |
| | | |
| | | DappMemberBoxRecordEntity memberBoxRecordEntity = new DappMemberBoxRecordEntity(); |
| | | memberBoxRecordEntity.setMemberId(parent.getId()); |
| | | memberBoxRecordEntity.setAddress(parent.getAddress()); |
| | | memberBoxRecordEntity.setFromMemberId(member.getId()); |
| | | memberBoxRecordEntity.setFromAddress(member.getAddress()); |
| | | this.dappMemberBoxRecordMapper.insert(memberBoxRecordEntity); |
| | | |
| | | DappFundFlowEntity boxFundFlow = new DappFundFlowEntity(parent.getId(), new BigDecimal(box), 5, 2, BigDecimal.ZERO); |
| | | dappFundFlowDao.insert(boxFundFlow); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void sdmWithdrawFee(String data) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void tfcNewPrice() { |
| | | BigDecimal newPrice; |
| | | if (!systemHasStart()) { |
| | | newPrice = new BigDecimal("0.05"); |
| | | } else { |
| | | ContractChainService tfcInstance = ChainService.getInstance(ChainEnum.BSC_TFC.name()); |
| | | // u剩余数量 |
| | | BigDecimal sourceU = ChainService.getInstance(ChainEnum.BSC_USDT.name()).balanceOf(ChainEnum.BSC_USDT_SOURCE.getAddress()); |
| | | // 源池代币剩余数量 |
| | | BigDecimal sourceCoin = tfcInstance.balanceOf(ChainEnum.BSC_USDT_SOURCE.getAddress()); |
| | | |
| | | newPrice = sourceU.divide(sourceCoin, tfcInstance.decimals(), RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | chainProducer.sendTfcNewPrice(newPrice.toPlainString()); |
| | | } |
| | | } |