Helius
2021-06-16 790bf8a4f03c007fb9218dc071329ec030e707c2
modify
1 files modified
24 ■■■■■ changed files
src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java
@@ -1,12 +1,16 @@
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.springframework.beans.factory.annotation.Autowired;
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.List;
import java.util.concurrent.ExecutionException;
/**
@@ -23,6 +27,11 @@
    @Resource
    private UsdtEthService usdtEthService;
    @Resource
    private RedisUtils redisUtils;
    @Resource
    private TrxUsdtUpdateService trxUsdtUpdateService;
    /**
     * usdt 归集
@@ -52,4 +61,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);
        }
    }
}