From be6979a915b64b831526baf9052726b5bb5cf152 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 02 Jun 2020 21:32:22 +0800
Subject: [PATCH] modify rabbit something

---
 src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java b/src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
index 10e2f85..a984afb 100644
--- a/src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
@@ -367,10 +367,10 @@
             } else {
                 // 开空止盈
                 if (ProfitOrLessDto.TYPE_PROFIT == profitOrLessDto.getType()) {
-                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_PROFIT.getValue(), price.toPlainString(), holdOrderEntity.getSymbol());
+                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_PROFIT.getValue(), price.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
                     // 开空止损
                 } else {
-                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_LESS.getValue(), price.toPlainString(), holdOrderEntity.getSymbol());
+                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_LESS.getValue(), price.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
                 }
             }
             producer.sendPriceOperate(JSONObject.toJSONString(model));
@@ -419,10 +419,10 @@
         OrderModel model = null;
         // 开多
         if (ContractHoldOrderEntity.OPENING_TYPE_MORE == holdOrderEntity.getOpeningType()) {
-            model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_BOMB.getValue(), forceClosingPrice.toPlainString(), holdOrderEntity.getSymbol());
+            model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
             // 开空
         } else {
-            model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_BOMB.getValue(), forceClosingPrice.toPlainString(), holdOrderEntity.getSymbol());
+            model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
         }
         producer.sendPriceOperate(JSONObject.toJSONString(model));
 

--
Gitblit v1.9.1