From d9fe8fcf46a22aeaab7b7c2f06866af962b8d0dd Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 28 十一月 2024 09:00:41 +0800
Subject: [PATCH] 获取当前预测数据

---
 iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/PreDataJsonReqVO.java |   26 ++++++++++++++++++++++++++
 iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java               |    4 ++++
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java               |   12 ++++++++++++
 3 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java
index b80ba25..1ae76b1 100644
--- a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java
+++ b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java
@@ -40,6 +40,10 @@
     @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);
diff --git a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/PreDataJsonReqVO.java b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/PreDataJsonReqVO.java
new file mode 100644
index 0000000..656b692
--- /dev/null
+++ b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/PreDataJsonReqVO.java
@@ -0,0 +1,26 @@
+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;
+}
\ No newline at end of file
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 c88e4d7..6bb4bbe 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
@@ -356,6 +356,18 @@
     }
 
     @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());

--
Gitblit v1.9.3