| | |
| | | @Operation(summary = "预测数据图表") |
| | | PreDataSingleChartRespVO getPreDataSingleChart(@RequestBody PreDataSingleChartReqVO reqVO); |
| | | |
| | | @PostMapping(PREFIX + "/predict-data/cur") |
| | | @Operation(summary = "获取当前预测数据") |
| | | Map<String, List<Object[]>> getPreDataCur(PreDataJsonReqVO reqVO); |
| | | |
| | | @PostMapping(PREFIX + "/plan-data/single-chart") |
| | | @Operation(summary = "计划数据图表") |
| | | PlanDataSingleChartRespVO getPlanDataSingleChart(@RequestBody PreDataSingleChartReqVO reqVO); |
对比新文件 |
| | |
| | | package com.iailab.module.model.api.mcs.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月27日 |
| | | */ |
| | | @Data |
| | | public class PreDataJsonReqVO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "预测时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date predictTime; |
| | | |
| | | @Schema(description = "预测输出ID") |
| | | private List<String> outputIdList; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<Object[]>> getPreDataCur(PreDataJsonReqVO reqVO) { |
| | | Map<String, List<Object[]>> result = new HashMap<>(); |
| | | if (reqVO == null || reqVO.getPredictTime() == null || CollectionUtils.isEmpty(reqVO.getOutputIdList())) { |
| | | return result; |
| | | } |
| | | reqVO.getOutputIdList().forEach(outPutId -> { |
| | | result.put(outPutId, mmItemResultJsonService.getData(outPutId, reqVO.getPredictTime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public PlanDataSingleChartRespVO getPlanDataSingleChart(PreDataSingleChartReqVO reqVO) { |
| | | PlanDataSingleChartRespVO result = new PlanDataSingleChartRespVO(); |
| | | Map<String, String> chartParams = chartService.getByChartCode(reqVO.getChartCode()); |