| | |
| | | private final DappMemberService dappMemberService; |
| | | private final MemberCoinWithdrawDao memberCoinWithdrawDao; |
| | | private final IgtOnHookPlanOrderItemDao igtOnHookPlanOrderItemdao; |
| | | private final DappBankDao dappBankDao; |
| | | |
| | | private final RedisTemplate<String, Object> redisTemplate; |
| | | |
| | |
| | | if(BigDecimal.ZERO.compareTo(balance) >= 0){ |
| | | return new FebsResponse().fail().message(MessageSourceUtils.getString("balance_err_001")); |
| | | } |
| | | DataDictionaryCustom withDrawDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.WITHDRAW_MAX.getType() |
| | | , DataDictionaryEnum.WITHDRAW_MAX.getCode()); |
| | | BigDecimal withDrawMax = withDrawDic.getValue() == null ? new BigDecimal("100") : new BigDecimal(withDrawDic.getValue()); |
| | | if(withDrawMax.compareTo(balance) > 0){ |
| | | return new FebsResponse().fail().message(MessageSourceUtils.getString("balance_err_003")); |
| | | } |
| | | DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId); |
| | | BigDecimal availableAmount = dappWalletCoinEntity.getAvailableAmount(); |
| | | if(balance.compareTo(availableAmount) > 0){ |
| | |
| | | //转出账户生成一条记录 |
| | | MemberCoinWithdrawEntity memberCoinWithdrawEntity = new MemberCoinWithdrawEntity(); |
| | | memberCoinWithdrawEntity.setAddress(address); |
| | | memberCoinWithdrawEntity.setAmount(balance.negate()); |
| | | memberCoinWithdrawEntity.setAmount(balance); |
| | | memberCoinWithdrawEntity.setFeeAmount(serviceFee); |
| | | if(1 == apiTransferOutsideDto.getType()){ |
| | | memberCoinWithdrawEntity.setTag("银行卡"); |
| | | DappBank dappBank = dappBankDao.selectBankListByMemberIdAndBankNo(memberId, address); |
| | | memberCoinWithdrawEntity.setTag(dappBank.getMemberName()+"-银行卡"); |
| | | memberCoinWithdrawEntity.setSymbol("$"); |
| | | }else{ |
| | | memberCoinWithdrawEntity.setTag("钱包"); |
| | |
| | | @Override |
| | | public BigDecimal updatePTFC(Long memberId, BigDecimal totalProfit) { |
| | | BigDecimal multiply = totalProfit.multiply(new BigDecimal(0.05)); |
| | | DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity( |
| | | memberId, multiply.negate(), "系统", 9); |
| | | DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(65L, |
| | | multiply.negate(), "系统", 9); |
| | | dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity); |
| | | return multiply; |
| | | } |