From d9e5afcd0b04e52fe9a9e16f727685171a00842d Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Mon, 03 Aug 2020 10:45:14 +0800
Subject: [PATCH] modify

---
 src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java                                   |   11 +++++++++++
 src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java |    1 +
 src/main/java/com/xcong/excoin/modules/documentary/vo/DocumentaryOrderSetInfoVo.java        |    8 ++++++++
 3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
index 249a3e3..8fdc2c2 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -487,6 +487,7 @@
         String nickname = followTraderInfoEntity.getNickname();
         documentaryOrderSetInfoVo.setNickname(nickname);
 
+		documentaryOrderSetInfoVo.setProfit(followTraderInfoEntity.getProfitRatio());
         if (followFollowerSettingEntity == null) {
         	return Result.ok(documentaryOrderSetInfoVo);
 		}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/vo/DocumentaryOrderSetInfoVo.java b/src/main/java/com/xcong/excoin/modules/documentary/vo/DocumentaryOrderSetInfoVo.java
index 779a8df..026969d 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/vo/DocumentaryOrderSetInfoVo.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/vo/DocumentaryOrderSetInfoVo.java
@@ -4,6 +4,8 @@
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 @Data
 @ApiModel(value = "DocumentaryOrderSetInfoVo", description = "参数返回类")
 public class DocumentaryOrderSetInfoVo {
@@ -16,6 +18,9 @@
 	
 	@ApiModelProperty("名称")
     private String nickname;
+
+	@ApiModelProperty("利润")
+	private BigDecimal profit;
 	
     @ApiModelProperty(value = "跟单合约(多个,且逗号隔开)", example = "BTC/USDT")
 	private String symbols;
@@ -29,4 +34,7 @@
 	@ApiModelProperty(value = "跟单最大持仓张数数量", example = "2")
 	private int maxFollowCnt;
 
+	public BigDecimal getProfit() {
+		return profit.multiply(BigDecimal.valueOf(10));
+	}
 }
diff --git a/src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java b/src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java
index 10c1e06..528598c 100644
--- a/src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java
+++ b/src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java
@@ -2,6 +2,7 @@
 
 import com.xcong.excoin.modules.contract.entity.ContractOrderEntity;
 import com.xcong.excoin.modules.contract.service.impl.OrderWebsocketServiceImpl;
+import com.xcong.excoin.modules.documentary.service.FollowOrderOperationService;
 import com.xcong.excoin.utils.dingtalk.DingTalkUtils;
 
 import java.math.BigDecimal;
@@ -47,4 +48,14 @@
             }
         });
     }
+
+    public static void sendFollowOrderTask(Long id) {
+        FollowOrderOperationService followOrderOperationService = SpringContextHolder.getBean(FollowOrderOperationService.class);
+        EXECUTOR.execute(new Runnable() {
+            @Override
+            public void run() {
+                followOrderOperationService.addFollowerOrder(id);
+            }
+        });
+    }
 }

--
Gitblit v1.9.1