|  |  | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     @Override
 | 
 |  |  |     public Result enterTransactionPageOfWalletCoin(String symbol, String type) {
 | 
 |  |  |     public Result enterTransactionPageOfWalletCoin(String symbol) {
 | 
 |  |  |         if (StrUtil.isBlank(symbol)) {
 | 
 |  |  |             return Result.fail(MessageSourceUtils.getString("order_service_0001"));
 | 
 |  |  |         }
 | 
 |  |  | 
 |  |  |         // 手续费用率
 | 
 |  |  |         transactionPageOfWalletCoinVo.setFeeRatio(tradeSetting.getFeeRatio().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |         // 用户可用金额
 | 
 |  |  |         if(MemberWalletCoinEnum.ENTERTRANSACTIONPAGEOFWALLETCOIN_BUY.getValue().equals(type)) {//买入
 | 
 |  |  |             transactionPageOfWalletCoinVo.setAvailableBalance(walletCoinUsdt.getAvailableBalance().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |         }else {
 | 
 |  |  |             transactionPageOfWalletCoinVo.setAvailableBalance(walletCoin.getAvailableBalance().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |         }
 | 
 |  |  |         transactionPageOfWalletCoinVo.setAvailableBalanceBuy(walletCoinUsdt.getAvailableBalance().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |         transactionPageOfWalletCoinVo.setAvailableBalanceSell(walletCoin.getAvailableBalance().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |         //当前价
 | 
 |  |  |         transactionPageOfWalletCoinVo.setCurrentPrice(closePrice.setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |         //比例
 | 
 |  |  | 
 |  |  |         transactionPageOfWalletCoinVo.setCurrentPriceCny(cnyUsdt.multiply(closePrice).setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |         
 | 
 |  |  |         transactionPageOfWalletCoinVo.setSymbol(symbol);
 | 
 |  |  |         transactionPageOfWalletCoinVo.setType(type);
 | 
 |  |  |         return Result.ok(transactionPageOfWalletCoinVo);
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |                 detail.setDealPrice(price.setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                 detail.setDealAmount(totalPayPrice.setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                 detail.setFeeAmount(closingPrice.setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                 detail.setOrderStatus(OrderCoinsDealEntity.ORDERSTATUS_DONE);
 | 
 |  |  |                 orderCoinDealDao.insert(detail);
 | 
 |  |  |                 
 | 
 |  |  |                 if(OrderCoinsEntity.ORDERTYPE_BUY.equals(type)) {
 | 
 |  |  | 
 |  |  |                     
 | 
 |  |  |                     String symbol = orderCoinsEntity.getSymbol();
 | 
 |  |  |                     
 | 
 |  |  |                     OrderCoinsDealEntity detail = new OrderCoinsDealEntity();
 | 
 |  |  |                     detail.setMemberId(memberId);
 | 
 |  |  |                     detail.setOrderId(orderCoinsEntity.getId());
 | 
 |  |  |                     detail.setOrderNo(generateSimpleSerialno(memberId.toString()));
 | 
 |  |  |                     detail.setOrderType(orderCoinsEntity.getOrderType());
 | 
 |  |  |                     detail.setTradeType(orderCoinsEntity.getTradeType());
 | 
 |  |  |                     detail.setSymbol(symbol);
 | 
 |  |  |                     detail.setOrderStatus(OrderCoinsDealEntity.ORDERSTATUS_CANCEL);
 | 
 |  |  |                     detail.setSymbolCnt(orderCoinsEntity.getEntrustCnt());
 | 
 |  |  |                     detail.setEntrustPrice(orderCoinsEntity.getEntrustPrice().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                     detail.setDealPrice(orderCoinsEntity.getDealPrice().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                     detail.setDealAmount(orderCoinsEntity.getDealAmount().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                     detail.setFeeAmount(orderCoinsEntity.getFeeAmount().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                     orderCoinDealDao.insert(detail);
 | 
 |  |  | 					 | 
 |  |  |                     if(OrderCoinsEntity.ORDERTYPE_BUY.equals(orderCoinsEntity.getOrderType())) {
 | 
 |  |  |                         //如果是限价买入,撤单将USDT账户冻结金额返回
 | 
 |  |  |                         String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue();
 | 
 |  |  | 
 |  |  |                             return Result.ok(MessageSourceUtils.getString("order_service_0013"));
 | 
 |  |  |                         }
 | 
 |  |  |                     }
 | 
 |  |  |                     OrderCoinsDealEntity detail = new OrderCoinsDealEntity();
 | 
 |  |  |                     detail.setMemberId(memberId);
 | 
 |  |  |                     detail.setOrderId(orderCoinsEntity.getId());
 | 
 |  |  |                     detail.setOrderNo(generateSimpleSerialno(memberId.toString()));
 | 
 |  |  |                     detail.setOrderType(orderCoinsEntity.getOrderType());
 | 
 |  |  |                     detail.setTradeType(orderCoinsEntity.getTradeType());
 | 
 |  |  |                     detail.setSymbol(symbol);
 | 
 |  |  |                     detail.setOrderStatus(OrderCoinsDealEntity.ORDERSTATUS_CANCEL);
 | 
 |  |  |                     detail.setSymbolCnt(orderCoinsEntity.getEntrustCnt());
 | 
 |  |  |                     detail.setEntrustPrice(orderCoinsEntity.getEntrustPrice().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                     detail.setDealPrice(orderCoinsEntity.getDealPrice().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                     detail.setDealAmount(orderCoinsEntity.getDealAmount().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                     detail.setFeeAmount(orderCoinsEntity.getFeeAmount().setScale(4, BigDecimal.ROUND_DOWN));
 | 
 |  |  |                     orderCoinDealDao.insert(detail);
 | 
 |  |  |                 }
 | 
 |  |  |         return Result.fail(MessageSourceUtils.getString("order_service_0043"));
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     @Override
 | 
 |  |  |     public Result findAllWalletCoinOrder() {
 | 
 |  |  |     public Result findAllWalletCoinOrder(String symbol) {
 | 
 |  |  |         //获取用户ID
 | 
 |  |  |         Long memberId = LoginUserUtils.getAppLoginUser().getId();
 | 
 |  |  |         
 | 
 |  |  |         OrderWalletCoinDealListVo orderWalletCoinDealListVo = new OrderWalletCoinDealListVo();
 | 
 |  |  |         List<OrderWalletCoinDealVo> arrayList = new ArrayList<OrderWalletCoinDealVo>();
 | 
 |  |  |         
 | 
 |  |  |         List<OrderCoinsDealEntity> selectAllWalletCoinOrder = orderCoinDealDao.selectAllWalletCoinOrder(memberId);
 | 
 |  |  |         List<OrderCoinsDealEntity> selectAllWalletCoinOrder = orderCoinDealDao.selectAllWalletCoinOrderBySymbol(memberId,symbol);
 | 
 |  |  |         if(CollUtil.isNotEmpty(selectAllWalletCoinOrder)) {
 | 
 |  |  |             for(OrderCoinsDealEntity orderCoinsDealEntity: selectAllWalletCoinOrder) {
 | 
 |  |  |                 OrderWalletCoinDealVo entityToVo = OrderWalletCoinDealMapper.INSTANCE.entityToVoOrder(orderCoinsDealEntity);
 |