From 271fed395d4d3e4ab8cdb44ccf466859ba485e46 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 09 一月 2025 17:45:33 +0800
Subject: [PATCH] Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java |   32 ++++++++------------------------
 1 files changed, 8 insertions(+), 24 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 f025e51..45273aa 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
@@ -76,31 +76,19 @@
      * @return
      * @throws Exception
      */
-    protected Date getStartTime(ColumnItem columnItem, Date originalTime, Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) {
+    protected Date getStartTime(ColumnItem columnItem, Date originalTime) {
         Date dateTime = new Date();
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(originalTime);
         switch (ModelParamType.getEumByCode(columnItem.getParamType())) {
             case DATAPOINT:
-                ApiPointDTO dataPoint = pointMap.get(columnItem.getParamId());
-                if (dataPoint == null) {
-                    return null;
-                }
-                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), DataPointFreqEnum.getEumByCode(dataPoint.getMinfreqid()).getValue());
+            case IND:
+            case PLAN:
+                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), columnItem.getGranularity());
                 break;
             case NORMALITEM:
             case MERGEITEM:
                 dateTime = calendar.getTime();
-                break;
-            case IND:
-                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), 60);
-                break;
-            case PLAN:
-                ApiPlanItemDTO apiPlanItemDTO = planMap.get(columnItem.getParamId());
-                if (apiPlanItemDTO == null) {
-                    return null;
-                }
-                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), TimeGranularitySecEnum.getEumByCode(apiPlanItemDTO.getTimeGranularity()).getValue());
                 break;
             default:
                 break;
@@ -116,23 +104,19 @@
      * @return
      * @throws Exception
      */
-    protected Date getEndTime(ColumnItem columnItem, Date originalTime,Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) {
+    protected Date getEndTime(ColumnItem columnItem, Date originalTime) {
         Date dateTime = new Date();
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(originalTime);
         switch (ModelParamType.getEumByCode(columnItem.getParamType())) {
             case DATAPOINT:
+            case IND:
+            case PLAN:
                 dateTime = calendar.getTime();
                 break;
             case NORMALITEM:
             case MERGEITEM:
-                dateTime = calculateTime(originalTime, false, columnItem.getDataLength(), 60);
-                break;
-            case IND:
-                dateTime = calendar.getTime();
-                break;
-            case PLAN:
-                dateTime = calendar.getTime();
+                dateTime = calculateTime(originalTime, false, columnItem.getDataLength(), columnItem.getGranularity());
                 break;
             default:
                 break;

--
Gitblit v1.9.3