From aa0382e44311f9f7e62a688c8fcaa9c69a512e0f Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期二, 24 十二月 2024 15:15:10 +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/SampleDataConstructor.java | 21 ++++----------------- 1 files changed, 4 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 c25dae4..e3c6e3e 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 @@ -6,6 +6,7 @@ import com.iailab.module.data.api.point.dto.ApiPointDTO; import com.iailab.module.data.enums.DataPointFreqEnum; import com.iailab.module.data.enums.TimeGranularitySecEnum; +import com.iailab.module.model.mcs.pre.enums.PredGranularityEnum; import com.iailab.module.model.mdk.common.enums.ModelParamType; import com.iailab.module.model.mdk.sample.dto.SampleData; import com.iailab.module.model.mdk.sample.dto.SampleInfo; @@ -63,23 +64,9 @@ case NORMALITEM: case MERGEITEM: // 预测值 - Calendar calendar = Calendar.getInstance(); - calendar.setTime(startTime); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - calendar.add(Calendar.DAY_OF_YEAR, 1); - startTime = calendar.getTime(); - start = startTime.getTime(); - - calendar.setTime(endTime); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - endTime = calendar.getTime(); - end = endTime.getTime(); - - oneMin = 60 * 1000L; + oneMin = PredGranularityEnum.MIN1.getCode() * 1000L; + start = start - (start % oneMin) + oneMin; + end = end - (end % oneMin) + oneMin; mins = ((end - start) / oneMin); break; case DATAPOINT: -- Gitblit v1.9.3