From 72c8e506e13f3b35476bfd65bfe07c22bf23c755 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期二, 25 三月 2025 07:15:48 +0800
Subject: [PATCH] 氧气调度 调整速率

---
 shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleOnaOptTask.java |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleOnaOptTask.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleOnaOptTask.java
index 18598ba..0fe638c 100644
--- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleOnaOptTask.java
+++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleOnaOptTask.java
@@ -162,6 +162,7 @@
 
     private void saveScheduleSuggest(String title, String content, String scheduleObj, Date scheduleTime) {
         if (StringUtils.isBlank(content)) {
+            logger.info(title + "调整值为空,不产生建议");
             return;
         }
 
@@ -176,19 +177,20 @@
 
     private void saveScheduleSuggest(String title, String content, String scheduleObj, Date scheduleTime, BigDecimal adjustValue, int adjustRate) {
         if (StringUtils.isBlank(content)) {
+            logger.info(title + "调整值为空,不产生建议");
             return;
         }
         if (adjustValue == null || adjustValue.doubleValue() == 0) {
             logger.info(title + "调整值为空,不产生建议");
             return;
         }
-        if (gasAdjustMode.containsKey(scheduleObj) && gasAdjustMode.get(scheduleObj).equals(adjustValue.compareTo(BigDecimal.ZERO)) &&
-                gasLastSugTime.containsKey(scheduleObj) && (scheduleTime.getTime() - gasLastSugTime.get(scheduleObj).getTime() <= Integer.valueOf(adjustRate).longValue() * 60 * 1000)) {
+        if (gasAdjustMode.containsKey(title) && gasAdjustMode.get(title).equals(adjustValue.compareTo(BigDecimal.ZERO)) &&
+                gasLastSugTime.containsKey(title) && (scheduleTime.getTime() - gasLastSugTime.get(title).getTime() <= Integer.valueOf(adjustRate).longValue() * 60 * 1000)) {
             logger.info("调整建议在有效期内");
             return;
         }
-        gasAdjustMode.put(scheduleObj,  adjustValue.compareTo(BigDecimal.ZERO));
-        gasLastSugTime.put(scheduleObj, scheduleTime);
+        gasAdjustMode.put(title,  adjustValue.compareTo(BigDecimal.ZERO));
+        gasLastSugTime.put(title, scheduleTime);
 
         ScheduleSuggestRespDTO suggest = new ScheduleSuggestRespDTO();
         suggest.setTitle(title);

--
Gitblit v1.9.3