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/SampleDataConstructor.java |   23 ++++++-----------------
 1 files changed, 6 insertions(+), 17 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 e3c6e3e..5f5befc 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
@@ -42,11 +42,9 @@
      * @param dataEntityList
      * @param startTime
      * @param endTime
-     * @param planMap
      * @return
      */
-    public List<DataValueVO> completionData(int length, List<DataValueVO> dataEntityList, Date startTime, Date endTime,
-                                            String paramId, String paramType, Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) {
+    public List<DataValueVO> completionData(int length, List<DataValueVO> dataEntityList, Date startTime, Date endTime, String paramType, Integer granularity) {
         if (CollectionUtils.isEmpty(dataEntityList) || length == dataEntityList.size()) {
             return dataEntityList;
         } else if (length < dataEntityList.size()) {
@@ -64,15 +62,15 @@
             case NORMALITEM:
             case MERGEITEM:
                 // 预测值
-                oneMin = PredGranularityEnum.MIN1.getCode() * 1000L;
-                start = start - (start % oneMin) + oneMin;
-                end = end - (end % oneMin) + oneMin;
+                oneMin = granularity * 1000L;
+                start = start - (start % oneMin);
+                end = end - (end % oneMin);
                 mins = ((end - start) / oneMin);
                 break;
             case DATAPOINT:
+            case PLAN:
                 // 测点值
-                ApiPointDTO dataPoint = pointMap.get(paramId);
-                oneMin = 1000L * DataPointFreqEnum.getEumByCode(dataPoint.getMinfreqid()).getValue();
+                oneMin = 1000L * granularity;
                 // 设置时间偏移量
                 start = start - (start % oneMin) + oneMin;
                 end = end - (end % oneMin) + oneMin;
@@ -93,15 +91,6 @@
                 calendar2.set(Calendar.MINUTE, 0);
                 calendar2.set(Calendar.SECOND, 0);
                 end = calendar2.getTime().getTime();
-                mins = ((end - start) / oneMin);
-                break;
-            case PLAN:
-                // 计划数据
-                ApiPlanItemDTO planItem = planMap.get(paramId);
-                oneMin = 1000L * TimeGranularitySecEnum.getEumByCode(planItem.getTimeGranularity()).getValue();
-                // 设置时间偏移量
-                start = start - (start % oneMin) + oneMin;
-                end = end - (end % oneMin) + oneMin;
                 mins = ((end - start) / oneMin);
                 break;
             default:

--
Gitblit v1.9.3