From 6c2ff1c7c8e0aba3af92110b76687b78f8278e86 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 03 一月 2025 09:57:37 +0800
Subject: [PATCH] 动态数据长度

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleDataConstructor.java |   23 +++++------------------
 1 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleDataConstructor.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleDataConstructor.java
index c25dae4..1aa3e26 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleDataConstructor.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleDataConstructor.java
@@ -6,6 +6,7 @@
 import com.iailab.module.data.api.point.dto.ApiPointDTO;
 import com.iailab.module.data.enums.DataPointFreqEnum;
 import com.iailab.module.data.enums.TimeGranularitySecEnum;
+import com.iailab.module.model.mcs.pre.enums.PredGranularityEnum;
 import com.iailab.module.model.mdk.common.enums.ModelParamType;
 import com.iailab.module.model.mdk.sample.dto.SampleData;
 import com.iailab.module.model.mdk.sample.dto.SampleInfo;
@@ -63,24 +64,10 @@
             case NORMALITEM:
             case MERGEITEM:
                 // 预测值
-                Calendar calendar = Calendar.getInstance();
-                calendar.setTime(startTime);
-                calendar.set(Calendar.HOUR_OF_DAY, 0);
-                calendar.set(Calendar.MINUTE, 0);
-                calendar.set(Calendar.SECOND, 0);
-                calendar.add(Calendar.DAY_OF_YEAR, 1);
-                startTime = calendar.getTime();
-                start = startTime.getTime();
-
-                calendar.setTime(endTime);
-                calendar.set(Calendar.HOUR_OF_DAY, 0);
-                calendar.set(Calendar.MINUTE, 0);
-                calendar.set(Calendar.SECOND, 0);
-                endTime = calendar.getTime();
-                end = endTime.getTime();
-
-                oneMin = 60 * 1000L;
-                mins = ((end - start) / oneMin);
+                oneMin = PredGranularityEnum.MIN1.getCode() * 1000L;
+                start = start - (start % oneMin);
+                end = end - (end % oneMin);
+                mins = ((end - start) / oneMin) + 1;
                 break;
             case DATAPOINT:
                 // 测点值

--
Gitblit v1.9.3