|  |  | 
 |  |  |  | 
 |  |  | 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; | 
 |  |  | 
 |  |  |  * @author wzy | 
 |  |  |  * @date 2020-06-01 | 
 |  |  |  **/ | 
 |  |  | @Slf4j | 
 |  |  | public class ThreadPoolUtils { | 
 |  |  |  | 
 |  |  |     public static final ExecutorService EXECUTOR = Executors.newFixedThreadPool(20); | 
 |  |  | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 发送钉钉消息 | 
 |  |  |      * | 
 |  |  |      * @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); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |     } | 
 |  |  | } |