From 5b952f77058a9da5af5e143a6c2c7ba195aa736d Mon Sep 17 00:00:00 2001
From: liriming <1343021927@qq.com>
Date: 星期二, 26 十一月 2024 16:08:10 +0800
Subject: [PATCH] 预测消息配置

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemMergeHandlerImpl.java |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemMergeHandlerImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemMergeHandlerImpl.java
index b00251d..19ae68b 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemMergeHandlerImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemMergeHandlerImpl.java
@@ -2,7 +2,8 @@
 
 import com.iailab.module.data.api.point.DataPointApi;
 import com.iailab.module.data.api.point.dto.ApiPointDTO;
-import com.iailab.module.data.enums.DataPointFreq;
+import com.iailab.module.data.enums.DataPointFreqEnum;
+import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity;
 import com.iailab.module.model.mdk.common.enums.ItemPredictStatus;
 import com.iailab.module.model.mdk.common.exceptions.ItemInvokeException;
 import com.iailab.module.model.mdk.factory.ItemEntityFactory;
@@ -11,7 +12,6 @@
 import com.iailab.module.model.mdk.predict.PredictResultHandler;
 import com.iailab.module.model.mdk.vo.DataValueVO;
 import com.iailab.module.model.mdk.vo.ItemVO;
-import com.iailab.module.model.mdk.vo.MmItemOutputVO;
 import com.iailab.module.model.mdk.vo.PredictResultVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,6 +41,14 @@
     @Autowired
     private PredictResultHandler predictResultHandler;
 
+    /**
+     * MergeItem预测
+     *
+     * @param predictTime
+     * @param predictItemDto
+     * @return
+     * @throws ItemInvokeException
+     */
     @Override
     public PredictResultVO predict(Date predictTime, ItemVO predictItemDto)
             throws ItemInvokeException {
@@ -66,12 +74,12 @@
                     if (itemNo.length() > 4) {
                         Date endTime = predictTime;
                         ItemVO itemEntity = itemEntityFactory.getItemByItemNo(itemNo);
-                        List<MmItemOutputVO> outPutList = itemEntityFactory.getOutPutByItemId(itemEntity.getId());
-                        ApiPointDTO pointEntity = dataPointApi.getPointById(outPutList.get(0).getPointId());
+                        List<MmItemOutputEntity> outPutList = itemEntityFactory.getOutPutByItemId(itemEntity.getId());
+                        ApiPointDTO pointEntity = dataPointApi.getInfoById(outPutList.get(0).getPointid());
 
                         Calendar calendar = Calendar.getInstance();
                         calendar.setTime(endTime);
-                        calendar.add(Calendar.SECOND, (predictLength - 1) * DataPointFreq.getEumByCode(pointEntity.getMinfreqid()).getValue());
+                        calendar.add(Calendar.SECOND, (predictLength - 1) * DataPointFreqEnum.getEumByCode(pointEntity.getMinfreqid()).getValue());
                         endTime = new Timestamp(calendar.getTime().getTime());
                         List<DataValueVO> predictValueList = predictResultHandler.getPredictValueByItemNo(itemNo, predictTime, endTime);
                         if (predictValueList.size() != predictLength) {

--
Gitblit v1.9.3