From 9aa63389a2124c76fd28fa6ee3271bf5b5eb3bf1 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期四, 20 三月 2025 08:53:03 +0800
Subject: [PATCH] 测试运行支持string类型

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

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..5647c66 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()) {
@@ -222,8 +228,8 @@
                 switch (PredictItemTypeEnum.getEumById(det.getItemTypeId())) {
                     case NormalItem:
                         double adjustValue = 0;
-                        if (StringUtils.isNotBlank(det.getOutKey().trim())) {
-                            adjustValue = new BigDecimal(reqDTO.getModelResult().get(det.getOutKey().trim()).toString()).doubleValue();
+                        if (StringUtils.isNotBlank(det.getOutKey())) {
+                            adjustValue = new BigDecimal(reqDTO.getModelResult().get(det.getOutKey()).toString()).doubleValue();
                         }
                         StAdjustDeviationDTO deviationItem = new StAdjustDeviationDTO();
                         deviationItem.setPortIdx(det.getModelParamPortOrder() == null ? 0 : det.getModelParamPortOrder());

--
Gitblit v1.9.3