From c4b37d26df82e2988e4784d847ff75102c2121c4 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期三, 25 十二月 2024 15:30:53 +0800 Subject: [PATCH] 预测项输入特殊处理double类型 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 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 60149c3..5736ec7 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 @@ -8,8 +8,10 @@ import com.iailab.module.data.api.point.dto.ApiPointValueQueryDTO; import com.iailab.module.data.common.ApiDataQueryDTO; import com.iailab.module.data.common.ApiDataValueDTO; +import com.iailab.module.model.common.enums.OutResultType; import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; import com.iailab.module.model.mcs.pre.service.MmItemOutputService; +import com.iailab.module.model.mcs.pre.service.MmItemResultJsonService; import com.iailab.module.model.mcs.pre.service.MmItemResultService; import com.iailab.module.model.mcs.pre.service.MmItemTypeService; import com.iailab.module.model.mdk.common.enums.ModelParamType; @@ -19,6 +21,7 @@ import com.iailab.module.model.mdk.sample.dto.SampleInfo; import com.iailab.module.model.mdk.vo.DataValueVO; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -45,6 +48,9 @@ @Autowired private MmItemResultService mmItemResultService; + + @Autowired + private MmItemResultJsonService mmItemResultJsonService; @Autowired private MmItemTypeService mmItemTypeService; @@ -141,8 +147,27 @@ break; case NORMALITEM: case MERGEITEM: -// MmItemOutputEntity outPut = mmItemOutputService.getOutPutById(columnItem.getParamId()); - List<DataValueVO> predictValue = mmItemResultService.getPredictValue(columnItem.getParamId(), columnItem.getStartTime(), columnItem.getEndTime()); + 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; + } if (CollectionUtils.isEmpty(predictValue)) { break; } -- Gitblit v1.9.3