From 730d1944e3a13c517c77df2b0712df05645a38dd Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期一, 06 一月 2025 16:00:58 +0800 Subject: [PATCH] chartParamList api --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java | 37 +++++++++++++++++-------------------- 1 files changed, 17 insertions(+), 20 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 5736ec7..21c9b82 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 @@ -66,7 +66,7 @@ * @return */ @Override - public List<SampleData> prepareSampleData(SampleInfo sampleInfo) throws Exception { + public List<SampleData> prepareSampleData(SampleInfo sampleInfo) throws Exception { List<SampleData> sampleDataList = new ArrayList<>(); Map<String, ApiPointDTO> pointMap = sampleInfo.getPointMap(); Map<String, ApiPlanItemDTO> planMap = sampleInfo.getPlanMap(); @@ -91,11 +91,11 @@ //对每一项依次进行数据查询,然后将查询出的值赋给matrix对应的位置 for (int i = 0; i < entry.getColumnItemList().size(); i++) { try { - List<DataValueVO> dataEntityList = getData(entry.getColumnItemList().get(i),pointMap,planMap); + List<DataValueVO> dataEntityList = getData(entry.getColumnItemList().get(i), pointMap, planMap); //补全数据 ColumnItem columnItem = entry.getColumnItemList().get(i); dataEntityList = super.completionData(matrix.length, dataEntityList, columnItem.startTime, columnItem.endTime, - columnItem.paramId, columnItem.getParamType(),pointMap,planMap); + columnItem.paramId, columnItem.getParamType(), pointMap, planMap); /** 如果数据取不满,把缺失的数据点放在后面 */ if (dataEntityList != null && dataEntityList.size() != 0) { @@ -150,24 +150,21 @@ MmItemOutputEntity outPut = mmItemOutputService.getOutPutById(columnItem.getParamId()); OutResultType outResultType = OutResultType.getEumByCode(outPut.getResultType()); List<DataValueVO> predictValue = new ArrayList<>(); - switch (outResultType) { - case D1: - case D2: - predictValue = mmItemResultService.getPredictValue(outPut.getId(), columnItem.getStartTime(), columnItem.getEndTime()); - break; - case D: - // columnItem.getStartTime()就是预测时间 - String doubleData = mmItemResultJsonService.getDoubleData(outPut.getId(), columnItem.getStartTime()); - if (StringUtils.isNotBlank(doubleData)) { - DataValueVO dataValueVO = new DataValueVO(); - dataValueVO.setDataTime(columnItem.getStartTime()); - dataValueVO.setDataValue(Double.valueOf(doubleData)); - predictValue.add(dataValueVO); - } - break; - default: - break; + + // double类型特殊处理 + if (OutResultType.D.equals(outResultType)) { + // columnItem.getStartTime()就是预测时间 + String doubleData = mmItemResultJsonService.getDoubleData(outPut.getId(), columnItem.getStartTime()); + if (StringUtils.isNotBlank(doubleData)) { + DataValueVO dataValueVO = new DataValueVO(); + dataValueVO.setDataTime(columnItem.getStartTime()); + dataValueVO.setDataValue(Double.valueOf(doubleData)); + predictValue.add(dataValueVO); + } + } else { + predictValue = mmItemResultService.getPredictValue(outPut.getId(), columnItem.getStartTime(), columnItem.getEndTime()); } + if (CollectionUtils.isEmpty(predictValue)) { break; } -- Gitblit v1.9.3