From 8ba6a45012aa4d5bdc5bd404e73d36ad9ec327ca Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期五, 21 三月 2025 16:48:32 +0800 Subject: [PATCH] 如果模拟调整先查调整结果 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java | 37 ++++++++++++++++++++++++------------- 1 files changed, 24 insertions(+), 13 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 f5d23e7..7723944 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 @@ -14,10 +14,8 @@ import com.iailab.module.data.common.ApiDataQueryDTO; import com.iailab.module.data.common.ApiDataValueDTO; import com.iailab.module.model.common.utils.ASCIIUtil; -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.mcs.sche.service.StAdjustResultService; import com.iailab.module.model.mdk.common.enums.ModelParamType; import com.iailab.module.model.mdk.sample.dto.ColumnItem; import com.iailab.module.model.mdk.sample.dto.ColumnItemPort; @@ -57,13 +55,7 @@ private MmItemResultService mmItemResultService; @Autowired - private MmItemResultJsonService mmItemResultJsonService; - - @Autowired - private MmItemTypeService mmItemTypeService; - - @Autowired - private MmItemOutputService mmItemOutputService; + private StAdjustResultService stAdjustResultService; /** * alter by zfc 2020.11.24 修改数据样本构造方案:sampleInfo中数据已按爪子进行分类,但爪内数据为无序的, @@ -88,6 +80,15 @@ } } } + + // 判断要调整的列 + for (ColumnItemPort itemPort : sampleInfo.getColumnInfo()) { + + for (ColumnItem columnItem : itemPort.getColumnItemList()) { + + } + } + int portIdx = 1; //对每个爪分别进行计算 @@ -134,7 +135,7 @@ //对每一项依次进行数据查询,然后将查询出的值赋给matrix对应的位置 for (int i = 0; i < entry.getColumnItemList().size(); i++) { try { - List<DataValueVO> dataEntityList = getData(entry.getColumnItemList().get(i), pointMap, planMap, indMap); + List<DataValueVO> dataEntityList = getData(sampleInfo, entry.getColumnItemList().get(i), pointMap, planMap, indMap); //补全数据 ColumnItem columnItem = entry.getColumnItemList().get(i); @@ -173,6 +174,7 @@ /** * getData * + * @param sampleInfo * @param columnItem * @param pointMap * @param planMap @@ -180,7 +182,8 @@ * @return * @throws Exception */ - private List<DataValueVO> getData(ColumnItem columnItem, Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap, Map<String, ApiIndItemDTO> indMap) throws Exception { + private List<DataValueVO> getData(SampleInfo sampleInfo, ColumnItem columnItem, Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap, + Map<String, ApiIndItemDTO> indMap) throws Exception { List<DataValueVO> dataList = new ArrayList<>(); String paramType = columnItem.getParamType(); switch (ModelParamType.getEumByCode(paramType)) { @@ -202,11 +205,19 @@ break; case NORMALITEM: case MERGEITEM: - List<DataValueVO> predictValue = mmItemResultService.getPredictValue(columnItem.getParamId(), columnItem.getStartTime(), columnItem.getEndTime()); + List<DataValueVO> predictValue = new ArrayList<>(); + if (sampleInfo.getIsAdjust()) { + // 如果模拟调整先查调整结果 + predictValue = stAdjustResultService.getPredictValue(columnItem.getParamId(), sampleInfo.getPredictTime()); + } + if (CollectionUtils.isEmpty(predictValue)) { + predictValue = mmItemResultService.getPredictValue(columnItem.getParamId(), columnItem.getStartTime(), columnItem.getEndTime()); + } if (CollectionUtils.isEmpty(predictValue)) { break; } dataList = predictValue; + break; case PLAN: ApiDataQueryDTO queryPlanItemDto = new ApiDataQueryDTO(); -- Gitblit v1.9.3