| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.yami.trading.bean.model.CapitaltWallet; |
| | | import com.yami.trading.bean.model.User; |
| | | import com.yami.trading.bean.model.Withdraw; |
| | | import com.yami.trading.common.constants.Constants; |
| | | import com.yami.trading.common.domain.Result; |
| | |
| | | if (!StringUtils.isNullOrEmpty(error)) { |
| | | throw new YamiShopBindException(error); |
| | | } |
| | | User user = userService.getById(partyId); |
| | | if(user.isWithdrawAuthority() == false){ |
| | | throw new YamiShopBindException("Account is abnormal and has been restricted from making withdrawals."); |
| | | } |
| | | double amount_double = Double.valueOf(amount).doubleValue(); |
| | | |
| | | // 交易所提现是否需要资金密码 |
| | |
| | | // } |
| | | |
| | | // 获取资金账户(capital) |
| | | CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class) |
| | | .eq(CapitaltWallet::getUserId, partyId).last(" limit 1 ")); |
| | | if(capitaltWallet.getMoney().compareTo(new BigDecimal(amount)) < 0){ |
| | | throw new YamiShopBindException("Insufficient available balance for withdrawal!"); |
| | | if(channel.contains("USDT")){ |
| | | CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class) |
| | | .eq(CapitaltWallet::getUserId, partyId).last(" limit 1 ")); |
| | | if(capitaltWallet.getMoney().compareTo(new BigDecimal(amount)) < 0){ |
| | | throw new YamiShopBindException("Insufficient available balance for withdrawal!"); |
| | | } |
| | | } |
| | | |
| | | this.sessionTokenService.del(session_token); |