| | |
| | | import cc.mrbird.febs.dapp.vo.RedisTransferPoolVo; |
| | | 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; |
| | | |
| | |
| | | **/ |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "system", name = "trade-job", havingValue = "true") |
| | | public class SystemTradeJob { |
| | | |
| | | @Autowired |
| | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | public void transferPoolVol() { |
| | | log.info("中转池容量"); |
| | | |
| | | String hasStart = redisUtils.getString(AppContants.SYSTEM_START_FLAG); |
| | | if (!"start".equals(hasStart)) { |
| | | log.info("系统未启动"); |
| | | return; |
| | | } |
| | | |
| | | // 源池初始化容量 |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.DIC_TYPE_SYSTEM_SETTING, AppContants.DIC_VALUE_SYSTEM_SOURCE_POOL_VOL); |
| | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | public void sourcePoolUsdtOutLimit() { |
| | | log.info("源池每日出U限制"); |
| | | |
| | | String hasStart = redisUtils.getString(AppContants.SYSTEM_START_FLAG); |
| | | if (!"start".equals(hasStart)) { |
| | | log.info("系统未启动"); |
| | | return; |
| | | } |
| | | BigDecimal sourceBalance = ChainService.getInstance(ChainEnum.BSC_USDT.name()).balanceOf(ChainEnum.BSC_USDT_SOURCE.getAddress()); |
| | | |
| | | BigDecimal total = sourceBalance.multiply(BigDecimal.valueOf(0.1)).setScale(4, RoundingMode.HALF_DOWN); |
| | |
| | | */ |
| | | @Scheduled(cron = "0 0 2 * * ?") |
| | | public void mineJob() { |
| | | log.info("挖矿"); |
| | | systemService.mining(); |
| | | } |
| | | } |