From 3b333e4a4ab9a358912dbd5041e68ff5ef3697af Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 28 May 2021 11:05:03 +0800
Subject: [PATCH] Merge branch 'otc' of http://120.27.238.55:7000/r/exchange into otc

---
 src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java b/src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java
index a6a1158..6fab80b 100644
--- a/src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java
+++ b/src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java
@@ -1,5 +1,6 @@
 package com.xcong.excoin.rabbit.consumer;
 
+import cn.hutool.http.HttpException;
 import com.alibaba.fastjson.JSONObject;
 import com.xcong.excoin.configurations.RabbitMqConfig;
 import com.xcong.excoin.modules.blackchain.model.EthUsdtChargeDto;
@@ -7,14 +8,18 @@
 import com.xcong.excoin.modules.blackchain.service.TrxUsdtUpdateService;
 import com.xcong.excoin.modules.blackchain.service.UsdtErc20UpdateService;
 import com.xcong.excoin.modules.coin.service.BlockCoinService;
+import com.xcong.excoin.quartz.job.BlockCoinUpdateJob;
+import com.xcong.excoin.utils.RedisUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.amqp.rabbit.annotation.RabbitListener;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestClientException;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+
 
 /**
  * @author wzy
@@ -31,7 +36,6 @@
 
     @Resource
     TrxUsdtUpdateService trxUsdtUpdateService;
-
 
     @RabbitListener(queues = RabbitMqConfig.QUEUE_USDT_UPDATE)
     public void doSomething(String content) {
@@ -52,7 +56,7 @@
     @RabbitListener(queues = RabbitMqConfig.QUEUE_USDT_ADDRESS)
     public void addUsdtAddress(String content) {
         if(!UsdtErc20UpdateService.ALL_ADDRESS_LIST.contains(content)){
-            log.debug("#添加新地址---->{}#", content);
+            log.info("#添加新地址---->{}#", content);
             if(StringUtils.isBlank(content)){
                 return;
             }
@@ -73,4 +77,18 @@
 
         }
     }
+
+    @RabbitListener(queues = RabbitMqConfig.QUEUE_TRC20_BLOCK)
+    public void trc20BlockMsg(String content) {
+        Long blocnNum = Long.parseLong(content);
+        try {
+            trxUsdtUpdateService.monitorCoinListener(blocnNum);
+        } catch (RestClientException | HttpException e) {
+            //  此时是连接问题 这个块需要重新扫描
+            log.info("查询区块超时:" + blocnNum);
+            BlockCoinUpdateJob.TRC_BLOCK.add(blocnNum);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 }

--
Gitblit v1.9.1