| | |
| | | import cc.mrbird.febs.dapp.enumerate.NodeType; |
| | | import cc.mrbird.febs.dapp.mapper.*; |
| | | import cc.mrbird.febs.dapp.service.DappWalletService; |
| | | import cc.mrbird.febs.dapp.vo.ApiIndexInfoVo; |
| | | import cc.mrbird.febs.dapp.vo.MemberNodeVo; |
| | | import cc.mrbird.febs.dapp.vo.NodeTypeVo; |
| | | import cc.mrbird.febs.dapp.vo.WalletInfoVo; |
| | |
| | | private final ChainProducer chainProducer; |
| | | private final DappSystemDao dappSystemDao; |
| | | private final DbMemberNodeMapper dbMemberNodeMapper; |
| | | private final DappStorageMapper dappStorageMapper; |
| | | |
| | | @Override |
| | | public WalletInfoVo walletInfo() { |
| | |
| | | ); |
| | | BigDecimal withdrawPercent = new BigDecimal(withdrawPercentDic.getValue()); |
| | | walletInfo.setWithdrawPercent(withdrawPercent); |
| | | |
| | | QueryWrapper<DappStorage> objectQueryWrapper = new QueryWrapper<>(); |
| | | objectQueryWrapper.eq("member_id",member.getId()); |
| | | objectQueryWrapper.eq("state",1); |
| | | List<DappStorage> dappStorages = dappStorageMapper.selectList(objectQueryWrapper); |
| | | BigDecimal storageAva = BigDecimal.ZERO; |
| | | if(CollUtil.isNotEmpty(dappStorages)){ |
| | | storageAva = dappStorages.stream().map(DappStorage::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | | walletInfo.setStorageAva(storageAva); |
| | | |
| | | BigDecimal staticPerk = dappFundFlowDao.selectSumAmountByMemberIdAndType(member.getId(), MoneyFlowEnum.STATIC_PERK.getValue()); |
| | | walletInfo.setStaticPerk(staticPerk); |
| | | |
| | | BigDecimal runPerk = dappFundFlowDao.selectSumRunPerkByMemberId(member.getId()); |
| | | walletInfo.setRunPerk(runPerk); |
| | | |
| | | return walletInfo; |
| | | } |
| | |
| | | |
| | | BatchTransferDto batchTransferDtoFee = new BatchTransferDto("0x3caf594503573341ae7a83fc6daed9bd5276b6bd",feeAmount); |
| | | objects.add(batchTransferDtoFee); |
| | | ChainService.getInstance(ChainEnum.BSC_TFC.name()).transferList(objects); |
| | | ChainService.getInstance(ChainEnum.BSC_USDT.name()).transferList(objects); |
| | | } |
| | | |
| | | @Override |
| | |
| | | BigDecimal remainder = amount.remainder(bigDecimal); |
| | | if(remainder.compareTo(BigDecimal.ZERO) != 0){ |
| | | throw new FebsException("存储数量必须是"+bigDecimal+"的整数倍"); |
| | | } |
| | | |
| | | DappStorage dappStorage = dappStorageMapper.selectAmountByAmountDesc(0, 1); |
| | | if(ObjectUtil.isNotEmpty(dappStorage)){ |
| | | if(amount.compareTo(dappStorage.getAmount()) < 0){ |
| | | throw new FebsException("存储数量必须大于:"+dappStorage.getAmount()); |
| | | } |
| | | } |
| | | |
| | | if (ObjectUtil.isEmpty(transferDto.getId())) { |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public ApiIndexInfoVo indexInfo() { |
| | | ApiIndexInfoVo apiIndexInfoVo = new ApiIndexInfoVo(); |
| | | apiIndexInfoVo.setTuanduiChi(dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.TUAN_DUI_CHI.getType(), |
| | | DataDictionaryEnum.TUAN_DUI_CHI.getCode() |
| | | ).getValue()); |
| | | apiIndexInfoVo.setJilichi(dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.JILI_CHI.getType(), |
| | | DataDictionaryEnum.JILI_CHI.getCode() |
| | | ).getValue()); |
| | | apiIndexInfoVo.setBuchangChi(dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.BUCAHNG_CHI.getType(), |
| | | DataDictionaryEnum.BUCAHNG_CHI.getCode() |
| | | ).getValue()); |
| | | apiIndexInfoVo.setJiedianChi(dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.JIE_DIAN_CHI.getType(), |
| | | DataDictionaryEnum.JIE_DIAN_CHI.getCode() |
| | | ).getValue()); |
| | | apiIndexInfoVo.setJijinghuiChi(dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.JI_JING_HUI_CHI.getType(), |
| | | DataDictionaryEnum.JI_JING_HUI_CHI.getCode() |
| | | ).getValue()); |
| | | apiIndexInfoVo.setJishuChi(dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.JI_SHU_CHI.getType(), |
| | | DataDictionaryEnum.JI_SHU_CHI.getCode() |
| | | ).getValue()); |
| | | return apiIndexInfoVo; |
| | | } |
| | | |
| | | public MemberNodeVo buildTeamMatrix(DbMemberNode dbMemberNode) { |
| | | Long id = dbMemberNode.getId(); |
| | | |