From bd90850664bfe4b43df094321e811f3bb398f97f Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 12 十二月 2024 18:01:01 +0800
Subject: [PATCH] resultIndex

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/enums/CommonConstant.java                  |    2 ++
 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 |    6 ++++--
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java                               |    7 ++++++-
 4 files changed, 13 insertions(+), 4 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 e1d951c..3fa6115 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
@@ -302,6 +302,11 @@
         if (resultStr == null) {
             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) {
             return result;
@@ -322,7 +327,7 @@
 
         List<String> categories = DateUtils.getTimeScale(startTime, endTime, predictItem.getGranularity(), timeFormat);
         List<String> legend = new ArrayList<>();
-        MmItemOutputEntity outPut = mmItemOutputService.getByItemid(predictItem.getId(), resultStr);
+        MmItemOutputEntity outPut = mmItemOutputService.getByItemid(predictItem.getId(), resultStr, Integer.parseInt(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/common/enums/CommonConstant.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/enums/CommonConstant.java
index d9c3f10..9022b9f 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/enums/CommonConstant.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/enums/CommonConstant.java
@@ -36,6 +36,8 @@
 
     String RESULT_STR = "RESULT_STR";
 
+    String RESULT_INDEX = "RESULT_INDEX";
+
     String LENGTH_LEFT = "LENGTH_LEFT";
 
     String LENGTH_RIGHT = "LENGTH_RIGHT";
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 1621867..c4cc726 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);
+    MmItemOutputEntity getByItemid(String itemid, String resultstr, Integer 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 3ab68e9..022a12e 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
@@ -74,9 +74,11 @@
     }
 
     @Override
-    public MmItemOutputEntity getByItemid(String itemid, String resultstr) {
+    public MmItemOutputEntity getByItemid(String itemid, String resultstr, Integer resultIndex) {
         QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("itemid", itemid).eq("resultstr", resultstr);
+        queryWrapper.eq("itemid", itemid)
+                .eq("resultstr", resultstr)
+                .eq("result_index", resultIndex);
         return mmItemOutputDao.selectOne(queryWrapper);
     }
 

--
Gitblit v1.9.3