From 52725f177acbe4ccf6b1fab059353890c4b55814 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期二, 18 三月 2025 09:13:36 +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/mdk/sample/PredictSampleDataConstructor.java   |    7 +------
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java          |    6 +++++-
 3 files changed, 6 insertions(+), 9 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 7dd2fc5..5bdc50a 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
@@ -50,8 +50,6 @@
 
     @Override
     public List<InfluxModelResultVO> queryModelResults(InfluxModelResultPOJO pojo, Date startTime, Date endTime) {
-        Calendar calendar = Calendar.getInstance();
-        calendar.set(Calendar.MILLISECOND, 0);
         String start = startTime.toInstant().toString();
 
         if (startTime.getTime() == endTime.getTime()) {
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 b08e5a7..f5d23e7 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
@@ -202,12 +202,7 @@
                 break;
             case NORMALITEM:
             case MERGEITEM:
-                List<DataValueVO> predictValue = new ArrayList<>();
-                if (columnItem.getStartTime().getTime() == columnItem.getEndTime().getTime()) {
-                    predictValue = mmItemResultService.getPredictValueLast(columnItem.getParamId(), columnItem.getStartTime(), 2);
-                } else {
-                    predictValue = mmItemResultService.getPredictValue(columnItem.getParamId(), 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 e4ba98b..6468d20 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
@@ -80,6 +80,8 @@
         Date dateTime = new Date();
         switch (ModelParamType.getEumByCode(columnItem.getParamType())) {
             case DATAPOINT:
+                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), columnItem.getGranularity());
+                break;
             case PLAN:
                 dateTime = calculateTime(originalTime, true, columnItem.getDataLength() + 1, columnItem.getGranularity());
                 break;
@@ -111,6 +113,8 @@
         calendar.setTime(originalTime);
         switch (ModelParamType.getEumByCode(columnItem.getParamType())) {
             case DATAPOINT:
+                dateTime = calculateTime(originalTime, true, 1, columnItem.getGranularity());
+                break;
             case PLAN:
                 dateTime = calculateTime(originalTime, true, 1, columnItem.getGranularity());
                 break;
@@ -120,7 +124,7 @@
                 break;
             case NORMALITEM:
             case MERGEITEM:
-                dateTime = calculateTime(originalTime, false, columnItem.getDataLength() + 1, columnItem.getGranularity());
+                dateTime = calculateTime(originalTime, false, columnItem.getDataLength(), columnItem.getGranularity());
                 break;
             default:
                 break;

--
Gitblit v1.9.3