From cdf75ee88f261d7c1344cd856c03e8c9611f032c Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 05 Aug 2020 16:19:51 +0800
Subject: [PATCH] modify
---
src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java b/src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java
index 78727ff..47b89a5 100644
--- a/src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java
+++ b/src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java
@@ -2,6 +2,9 @@
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 lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
import java.util.concurrent.ExecutorService;
@@ -11,6 +14,7 @@
* @author wzy
* @date 2020-06-01
**/
+@Slf4j
public class ThreadPoolUtils {
public static final ExecutorService EXECUTOR = Executors.newFixedThreadPool(20);
@@ -32,4 +36,32 @@
}
});
}
+
+ /**
+ * 发送钉钉消息
+ *
+ * @param type 类型
+ */
+ public static void sendDingTalk(int type) {
+ EXECUTOR.execute(new Runnable() {
+ @Override
+ public void run() {
+ DingTalkUtils.sendActionCard(type);
+ }
+ });
+ }
+
+ public static void sendFollowOrderTask(Long id) {
+ FollowOrderOperationService followOrderOperationService = SpringContextHolder.getBean(FollowOrderOperationService.class);
+ EXECUTOR.execute(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ followOrderOperationService.addFollowerOrder(id);
+ } catch (Exception e) {
+ log.error("产生跟单任务报错", e);
+ }
+ }
+ });
+ }
}
--
Gitblit v1.9.1