From e2b151e9bed2b6798cfc1ed499e98bcb0665d6ec Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 25 十二月 2024 12:00:55 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java | 4 +++- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java | 30 +++--------------------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java index 093156e..441e19b 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java @@ -166,7 +166,9 @@ default: break; } - log.info("数据获取,columnItem:" + columnItem + ",dataList" + dataList); + // 避免生产环境日志过多,分级打印 + log.debug("数据获取,columnItem:" + columnItem + ",dataList" + dataList); + log.info("数据获取,columnItem:" + columnItem + ",dataListLength" + dataList.size()); return dataList; } } 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