From 033e696ffd783f3d78a16c1a359353ec6a7aeec2 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期三, 08 一月 2025 11:31:38 +0800
Subject: [PATCH] 预测参数查询调整

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/influxdb/service/impl/InfluxDBServiceImpl.java        |    2 +-
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java |    9 ---------
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java          |   18 +-----------------
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemResultJsonService.java          |    2 --
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java                 |    2 +-
 5 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/influxdb/service/impl/InfluxDBServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/influxdb/service/impl/InfluxDBServiceImpl.java
index 431a988..3e93489 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/influxdb/service/impl/InfluxDBServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/influxdb/service/impl/InfluxDBServiceImpl.java
@@ -53,7 +53,7 @@
         String start = startTime.toInstant().toString();
 
         if (startTime.getTime() == endTime.getTime()) {
-            // 如果相等,则engTime加1毫秒,负责influxdb报错(因为influxdb的range函数是左闭右开区间,所以将engTime加一毫秒,才可以查到startTime时间点的数据)
+            // 如果相等,则engTime加1毫秒,否则influxdb报错(因为influxdb的range函数是左闭右开区间,所以将engTime加一毫秒,才可以查到startTime时间点的数据)
             endTime.setTime(endTime.getTime() + 1);
         }
         String stop = endTime.toInstant().toString();
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemResultJsonService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemResultJsonService.java
index 0709d14..dbee2e4 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemResultJsonService.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemResultJsonService.java
@@ -15,7 +15,5 @@
 
     List<Object[]> getData(String outputId, Date predictTime, String timeFormat);
 
-    String getDoubleData(String outputId, Date predictTime);
-
     void insert(List<MmItemResultJsonEntity> resultJsonList);
 }
\ No newline at end of file
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java
index 4f7c1fa..7f7a424 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java
@@ -50,15 +50,6 @@
     }
 
     @Override
-    public String getDoubleData(String outputId, Date predictTime) {
-        QueryWrapper<MmItemResultJsonEntity> wrapper = new QueryWrapper<>();
-        wrapper.eq("outputid", outputId)
-                .eq("predicttime", predictTime);
-        MmItemResultJsonEntity mmItemResultJsonEntity = baseDao.selectOne(wrapper);
-        return null == mmItemResultJsonEntity ? null : mmItemResultJsonEntity.getCumulant();
-    }
-
-    @Override
     public void insert(List<MmItemResultJsonEntity> resultJsonList) {
         baseDao.insertBatch(resultJsonList);
     }
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java
index 21c9b82..5c680ed 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java
@@ -147,23 +147,7 @@
                 break;
             case NORMALITEM:
             case MERGEITEM:
-                MmItemOutputEntity outPut = mmItemOutputService.getOutPutById(columnItem.getParamId());
-                OutResultType outResultType = OutResultType.getEumByCode(outPut.getResultType());
-                List<DataValueVO> predictValue = new ArrayList<>();
-
-                // double类型特殊处理
-                if (OutResultType.D.equals(outResultType)) {
-                    // columnItem.getStartTime()就是预测时间
-                    String doubleData = mmItemResultJsonService.getDoubleData(outPut.getId(), columnItem.getStartTime());
-                    if (StringUtils.isNotBlank(doubleData)) {
-                        DataValueVO dataValueVO = new DataValueVO();
-                        dataValueVO.setDataTime(columnItem.getStartTime());
-                        dataValueVO.setDataValue(Double.valueOf(doubleData));
-                        predictValue.add(dataValueVO);
-                    }
-                } else {
-                    predictValue = mmItemResultService.getPredictValue(outPut.getId(), columnItem.getStartTime(), columnItem.getEndTime());
-                }
+                List<DataValueVO> predictValue = mmItemResultService.getPredictValue(columnItem.getParamId(), columnItem.getStartTime(), columnItem.getEndTime());
 
                 if (CollectionUtils.isEmpty(predictValue)) {
                     break;
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java
index ce370a3..f025e51 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java
@@ -187,7 +187,7 @@
         if (backward) {
             timeLength = (-1) * dataLength;
         } else {
-            timeLength = dataLength - 1;
+            timeLength = dataLength;
         }
         Date desTime = originalTime;
         Calendar calendar = Calendar.getInstance();

--
Gitblit v1.9.3