From 874dd8d939b4ae61efbb799855c9ddf328722972 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 25 十二月 2024 18:08:08 +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 | 30 +++--------------------------- 1 files changed, 3 insertions(+), 27 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 6057a7b..53bed0b 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 @@ -100,7 +100,7 @@ break; case NORMALITEM: case MERGEITEM: - dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), 60); + dateTime = calendar.getTime(); break; case IND: dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), 60); @@ -132,25 +132,17 @@ calendar.setTime(originalTime); switch (ModelParamType.getEumByCode(columnItem.getParamType())) { case DATAPOINT: - ApiPointDTO dataPoint = pointMap.get(columnItem.getParamId()); - if (dataPoint == null) { - return null; - } dateTime = calendar.getTime(); break; case NORMALITEM: case MERGEITEM: - dateTime = calendar.getTime(); + dateTime = calculateTime(originalTime, false, columnItem.getDataLength(), 60); break; case IND: dateTime = calendar.getTime(); break; case PLAN: - ApiPlanItemDTO apiPlanItemDTO = planMap.get(columnItem.getParamId()); - if (apiPlanItemDTO == null) { - return null; - } - dateTime = calculateDate(originalTime, false, columnItem.getDataLength(), TimeGranularitySecEnum.getEumByCode(apiPlanItemDTO.getTimeGranularity()).getValue()); + dateTime = calendar.getTime(); break; default: break; @@ -213,22 +205,6 @@ calendar.set(Calendar.MILLISECOND, 0); // 数据长度 * 粒度 calendar.add(Calendar.SECOND, timeLength * granularity); - return calendar.getTime(); - } - - public Date calculateDate(Date originalTime, Boolean backward, int dataLength, int field) { - int timeLength; - if (backward) { - timeLength = (-1) * dataLength; - } else { - timeLength = dataLength - 1; - } - Date desTime = originalTime; - Calendar calendar = Calendar.getInstance(); - calendar.setTime(desTime); - calendar.set(Calendar.MILLISECOND, 0); - // 数据长度 * 粒度 - calendar.add(Calendar.SECOND, timeLength); return calendar.getTime(); } } \ No newline at end of file -- Gitblit v1.9.3