|  |  | 
 |  |  |         BigDecimal closingPrice = price.multiply(amount).multiply(tradeSetting.getCoinFeeRatio());
 | 
 |  |  |         //总费用 = 成交价*数量+手续费
 | 
 |  |  |         BigDecimal totalPayPrice = price.multiply(amount).add(closingPrice);
 | 
 |  |  |         BigDecimal totalPayPricCoin = nowPrice.multiply(amount).add(closingPrice);
 | 
 |  |  | 
 | 
 |  |  |         String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue();
 | 
 |  |  |         MemberWalletCoinEntity walletCoinUsdt = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, walletCode);
 | 
 |  |  |         if (OrderCoinsEntity.ORDERTYPE_BUY.equals(type)) {
 | 
 |  |  |             //买入,所需总费用跟用户USDT金额进行比较
 | 
 |  |  |             BigDecimal availableBalance = walletCoinUsdt.getAvailableBalance();
 | 
 |  |  |             if (totalPayPrice.compareTo(availableBalance) > 0) {
 | 
 |  |  |             if (totalPayPrice.compareTo(availableBalance) > 0 || totalPayPricCoin.compareTo(availableBalance) > 0) {
 | 
 |  |  |                 return Result.fail(MessageSourceUtils.getString("order_service_0010"));
 | 
 |  |  |             }
 | 
 |  |  |         } else {
 |