zainali5120
2021-03-15 eeb06d26c092d12b42d5b450afdbf002fec1795f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.xcong.excoin.quartz.job;
 
import com.xcong.excoin.common.enumerates.CoinTypeEnum;
import com.xcong.excoin.modules.blackchain.service.TrxUsdtUpdateService;
import com.xcong.excoin.modules.coin.service.BlockCoinService;
import com.xcong.excoin.modules.member.dao.MemberCoinAddressDao;
import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity;
import com.xcong.excoin.utils.RedisUtils;
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.List;
 
/**
 * 链上币种同步任务
 *
 * @author wzy
 * @date 2020-07-02
 **/
@Component
@ConditionalOnProperty(prefix = "app", name = "block-job", havingValue = "true")
public class BlockCoinUpdateJob {
 
    @Resource
    private BlockCoinService blockCoinService;
 
    @Resource
    private TrxUsdtUpdateService trxUsdtUpdateService;
 
    @Resource
    RedisUtils redisUtils;
 
    /**
     * TRC20_USDT 同步
     */
    @Scheduled(cron = "0/3 * * * * ? ")
    public void usdtTc20Update() {
        // 波场3秒出一个块
        trxUsdtUpdateService.monitorCoinListener();
    }
 
    /**
     * ETH_USDT 同步 使用扫块 废弃这个定时任务
     */
    //@Scheduled(cron = "0 0/10 * * * ? ")
    @Deprecated
    public void ethUsdtUpdate() {
        blockCoinService.updateEthUsdt();
    }
 
    /**
     * eth 同步
     */
    @Scheduled(cron = "0 1/20 * * * ? ")
    public void ethUpdate() {
        blockCoinService.updateEth();
    }
 
    /**
     * BTC_USDT 同步
     */
//    @Scheduled(cron = "0 2/10 * * * ? ")
    public void btcUsdtUpdate() {
        blockCoinService.updateBtcUsdt();
    }
 
    //    @Scheduled(cron = "0 3/20 * * * ? ")
    public void btcUpdate() {
        blockCoinService.updateBtc();
    }
 
    //    @Scheduled(cron = "0 4/20 * * * ? ")
    public void eosUpdate() {
        blockCoinService.updateEos();
    }
 
    //    @Scheduled(cron = "0 6/20 * * * ? ")
    public void xrpUpdate() {
        blockCoinService.updateXrp();
    }
 
}