zainali5120
2020-09-14 74ca5bc0f40e3b91464c8972392271d24dd5f066
src/main/java/com/xcong/excoin/quartz/job/CoinTradeInitJob.java
@@ -14,6 +14,7 @@
import com.xcong.excoin.processor.DefaultCoinProcessor;
import com.xcong.excoin.processor.MarketService;
import com.xcong.excoin.rabbit.pricequeue.WebsocketPriceService;
import com.xcong.excoin.rabbit.producer.ExchangeProducer;
import com.xcong.excoin.trade.CoinTrader;
import com.xcong.excoin.trade.CoinTraderFactory;
import com.xcong.excoin.utils.CoinTypeConvert;
@@ -56,12 +57,15 @@
    @Resource
    private CoinProcessorFactory processorFactory;
    @Resource
    ExchangeProducer exchangeProducer;
    @PostConstruct
    public void initCoinTrade() {
        log.info("#=======撮合交易器开启=======#");
        String symbol = "NEKK";
        CoinTrader newTrader = new CoinTrader(symbol);
        newTrader.setOrderCoinService(coinService);
        newTrader.setExchangeProducer(exchangeProducer);
        //newTrader.setKafkaTemplate(kafkaTemplate);
        //newTrader.setBaseCoinScale(coin.getBaseCoinScale());
        //newTrader.setCoinScale(coin.getCoinScale());
@@ -70,7 +74,9 @@
        // 创建成功以后需要对未处理订单预处理
        log.info("======CoinTrader Process: " + symbol + "======");
        List<OrderCoinsEntity> orders = orderCoinsDao.selectAllEntrustingCoinOrderList();
        List<String> symbolList = new ArrayList<>();
        symbolList.add(symbol);
        List<OrderCoinsEntity> orders = orderCoinsDao.selectCoinOrderOnTrade(symbolList);
        List<OrderCoinsEntity> tradingOrders = new ArrayList<>();
        List<OrderCoinsEntity> completedOrders = new ArrayList<>();
        orders.forEach(order -> {