From 9219e18a9b2fb06b95b5c881b057d3fde7270ca3 Mon Sep 17 00:00:00 2001
From: zainali5120 <512061637@qq.com>
Date: Thu, 25 Feb 2021 10:28:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/whole_new' into whole_new

---
 src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java b/src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java
index 75f36ad..bdbe078 100644
--- a/src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java
+++ b/src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java
@@ -1,12 +1,17 @@
 package com.xcong.excoin.quartz.job;
 
+import com.xcong.excoin.modules.blackchain.service.TrxUsdtUpdateService;
 import com.xcong.excoin.modules.blackchain.service.UsdtEthService;
+import com.xcong.excoin.utils.RedisUtils;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.concurrent.ExecutionException;
 
 /**
@@ -24,6 +29,12 @@
     @Resource
     private UsdtEthService usdtEthService;
 
+    @Resource
+    private RedisUtils redisUtils;
+
+    @Resource
+    private TrxUsdtUpdateService trxUsdtUpdateService;
+
     /**
      * usdt 归集
      */
@@ -38,7 +49,11 @@
         }
     }
 
-    @Scheduled(cron = "0 2/8 * * * ? ")
+    /**
+     * 使用扫块 不需要这个
+     */
+    //@Scheduled(cron = "0 2/8 * * * ? ")
+    @Deprecated
     public void usdtEthPoolCheck() {
         log.info("USDTETH归集结果扫描开始");
         usdtEthService.usdtEthPoolCheck();
@@ -52,4 +67,19 @@
             log.info("#ETH归集错误#", e);
         }
     }
+
+    /**
+     *  归集TRC20
+     */
+    @Scheduled(cron = "0 1/5 * * * ? ")
+    public void poolUsdtTrc20() {
+        Object trc20_pool = redisUtils.get("TRC20_POOL");
+        if(trc20_pool==null){
+            return;
+        }
+        List<String> list = (List)trc20_pool;
+        for(String address: list){
+           trxUsdtUpdateService.poolByAddress(address);
+        }
+    }
 }

--
Gitblit v1.9.1