From 10ae4a7dac33efa40cc7a8ddcf926864a09aace9 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 19 三月 2025 11:27:34 +0800
Subject: [PATCH] 调整速率

---
 iailab-module-model/iailab-module-model-biz/db/增量SQL/2025.sql                                                                          |    1 +
 iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StScheduleSchemeDTO.java                 |    5 +++++
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSchemeEntity.java          |    5 +++++
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeRespVO.java              |    3 +++
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java                                  |    8 +++++++-
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustConfigServiceImpl.java |    2 +-
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeSaveReqVO.java           |    3 +++
 7 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StScheduleSchemeDTO.java b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StScheduleSchemeDTO.java
index c3fbaad..c46479e 100644
--- a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StScheduleSchemeDTO.java
+++ b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StScheduleSchemeDTO.java
@@ -78,4 +78,9 @@
      * 项目ID
      */
     private String mpkprojectid;
+
+    /**
+     * 调整速率
+     */
+    private Integer adjustRate;
 }
diff --git "a/iailab-module-model/iailab-module-model-biz/db/\345\242\236\351\207\217SQL/2025.sql" "b/iailab-module-model/iailab-module-model-biz/db/\345\242\236\351\207\217SQL/2025.sql"
new file mode 100644
index 0000000..b1c85d8
--- /dev/null
+++ "b/iailab-module-model/iailab-module-model-biz/db/\345\242\236\351\207\217SQL/2025.sql"
@@ -0,0 +1 @@
+alter table t_st_schedule_scheme add column `adjust_rate` int DEFAULT NULL COMMENT '调整速率';
\ No newline at end of file
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java
index 883b075..670871c 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java
@@ -211,9 +211,15 @@
                 continue;
             }
             String firstOutKey = entry.getValue().get(0).getOutKey();
+            if(StringUtils.isBlank(firstOutKey)) {
+                continue;
+            }
+            if(reqDTO.getModelResult().get(firstOutKey) == null || StringUtils.isBlank(reqDTO.getModelResult().get(firstOutKey).toString())) {
+                continue;
+            }
             BigDecimal firstAdjustValue = new BigDecimal(reqDTO.getModelResult().get(firstOutKey.trim()).toString().trim());
             if (BigDecimal.ZERO.compareTo(firstAdjustValue) == 0) {
-                log.info("adjustValue = ZERO");
+                log.info("firstAdjustValue = ZERO");
                 continue;
             }
             for (StAdjustConfigDetEntity det : entry.getValue()) {
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSchemeEntity.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSchemeEntity.java
index 79fea25..aa80cba 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSchemeEntity.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSchemeEntity.java
@@ -88,4 +88,9 @@
      * 运行状态
      */
     private String runStatus;
+
+    /**
+     * 调整速率
+     */
+    private Integer adjustRate;
 }
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustConfigServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustConfigServiceImpl.java
index 335d715..d9cf83a 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustConfigServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustConfigServiceImpl.java
@@ -94,7 +94,7 @@
         queryWrapper.eq("schedule_model_id", modelId)
                 .eq("status", AdjustConfigStatusEnum.ENABLE.getCode());
         List<StAdjustConfigEntity> configList =  baseDao.selectList(queryWrapper);
-        if (!CollectionUtils.isEmpty(configList)) {
+        if (CollectionUtils.isEmpty(configList)) {
             return result;
         }
         for (StAdjustConfigEntity entity : configList) {
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeRespVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeRespVO.java
index 307256b..004d169 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeRespVO.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeRespVO.java
@@ -57,4 +57,7 @@
 
     @Schema(description = "运行状态")
     private String runStatus;
+
+    @Schema(description = "调整速率")
+    private Integer adjustRate;
 }
\ No newline at end of file
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeSaveReqVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeSaveReqVO.java
index 71bebcd..d0ecb8b 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeSaveReqVO.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeSaveReqVO.java
@@ -52,4 +52,7 @@
 
     @Schema(description = "项目ID")
     private String mpkprojectid;
+
+    @Schema(description = "调整速率")
+    private Integer adjustRate;
 }
\ No newline at end of file

--
Gitblit v1.9.3