From f43cef4cd654f8f66d3d39cf3ed9d48119bd7e5b Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 06 Apr 2021 10:33:56 +0800
Subject: [PATCH] modiyf

---
 src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java |    2 +-
 src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java             |   15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java b/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
index 5a0308f..216bcca 100644
--- a/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
+++ b/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
@@ -84,6 +84,11 @@
 
     public static final String ROUTINGKEY_FOLLOW_ORDER = "ROUTINGKEY_FOLLOW_ORDER";
 
+    // 跟单调整保证金
+    public static final String QUEUE_FOLLOW_CHANGE_BOND = "QUEUE_FOLLOW_CHANGE_BOND";
+
+    public static final String ROUTINGKEY_FOLLOW_CHANGE_BOND = "ROUTINGKEY_FOLLOW_CHANGE_BOND";
+
     // 开多止盈路由键
     public static final String ROUTINGKEY_MOREPRO = "ROUTINGKEY_MOREPRO";
     // 开空止盈路由
@@ -305,6 +310,16 @@
     }
 
     @Bean
+    public Queue queueFollowChangeBond() {
+        return new Queue(QUEUE_FOLLOW_CHANGE_BOND, true);
+    }
+
+    @Bean
+    public Binding bindingFollowChangeBond() {
+        return BindingBuilder.bind(queueFollowChangeBond()).to(orderExchange()).with(ROUTINGKEY_FOLLOW_CHANGE_BOND);
+    }
+
+    @Bean
     public Binding bindingFollowOrder() {
         return BindingBuilder.bind(queueFollowOrder()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_FOLLOW_ORDER);
     }
diff --git a/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java b/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java
index 9ae4435..ed5539c 100644
--- a/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java
@@ -454,7 +454,7 @@
     	MemberWalletContractEntity walletContract = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(memberId, symbol);
     	BigDecimal availableBalance = walletContract.getAvailableBalance();
 
-    	BigDecimal canReduce = BigDecimal.ZERO;
+    	BigDecimal canReduce = availableBalance;
     	//可用减去盈亏
     	if(totalProfitOrLess.compareTo(BigDecimal.ZERO) < 0){
             canReduce = availableBalance.add(totalProfitOrLess);

--
Gitblit v1.9.1