From db8472b9471de96a68c7fcdb2e66124b2f16854b Mon Sep 17 00:00:00 2001 From: liriming <1343021927@qq.com> Date: 星期三, 02 四月 2025 17:14:56 +0800 Subject: [PATCH] 采纳建议接口 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustResultServiceImpl.java | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustResultServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustResultServiceImpl.java index 5e690a2..7d90b48 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustResultServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StAdjustResultServiceImpl.java @@ -75,6 +75,32 @@ } @Override + public List<DataValueVO> getPredictValue(String outputId, Date predictTime) { + List<DataValueVO> result = new ArrayList<>(); + QueryWrapper<StAdjustResultEntity> wrapper = new QueryWrapper<>(); + wrapper.eq("output_id", outputId) + .eq("adjust_time", DateUtils.format(predictTime, DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); + StAdjustResultEntity data = baseDao.selectOne(wrapper); + if (data == null || StringUtils.isBlank(data.getJsonValue())) { + return result; + } + List<Double> valueList = JSONArray.parseArray(data.getJsonValue(), Double.class); + if (CollectionUtils.isEmpty(valueList)) { + return result; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(predictTime); + for (int i = 1; i < valueList.size() + 1; i++) { + calendar.add(Calendar.MINUTE, i); + DataValueVO vo = new DataValueVO(); + vo.setDataValue(valueList.get(i - 1)); + vo.setDataTime(calendar.getTime()); + result.add(vo); + } + return result; + } + + @Override public List<Object[]> getData(String outputId, Date predictTime, String timeFormat) { List<Object[]> result = new ArrayList<>(); QueryWrapper<StAdjustResultEntity> wrapper = new QueryWrapper<>(); -- Gitblit v1.9.3