From 657d32630b602da78cd9dd7e7721400dc64715d6 Mon Sep 17 00:00:00 2001 From: dorion <872354125@qq.com> Date: Wed, 5 Jun 2024 23:52:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=99=BD=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E5=AE=A2=E6=88=B7=E6=8C=87=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E4=B8=8D=E5=9B=9E=E6=94=B6=E8=83=BD=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/handler/UndelegateEnergyHandler.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/handler/UndelegateEnergyHandler.java b/ruoyi-system/src/main/java/com/ruoyi/system/handler/UndelegateEnergyHandler.java index afdac651e..01761fe4a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/handler/UndelegateEnergyHandler.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/handler/UndelegateEnergyHandler.java @@ -17,6 +17,7 @@ import com.ruoyi.system.dto.TronGridResponse; import com.ruoyi.system.mapper.TenantInfoMapper; import com.ruoyi.system.mapper.TrxExchangeInfoMapper; import com.ruoyi.system.service.IErrorLogService; +import com.ruoyi.system.service.ISysConfigService; import lombok.extern.slf4j.Slf4j; import org.redisson.Redisson; import org.redisson.api.RLock; @@ -49,6 +50,8 @@ public class UndelegateEnergyHandler { @Autowired private ITronApi tronApi; + @Autowired + private ISysConfigService configService; @Autowired private IErrorLogService errorLogService; @@ -64,9 +67,17 @@ public class UndelegateEnergyHandler { if (betweenHours < lockPeriod) { - - - + String sysEnergyUndelegateWhitelistString = configService.selectConfigByKey("sys.energy.undelegate.whitelist"); + if (StringUtils.isNotEmpty(sysEnergyUndelegateWhitelistString) && sysEnergyUndelegateWhitelistString.contains(trxExchangeMonitorAccountInfo.getFromAddress())){ + String sysEnergyUndelegatePeriod = configService.selectConfigByKey("sys.energy.undelegate.period"); + if (StringUtils.isNotEmpty(sysEnergyUndelegatePeriod)){ + long betweenMinutes = DateUtil.between(fcd, now, DateUnit.MINUTE); + Long betweenMinutesLong = new Long(sysEnergyUndelegatePeriod); + if (betweenMinutes < betweenMinutesLong){ + return; + } + } + } //定时任务判断对方转账笔数 // String apiKey = trxExchangeMonitorAccountInfo.getApiKey(); //