| | |
| | | private final DappMemberDao dappMemberDao; |
| | | private final DappWalletMineDao dappWalletMineDao; |
| | | private final DappWalletCoinDao dappWalletCoinDao; |
| | | private final DappIdoAssetsDao dappIdoAssetsDao; |
| | | private final DappFundFlowDao dappFundFlowDao; |
| | | private final DappAccountMoneyChangeDao dappAccountMoneyChangeDao; |
| | | private final RedisUtils redisUtils; |
| | |
| | | public WalletInfoVo walletInfo() { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | |
| | | Map<String, BigDecimal> map = dappFundFlowDao.selectAmountTotalByType(member.getId()); |
| | | DappIdoAssetsEntity idoAssets = dappIdoAssetsDao.selectByMemberId(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(notDirect.size()); |
| | | walletInfo.setDirectCnt(direct.size()); |
| | | walletInfo.setTotalChildCoin(childHoldAmount); |
| | | walletInfo.setTeamReward(map.get("teamReward")); |
| | | walletInfo.setMiningAmount(map.get("mine")); |
| | | walletInfo.setBoxCnt(idoAssets.getBoxCnt()); |
| | | walletInfo.setCoinAmount(idoAssets.getCoinAmount()); |
| | | walletInfo.setUsdtAmount(idoAssets.getUsdtAmount()); |
| | | walletInfo.setInviteId(member.getInviteId()); |
| | | return walletInfo; |
| | | } |
| | |
| | | public Map<String, BigDecimal> calPrice(PriceDto priceDto) { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | |
| | | |
| | | String hasStart = redisUtils.getString(AppContants.SYSTEM_START_FLAG); |
| | | if (!"start".equals(hasStart)) { |
| | | HashMap<String, BigDecimal> map = new HashMap<>(); |
| | |
| | | map.put("y", y); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public int boxSurprise() { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | |
| | | DappIdoAssetsEntity idoAssets = dappIdoAssetsDao.selectByMemberId(member.getId()); |
| | | if (idoAssets.getBoxCnt() < 1) { |
| | | throw new FebsException("盲盒数量不足"); |
| | | } |
| | | |
| | | idoAssets.setBoxCnt(idoAssets.getBoxCnt() - 1); |
| | | dappIdoAssetsDao.updateById(idoAssets); |
| | | |
| | | // TODO 线上转账 |
| | | |
| | | return 1; |
| | | } |
| | | } |