From 292a4634d9c52ce193eca9de356d65960bdc35f4 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Fri, 15 Jan 2021 18:20:37 +0800 Subject: [PATCH] 20210115 --- src/main/java/com/xcong/excoin/quartz/job/KLineGeneratorJob.java | 22 ++-------------------- 1 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/xcong/excoin/quartz/job/KLineGeneratorJob.java b/src/main/java/com/xcong/excoin/quartz/job/KLineGeneratorJob.java index 8fb4f5c..b6194ee 100644 --- a/src/main/java/com/xcong/excoin/quartz/job/KLineGeneratorJob.java +++ b/src/main/java/com/xcong/excoin/quartz/job/KLineGeneratorJob.java @@ -4,6 +4,7 @@ import com.xcong.excoin.modules.coin.service.OrderCoinService; import com.xcong.excoin.processor.CoinProcessorFactory; import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -19,29 +20,10 @@ */ @Component @Slf4j +@ConditionalOnProperty(prefix = "app", name = "exchange-trade", havingValue = "true") public class KLineGeneratorJob { @Resource private CoinProcessorFactory processorFactory; - - @Resource - private OrderCoinService orderCoinService; - - - - //@Scheduled(cron = "0/40 * * * * *") - public void test(){ - Random random = new Random(); - Integer type = OrderCoinsDealEntity.ORDERTYPE_BUY; - Integer tradeType = OrderCoinsDealEntity.TRADETYPE_FIXEDPRICE; - double random1 = Math.random(); - BigDecimal price = new BigDecimal(random1).setScale(4, RoundingMode.HALF_UP).multiply(new BigDecimal("2")); - if(price.compareTo(BigDecimal.ZERO)==0){ - price = BigDecimal.ONE; - } - System.out.println(price); - orderCoinService.initOrders("ROC",type,tradeType,price,new BigDecimal(2),null); - orderCoinService.initOrders("ROC",OrderCoinsDealEntity.ORDERTYPE_SELL,tradeType,price,new BigDecimal(2),null); - } /** -- Gitblit v1.9.1