| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xcong.excoin.modules.coin.entity.OrderCoinsEntity; |
| | | import com.xcong.excoin.modules.coin.service.OrderCoinService; |
| | | import com.xcong.excoin.rabbit.producer.ExchangeProducer; |
| | |
| | | return; |
| | | } |
| | | // 如果 |
| | | if (exchangeOrder.getEntrustAmount().compareTo(BigDecimal.ZERO) <= 0 || exchangeOrder.getEntrustAmount().subtract(exchangeOrder.getDealAmount()).compareTo(BigDecimal.ZERO) <= 0) { |
| | | return; |
| | | if(OrderCoinsEntity.ORDERTYPE_BUY==exchangeOrder.getOrderType()){ |
| | | if (exchangeOrder.getEntrustAmount().compareTo(BigDecimal.ZERO) <= 0 || exchangeOrder.getEntrustAmount().subtract(exchangeOrder.getDealAmount()).compareTo(BigDecimal.ZERO) <= 0) { |
| | | return; |
| | | } |
| | | }else{ |
| | | if (exchangeOrder.getEntrustCnt().compareTo(BigDecimal.ZERO) <= 0 || exchangeOrder.getEntrustCnt().subtract(exchangeOrder.getDealCnt()).compareTo(BigDecimal.ZERO) <= 0) { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | |
| | | TreeMap<BigDecimal, MergeOrder> limitPriceOrderList; |
| | | LinkedList<OrderCoinsEntity> marketPriceOrderList; |
| | |
| | | while (iterator.hasNext()) { |
| | | OrderCoinsEntity matchOrder = iterator.next(); |
| | | ExchangeTrade trade = processMatch(focusedOrder, matchOrder); |
| | | logger.info(">>>>>" + trade); |
| | | if (trade != null) { |
| | | exchangeTrades.add(trade); |
| | | } |