From 82e98b24e0871366a5fc8bddab07bbabfc321eb3 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期一, 17 三月 2025 14:54:29 +0800 Subject: [PATCH] 构造样本优化 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 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 48fa7e8..e4ba98b 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 @@ -78,19 +78,18 @@ */ 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: case PLAN: - dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), columnItem.getGranularity()); + dateTime = calculateTime(originalTime, true, columnItem.getDataLength() + 1, columnItem.getGranularity()); break; case IND: - dateTime = calculateTime(originalTime, true, columnItem.getDataLength()-1, columnItem.getGranularity()); + case IND_ASCII: + dateTime = calculateTime(originalTime, true, columnItem.getDataLength() - 1, columnItem.getGranularity()); break; case NORMALITEM: case MERGEITEM: - dateTime = calendar.getTime(); + dateTime = calculateTime(originalTime, false, 1, columnItem.getGranularity()); break; default: break; @@ -112,13 +111,16 @@ calendar.setTime(originalTime); switch (ModelParamType.getEumByCode(columnItem.getParamType())) { case DATAPOINT: - case IND: case PLAN: - dateTime = calendar.getTime(); + dateTime = calculateTime(originalTime, true, 1, columnItem.getGranularity()); + break; + case IND: + case IND_ASCII: + dateTime = originalTime; break; case NORMALITEM: case MERGEITEM: - dateTime = calculateTime(originalTime, false, columnItem.getDataLength(), columnItem.getGranularity()); + dateTime = calculateTime(originalTime, false, columnItem.getDataLength() + 1, columnItem.getGranularity()); break; default: break; @@ -146,6 +148,7 @@ granularity = mmPredictItemService.getItemByOutPutId(columnItem.getParamId()).getGranularity(); break; case IND: + case IND_ASCII: ApiIndItemDTO indItemDTO = indMap.get(columnItem.getParamId()); granularity = TimeGranularitySecEnum.getEumByCode(indItemDTO.getTimeGranularity()).getValue();; break; -- Gitblit v1.9.3