From bdab69ab243b3f93c9bf9cbcd128bcfc4af216f8 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 13 十二月 2024 08:37:32 +0800
Subject: [PATCH] resultIndex

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java          |    2 +-
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java |    5 +++--
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java                               |    5 +----
 iailab-module-model/iailab-module-model-biz/src/main/resources/application-dev.yaml                                                 |    0 
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
index 3fa6115..fa66d48 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
@@ -303,9 +303,6 @@
             return result;
         }
         String resultIndex = chartParams.get(CommonConstant.RESULT_INDEX);
-        if (resultIndex == null) {
-            return result;
-        }
 
         ItemVO predictItem = mmPredictItemService.getItemByItemNo(itemCode);
         if (predictItem == null || predictItem.getLastTime() == null) {
@@ -327,7 +324,7 @@
 
         List<String> categories = DateUtils.getTimeScale(startTime, endTime, predictItem.getGranularity(), timeFormat);
         List<String> legend = new ArrayList<>();
-        MmItemOutputEntity outPut = mmItemOutputService.getByItemid(predictItem.getId(), resultStr, Integer.parseInt(resultIndex));
+        MmItemOutputEntity outPut = mmItemOutputService.getByItemid(predictItem.getId(), resultStr, resultIndex);
         PreDataViewRespDTO dataView = new PreDataViewRespDTO();
         dataView.setItemId(predictItem.getId());
         dataView.setItemName(predictItem.getItemName());
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java
index c4cc726..c006793 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java
@@ -22,7 +22,7 @@
 
     List<MmItemOutputEntity> getByItemid(String itemId);
 
-    MmItemOutputEntity getByItemid(String itemid, String resultstr, Integer resultIndex);
+    MmItemOutputEntity getByItemid(String itemid, String resultstr, String resultIndex);
 
     void deleteByItemId(String itemId);
 }
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java
index 022a12e..0e3bdc7 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java
@@ -6,6 +6,7 @@
 import com.iailab.module.model.mcs.pre.dto.MmItemOutputDTO;
 import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity;
 import com.iailab.module.model.mcs.pre.service.MmItemOutputService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -74,11 +75,11 @@
     }
 
     @Override
-    public MmItemOutputEntity getByItemid(String itemid, String resultstr, Integer resultIndex) {
+    public MmItemOutputEntity getByItemid(String itemid, String resultstr, String resultIndex) {
         QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("itemid", itemid)
                 .eq("resultstr", resultstr)
-                .eq("result_index", resultIndex);
+                .eq(StringUtils.isNotBlank(resultIndex), "result_index", resultIndex);
         return mmItemOutputDao.selectOne(queryWrapper);
     }
 
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/application-dev.yml b/iailab-module-model/iailab-module-model-biz/src/main/resources/application-dev.yaml
similarity index 100%
rename from iailab-module-model/iailab-module-model-biz/src/main/resources/application-dev.yml
rename to iailab-module-model/iailab-module-model-biz/src/main/resources/application-dev.yaml

--
Gitblit v1.9.3