From a2b4314c590248f3826764ac0ea63dcecc6fb20b Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 21 三月 2025 09:16:51 +0800
Subject: [PATCH] 预测值模拟调整

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/dto/SampleInfo.java |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/dto/SampleInfo.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/dto/SampleInfo.java
index fe54b94..6b9f3c9 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/dto/SampleInfo.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/dto/SampleInfo.java
@@ -3,13 +3,16 @@
 import com.iailab.module.data.api.ind.dto.ApiIndItemDTO;
 import com.iailab.module.data.api.plan.dto.ApiPlanItemDTO;
 import com.iailab.module.data.api.point.dto.ApiPointDTO;
+import com.iailab.module.model.mdk.vo.StAdjustDeviationDTO;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.sql.Timestamp;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -25,6 +28,8 @@
 
     private Integer sampleColumn;
 
+    private Date predictTime;
+
     private Timestamp startTime;
 
     private Timestamp endTime;
@@ -33,12 +38,26 @@
 
     private Integer sampleCycle;
 
+    private Boolean isAdjust = false;
+
     // 调整值
-    private double[][] deviation;
+    private List<StAdjustDeviationDTO> deviation;
     // 所有测点信息,避免重复查询
     private Map<String, ApiPointDTO> pointMap;
     // 所有计划数据信息,避免重复查询
     private Map<String, ApiPlanItemDTO> planMap;
     // 所有计划数据信息,避免重复查询
     private Map<String, ApiIndItemDTO> indMap;
+
+    public static double getAdjustValueFromDeviation(int portIdx, int paramIdx, List<StAdjustDeviationDTO> deviation) {
+        if (CollectionUtils.isEmpty(deviation)) {
+            return 0;
+        }
+        for (StAdjustDeviationDTO deviationItem : deviation) {
+            if (deviationItem.getPortIdx() == portIdx && deviationItem.getParamIdx() == paramIdx) {
+                return deviationItem.getValue();
+            }
+        }
+        return 0;
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3