From dd0a874d305ce4173f6fa89500e5c746bafb7f4d Mon Sep 17 00:00:00 2001
From: liriming <1343021927@qq.com>
Date: 星期一, 24 三月 2025 16:37:33 +0800
Subject: [PATCH] 接口修改

---
 ansteel-biz/src/main/java/com/iailab/module/ansteel/api/McsServiceImpl.java |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/ansteel-biz/src/main/java/com/iailab/module/ansteel/api/McsServiceImpl.java b/ansteel-biz/src/main/java/com/iailab/module/ansteel/api/McsServiceImpl.java
index 8cb1be3..022aa71 100644
--- a/ansteel-biz/src/main/java/com/iailab/module/ansteel/api/McsServiceImpl.java
+++ b/ansteel-biz/src/main/java/com/iailab/module/ansteel/api/McsServiceImpl.java
@@ -14,10 +14,7 @@
 import com.iailab.module.data.api.point.DataPointApi;
 import com.iailab.module.data.api.point.dto.ApiPointValueQueryDTO;
 import com.iailab.module.model.api.mcs.McsApi;
-import com.iailab.module.model.api.mcs.dto.ChartParamDTO;
-import com.iailab.module.model.api.mcs.dto.MmItemOutputDTO;
-import com.iailab.module.model.api.mcs.dto.PreDataSingleChartReqVO;
-import com.iailab.module.model.api.mcs.dto.PredictItemVO;
+import com.iailab.module.model.api.mcs.dto.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -99,9 +96,7 @@
             return null;
         }
         String resultIndex = tMap.get(CommonConstant.RESULT_INDEX);
-        if (resultIndex == null) {
-            return null;
-        }
+
         PredictItemVO predictItem = mcsApi.getPredictItemByItemNo(itemCode);
         if (predictItem == null || predictItem.getLastTime() == null) {
             return null;
@@ -119,40 +114,47 @@
         Date endTime = timeArray[2];
 
         PreDataChartRespVO result = ConvertUtils.sourceToTarget(mcsApi.getPreDataSingleChart(reqVO), PreDataChartRespVO.class);
-        PreDataViewDTO dataView = result.getDataView();
+        PreDataViewRespDTO dataView = result.getDataView();
+        PreDataViewDTO preDataView = ConvertUtils.sourceToTarget(dataView, PreDataViewDTO.class);
         if(trendsDataH != null) {
             ApiPointValueQueryDTO pointValueQueryDTO = new ApiPointValueQueryDTO();
             pointValueQueryDTO.setPointNo(trendsDataH);
             List<ApiPointValueDTO> trendsDataHList = ConvertUtils.sourceToTarget(dataPointApi.queryPointHistoryValue(pointValueQueryDTO), ApiPointValueDTO.class);
-            dataView.setTrendsDataH(trendsDataHList);
+            preDataView.setTrendsDataH(trendsDataHList);
         }
         if(trendsDataL != null) {
             ApiPointValueQueryDTO pointValueQueryDTO = new ApiPointValueQueryDTO();
             pointValueQueryDTO.setPointNo(trendsDataL);
             List<ApiPointValueDTO> trendsDataLList = ConvertUtils.sourceToTarget(dataPointApi.queryPointHistoryValue(pointValueQueryDTO), ApiPointValueDTO.class);
-            dataView.setTrendsDataL(trendsDataLList);
+            preDataView.setTrendsDataL(trendsDataLList);
         }
         MmItemOutputDTO outputDTO = mcsApi.getItemOutputByItemid(predictItem.getId(), resultStr, resultIndex);
+
+        PreItemResultReqVO preItemResultReqVO = new PreItemResultReqVO();
+        preItemResultReqVO.setOutputid(outputDTO.getId());
+        preItemResultReqVO.setStartTime(startTime);
+        preItemResultReqVO.setEndTime(endTime);
+        preItemResultReqVO.setTimeFormat(timeFormat);
         switch (lineType) {
             case TN:
                 if(reqVO.getChartCode().equals(CommonConstant.LDG_CHARRCODE)){
-                    dataView.setPreData(mcsApi.getItemResult(outputDTO.getId(), predictTime, endTime, timeFormat));
+                    preDataView.setPreData(mcsApi.getItemResult(preItemResultReqVO));
                 }else{
-                    dataView.setPreData(mcsApi.getItemResult(outputDTO.getId(), startTime, endTime, timeFormat));
+                    preDataView.setPreData(mcsApi.getItemResult(preItemResultReqVO));
                 }
 
                 break;
             case TL:
                 if(reqVO.getChartCode().equals(CommonConstant.LDG_CHARRCODE)){
-                    dataView.setPreData(mcsApi.getItemResultLastPoint(outputDTO.getId(), predictTime, endTime, timeFormat));
+                    preDataView.setPreData(mcsApi.getItemResultLastPoint(preItemResultReqVO));
                 }else{
-                    dataView.setPreData(mcsApi.getItemResultLastPoint(outputDTO.getId(), startTime, endTime, timeFormat));
+                    preDataView.setPreData(mcsApi.getItemResultLastPoint(preItemResultReqVO));
                 }
                 break;
             default:
                 break;
         }
-        result.setDataView(dataView);
+        result.setPreDataView(preDataView);
         return result;
     }
 

--
Gitblit v1.9.3