| | |
| | | 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; |
| | | } |
| | | |