From 037fb7228bdcb0909a6c8109adfae861cd9067f1 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期三, 25 十二月 2024 17:03:46 +0800 Subject: [PATCH] double类型特殊处理 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java | 31 ++++++++++++++----------------- 1 files changed, 14 insertions(+), 17 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..6b61389 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 @@ -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.equals(OutResultType.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); + } + } else { + predictValue = mmItemResultService.getPredictValue(outPut.getId(), columnItem.getStartTime(), columnItem.getEndTime()); } + if (CollectionUtils.isEmpty(predictValue)) { break; } -- Gitblit v1.9.3