From 2fe27eee95f46825fdeee267a42811a3069991c8 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期一, 23 十二月 2024 11:46:00 +0800
Subject: [PATCH] local

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java |   52 +++++++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 23 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 cd5f3f0..3d53588 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
@@ -46,14 +46,14 @@
      * @param predictTime
      * @return
      */
-    public SampleInfo prepareSampleInfo(String modelId, Date predictTime) {
+    protected SampleInfo prepareSampleInfo(String modelId, Date predictTime) {
         SampleInfo sampleInfo = new SampleInfo();
         //调用样本列数的方法
-        sampleInfo.setSampleColumn(getSampleColumn(modelId));
+//        sampleInfo.setSampleColumn(getSampleColumn(modelId));
         //样本的列信息
         sampleInfo.setColumnInfo(getColumnInfo(modelId, predictTime));
         //样本的采样周期
-        sampleInfo.setSampleCycle(getSampleCycle(modelId));
+//        sampleInfo.setSampleCycle(getSampleCycle(modelId));
         return sampleInfo;
     }
 
@@ -64,6 +64,24 @@
      * @return
      */
     protected abstract Integer getSampleColumn(String modelId);
+
+
+    /**
+     * 样本的列信息
+     *
+     * @param modelId
+     * @param predictTime
+     * @return
+     */
+    protected abstract List<ColumnItemPort> getColumnInfo(String modelId, Date predictTime);
+
+    /**
+     * 样本的采样周期
+     *
+     * @param modelId
+     * @return
+     */
+    protected abstract Integer getSampleCycle(String modelId);
 
     /**
      * 获取开始时间
@@ -85,7 +103,8 @@
                 }
                 dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), DataPointFreqEnum.getEumByCode(dataPoint.getMinfreqid()).getValue());
                 break;
-            case PREDICTITEM:
+            case NORMALITEM:
+            case MERGEITEM:
                 dateTime = calendar.getTime();
                 break;
             case IND:
@@ -120,7 +139,8 @@
                 }
                 dateTime = calendar.getTime();
                 break;
-            case PREDICTITEM:
+            case NORMALITEM:
+            case MERGEITEM:
                 dateTime = calendar.getTime();
                 break;
             case IND:
@@ -155,7 +175,10 @@
                 ApiPointDTO dataPoint = dataPointApi.getInfoById(columnItem.getParamId());
                 granularity = DataPointFreqEnum.getEumByCode(dataPoint.getMinfreqid()).getValue();
                 break;
-            case PREDICTITEM:
+            case NORMALITEM:
+                granularity = mmPredictItemService.getItemByOutPutId(columnItem.getParamId()).getGranularity();
+                break;
+            case MERGEITEM:
                 granularity = mmPredictItemService.getItemById(columnItem.getParamId()).getGranularity();
                 break;
             case IND:
@@ -171,23 +194,6 @@
         }
         return granularity;
     }
-
-    /**
-     * 样本的列信息
-     *
-     * @param modelId
-     * @param predictTime
-     * @return
-     */
-    protected abstract List<ColumnItemPort> getColumnInfo(String modelId, Date predictTime);
-
-    /**
-     * 样本的采样周期
-     *
-     * @param modelId
-     * @return
-     */
-    protected abstract Integer getSampleCycle(String modelId);
 
     /**
      * 计算取值的时间

--
Gitblit v1.9.3