From c630b9bc245aef6b95923fbd774084edb7726a72 Mon Sep 17 00:00:00 2001 From: Jay <csj123456> Date: 星期一, 24 三月 2025 11:44:20 +0800 Subject: [PATCH] 增加累计预测值最后一个值的获取 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java index 4c97c0a..81248b6 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java @@ -28,7 +28,6 @@ import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessageSaveReqVO; import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; -import com.iailab.module.model.mcs.sche.entity.StAdjustConfigDetEntity; import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; import com.iailab.module.model.mcs.sche.service.*; @@ -419,6 +418,10 @@ dataView.setPreDataN(mmItemResultService.getData(outPut.getId(), predictTime, endTime, timeFormat)); dataView.setPreDataL(mmItemResultLastPointService.getData(outPut.getId(), startTime, endTime, timeFormat)); break; + case CL: + dataView.setPreDataN(mmItemResultService.getData(outPut.getId(), predictTime, endTime, timeFormat)); + dataView.setPreDataL(mmItemResultLastPointService.getData(outPut.getId(), startTime, endTime, timeFormat)); + break; default: break; } @@ -471,6 +474,19 @@ } catch (Exception ex) { ex.printStackTrace(); } + List<MmItemOutputEntity> outs = mmItemOutputService.getByItemid(predictItem.getId()); + for (MmItemOutputEntity out : outs) { + //处理预测累计 + if (out.getIscumulant() == 1) { + dataView.setCumulantPreData(mmItemResultService.getData(out.getId() + CommonDict.CUMULANT_SUFFIX, startTime, endTime, DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); + } + } + if (!CollectionUtils.isEmpty(dataView.getCumulantPreData())) { + List<Double> cumulantPreList = dataView.getCumulantPreData().stream().map(t -> { + return new Double(t[1].toString()); + }).collect(Collectors.toList()); + dataView.setCumulantPreLast(new BigDecimal(cumulantPreList.get(cumulantPreList.size() - 1)).setScale(2, BigDecimal.ROUND_HALF_UP)); + } result.setPredictTime(predictTime); result.setStartTime(startTime); -- Gitblit v1.9.3