From e03a3567aa5ae98cf3d17efcf8bae535d13d3860 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 02 四月 2025 20:15:27 +0800
Subject: [PATCH] POINT columnItem.getDataLength() - 1

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

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 ba11c8b..6c60377 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
@@ -1,6 +1,5 @@
 package com.iailab.module.model.mdk.sample;
 
-import com.iailab.module.data.api.ind.IndItemApi;
 import com.iailab.module.data.api.ind.dto.ApiIndItemDTO;
 import com.iailab.module.data.api.plan.dto.ApiPlanItemDTO;
 import com.iailab.module.data.api.point.dto.ApiPointDTO;
@@ -25,9 +24,6 @@
 abstract class SampleInfoConstructor {
 
     @Autowired
-    private IndItemApi indItemApi;
-
-    @Autowired
     private MmPredictItemService mmPredictItemService;
 
     /**
@@ -39,7 +35,9 @@
      */
     protected SampleInfo prepareSampleInfo(String modelId, Date predictTime, Map<Integer, Integer> dynamicDataLength) {
         //样本的列信息
-        return getColumnInfo(modelId, predictTime, dynamicDataLength);
+        SampleInfo sampleInfo = getColumnInfo(modelId, predictTime, dynamicDataLength);
+        sampleInfo.setPredictTime(predictTime);
+        return sampleInfo;
     }
 
     /**
@@ -80,12 +78,15 @@
         Date dateTime = new Date();
         switch (ModelParamType.getEumByCode(columnItem.getParamType())) {
             case DATAPOINT:
+                dateTime = calculateTime(originalTime, true,
+                        columnItem.getDataLength() > 1 ? (columnItem.getDataLength() - 1) : columnItem.getDataLength(), columnItem.getGranularity());
+                break;
             case PLAN:
-                dateTime = calculateTime(originalTime, true, columnItem.getDataLength() + 1, columnItem.getGranularity());
+                dateTime = originalTime;
                 break;
             case IND:
             case IND_ASCII:
-                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), columnItem.getGranularity());
+                dateTime = calculateTime(originalTime, true, columnItem.getDataLength() - 1, columnItem.getGranularity());
                 break;
             case NORMALITEM:
             case MERGEITEM:
@@ -111,10 +112,14 @@
         calendar.setTime(originalTime);
         switch (ModelParamType.getEumByCode(columnItem.getParamType())) {
             case DATAPOINT:
+                dateTime = calculateTime(originalTime, true, 0, columnItem.getGranularity());
+                break;
             case PLAN:
+                dateTime = calculateTime(originalTime, false, columnItem.getDataLength()-1, columnItem.getGranularity());
+                break;
             case IND:
             case IND_ASCII:
-                dateTime = calculateTime(originalTime, true, 1, columnItem.getGranularity());
+                dateTime = originalTime;
                 break;
             case NORMALITEM:
             case MERGEITEM:

--
Gitblit v1.9.3