From 60e664bd398e908206d00eb8e17c3b4796c70df1 Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期一, 24 三月 2025 18:42:33 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java | 39 ++++++++++++++++++--------------------- 1 files changed, 18 insertions(+), 21 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 81248b6..b4b3cfa 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 @@ -418,13 +418,22 @@ 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; } + + //处理预测累计 + if (outPut.getIscumulant() != null && outPut.getIscumulant() == 1) { + /*if (StringUtils.isNotBlank(outPut.getCumulpoint())) { + dataView.setCumulantRealData(getHisData(outPut.getCumulpoint(), startTime, endTime)); + }*/ + List<Object[]> cumulantPreList = mmItemResultService.getData(outPut.getId() + CommonDict.CUMULANT_SUFFIX, startTime, endTime, DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); + dataView.setCumulantPreData(cumulantPreList); + if (!CollectionUtils.isEmpty(cumulantPreList)) { + dataView.setCumulantPreLast(new BigDecimal(cumulantPreList.get(cumulantPreList.size() - 1)[1].toString()).setScale(2, BigDecimal.ROUND_HALF_UP)); + } + } + if (!CollectionUtils.isEmpty(dataView.getRealData())) { Object[] rdo = dataView.getRealData().get(dataView.getRealData().size() - 1); dataView.setCurrValue(new BigDecimal(rdo[1].toString())); @@ -473,19 +482,6 @@ } } 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); @@ -866,8 +862,9 @@ } @Override - public List<Object[]> getItemResult(String outputid, Date startTime, Date endTime, String timeFormat) { - return mmItemResultService.getData(outputid,startTime,endTime,timeFormat); + public List<Object[]> getItemResult(PreItemResultReqVO reqVO) { + + return mmItemResultService.getData(reqVO.getOutputid(),reqVO.getStartTime(),reqVO.getEndTime(),reqVO.getTimeFormat()); } @Override @@ -876,8 +873,8 @@ } @Override - public List<Object[]> getItemResultLastPoint(String outputid, Date startTime, Date endTime, String timeFormat) { - return mmItemResultLastPointService.getData(outputid,startTime,endTime,timeFormat); + public List<Object[]> getItemResultLastPoint(PreItemResultReqVO reqVO) { + return mmItemResultLastPointService.getData(reqVO.getOutputid(),reqVO.getStartTime(),reqVO.getEndTime(),reqVO.getTimeFormat()); } private Date[] calResultTime(ItemVO predictItem, Date startTimeReq, Date endTimeReq, int lengthLeft, int lengthRight) { -- Gitblit v1.9.3