From e691b98e02153c9c439d7f5acb468924572d75d9 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期四, 09 一月 2025 17:31:17 +0800 Subject: [PATCH] item动态时间粒度 --- 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