From 65c24664cf5700396a25c46dfc497be9b1601d52 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 28 Aug 2020 19:08:25 +0800
Subject: [PATCH] modify
---
src/main/java/com/xcong/excoin/rabbit/init/OrderProducerInit.java | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/rabbit/init/OrderProducerInit.java b/src/main/java/com/xcong/excoin/rabbit/init/OrderProducerInit.java
index 2995aff..ad8f3e0 100644
--- a/src/main/java/com/xcong/excoin/rabbit/init/OrderProducerInit.java
+++ b/src/main/java/com/xcong/excoin/rabbit/init/OrderProducerInit.java
@@ -50,7 +50,6 @@
if (CollectionUtils.isNotEmpty(holdOrderEntities)) {
for (ContractHoldOrderEntity order : holdOrderEntities) {
- log.info("---->>>{}", order.getSymbol());
// 开多1,开空 2
int openingType = order.getOpeningType();
// 1:买入委托2:开多3:开空4:平多5:平空6:爆仓平多7:爆仓平空
@@ -60,9 +59,11 @@
// 爆仓价
BigDecimal forceSetPrice = order.getForceClosingPrice();
if (forceSetPrice != null) {
- OrderModel model = new OrderModel(order.getId(), RabbitPriceTypeEnum.CLOSE_MORE_BOMB.getValue(), forceSetPrice.toPlainString(),
- order.getSymbol(), order.getOperateNo());
- producer.sendPriceOperate(JSONObject.toJSONString(model));
+ if (forceSetPrice.compareTo(BigDecimal.ZERO) >= 0) {
+ OrderModel model = new OrderModel(order.getId(), RabbitPriceTypeEnum.CLOSE_MORE_BOMB.getValue(), forceSetPrice.toPlainString(),
+ order.getSymbol(), order.getOperateNo());
+ producer.sendPriceOperate(JSONObject.toJSONString(model));
+ }
}
// 止损
BigDecimal stopLossPrice = order.getStopLossPrice();
@@ -86,9 +87,11 @@
// 爆仓价
BigDecimal forceSetPrice = order.getForceClosingPrice();
if (forceSetPrice != null) {
- OrderModel model = new OrderModel(order.getId(), RabbitPriceTypeEnum.CLOSE_LESS_BOMB.getValue(), forceSetPrice.toPlainString(),
- order.getSymbol(), order.getOperateNo());
- producer.sendPriceOperate(JSONObject.toJSONString(model));
+ if (forceSetPrice.compareTo(BigDecimal.ZERO) >= 0) {
+ OrderModel model = new OrderModel(order.getId(), RabbitPriceTypeEnum.CLOSE_LESS_BOMB.getValue(), forceSetPrice.toPlainString(),
+ order.getSymbol(), order.getOperateNo());
+ producer.sendPriceOperate(JSONObject.toJSONString(model));
+ }
}
// 止损
BigDecimal stopLossPrice = order.getStopLossPrice();
--
Gitblit v1.9.1