| | |
| | | if (SymbolsConstats.EXCHANGE_SYMBOLS.contains(orderCoinsEntity.getSymbol())) {
|
| | | orderSubmitProducer.sendCancelMsg(orderId);
|
| | | // return this.cancelEntrustWalletCoinOrderForMatch(orderId);
|
| | | return Result.ok("order_service_0013");
|
| | | return Result.ok(MessageSourceUtils.getString("order_service_0013"));
|
| | | }
|
| | | if (orderCoinsEntity.getOrderStatus() == OrderCoinsEntity.ORDERSTATUS_CANCEL || orderCoinsEntity.getOrderStatus()==OrderCoinsEntity.ORDERSTATUS_DONE) {
|
| | | return Result.fail(MessageSourceUtils.getString("order_service_0012"));
|
| | |
| | | detail.setDealPrice(orderCoinsEntity.getDealPrice());
|
| | | detail.setDealAmount(orderCoinsEntity.getDealAmount());
|
| | | detail.setFeeAmount(orderCoinsEntity.getFeeAmount());
|
| | | orderCoinDealDao.insert(detail);
|
| | |
|
| | | if (OrderCoinsEntity.ORDERTYPE_BUY.equals(orderCoinsEntity.getOrderType())) {
|
| | | //如果是限价买入,撤单将USDT账户冻结金额返回
|
| | | String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue();
|
| | |
| | | BigDecimal needFee = orderCoinsEntity.getFeeAmount().multiply(dealAmount.divide(orderCoinsEntity.getEntrustAmount(), 8, BigDecimal.ROUND_DOWN));
|
| | | returnFee = orderCoinsEntity.getFeeAmount().subtract(needFee);
|
| | | }
|
| | | BigDecimal avi = walletCoin.getAvailableBalance().add(returnBalance).add(returnFee);
|
| | | BigDecimal avi = returnBalance.add(returnFee);
|
| | | memberWalletCoinDao.updateWalletBalance(walletCoin.getId(),avi,null,returnBalance.negate());
|
| | | walletCoin.setAvailableBalance(walletCoin.getAvailableBalance().add(returnBalance).add(returnFee));
|
| | | walletCoin.setFrozenBalance(walletCoin.getFrozenBalance().subtract(returnBalance));
|
| | |
| | | return Result.ok(MessageSourceUtils.getString("order_service_0013"));
|
| | | }
|
| | | }
|
| | | orderCoinDealDao.insert(detail);
|
| | | }
|
| | | return Result.fail(MessageSourceUtils.getString("order_service_0043"));
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public Result findAllWalletCoinOrder() {
|
| | | List<OrderCoinsDealEntity> orderCoinsDealEntities = orderCoinDealDao.selectAllCoinDealsOrderBySymbol(CoinTypeEnum.ROC.toString());
|
| | | List<OrderCoinsDealEntity> orderCoinsDealEntities = orderCoinDealDao.selectAllCoinDealsOrderBySymbol(CoinTypeEnum.CPV.toString());
|
| | | return Result.ok(orderCoinsDealEntities);
|
| | | }
|
| | |
|
| | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void dealEntrustCoinOrder() {
|
| | | List<String> ignoreTypes = new ArrayList<>();
|
| | | ignoreTypes.add(SymbolsConstats.ROC);
|
| | | ignoreTypes.add(SymbolsConstats.CPV);
|
| | | List<OrderCoinsEntity> list = orderCoinsDao.selectAllEntrustingCoinOrderList(ignoreTypes);
|
| | | if (CollUtil.isNotEmpty(list)) {
|
| | | for (OrderCoinsEntity orderCoinsEntity : list) {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void initOrders(String symbol, Integer type, Integer tradeType, BigDecimal price,
|
| | | BigDecimal amount, BigDecimal entrustAmount) {
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | }
|