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.Async; 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 * * * * ? ") @Async 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(); } }