| | |
| | | } |
| | | |
| | | |
| | | DappMemberEntity dappMemberEntityOut = LoginUserUtil.getAppUser(); |
| | | Long memberIdOut = dappMemberEntityOut.getId(); |
| | | // DappMemberEntity dappMemberEntityOut = LoginUserUtil.getAppUser(); |
| | | Long memberIdOut = LoginUserUtil.getAppUser().getId(); |
| | | //判断账户是否限制 |
| | | |
| | | |
| | | DappMemberEntity dappMemberEntityOut = dappMemberDao.selectById(memberIdOut); |
| | | Integer withdrawAble = dappMemberEntityOut.getWithdrawAble(); |
| | | if(2 == withdrawAble){ |
| | | return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_0017")); |
| | | } |
| | | //判断双方是否是会员 |
| | | if(ObjectUtil.isEmpty(dappMemberEntityOut.getInviteId())){ |
| | | return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_002")); |
| | |
| | | if(balance.compareTo(totalProfitOut) > 0){ |
| | | BigDecimal totalAmount = dappWalletCoinEntityOut.getTotalAmount(); |
| | | //用户总收益率 |
| | | BigDecimal divide = totalProfitOut.divide(totalAmount); |
| | | BigDecimal divide = totalProfitOut.divide(totalAmount,4,BigDecimal.ROUND_DOWN); |
| | | //提现条件收益率 |
| | | DataDictionaryCustom outAccountProfitDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getType(), DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getCode()); |
| | | BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue()); |
| | |
| | | return new FebsResponse().fail().message(MessageSourceUtils.getString("balance_err_002")); |
| | | } |
| | | |
| | | DappMemberEntity dappMemberEntityOut = dappMemberDao.selectById(memberId); |
| | | //判断账户是否限制 |
| | | Integer withdrawAble = dappMemberEntityOut.getWithdrawAble(); |
| | | if(2 == withdrawAble){ |
| | | return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_0017")); |
| | | } |
| | | //验证资金密码 |
| | | Boolean aBoolean = dappMemberService.validateTransferCode(apiTransferOutsideDto.getTransferCode(), memberId); |
| | | if(!aBoolean){ |
| | |
| | | if(balance.compareTo(totalProfit) >= 0){ |
| | | BigDecimal totalAmount = dappWalletCoinEntity.getTotalAmount(); |
| | | //用户总收益率 |
| | | BigDecimal divide = totalProfit.divide(totalAmount); |
| | | BigDecimal divide = totalProfit.divide(totalAmount,4,BigDecimal.ROUND_DOWN); |
| | | //提现条件收益率 |
| | | DataDictionaryCustom outAccountProfitDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getType(), DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getCode()); |
| | | BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue()); |
| | |
| | | } |
| | | |
| | | //余额减少冻结增加 |
| | | Integer count = dappWalletCoinDao.addFrozenAndDelAvailableById(memberId, balance); |
| | | Integer count = dappWalletCoinDao.addFrozenAndDelAvailableById(dappWalletCoinEntity.getId(), balance); |
| | | if(1 != count){ |
| | | throw new FebsException(MessageSourceUtils.getString("balance_err_002")); |
| | | } |