From afd6dfbd0029e9a758d7896500d54d265f4185fc Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期一, 17 三月 2025 16:22:37 +0800 Subject: [PATCH] long oneMin = granularity * 1000L --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/dto/SampleInfo.java | 20 +++++++++++++++++++- 1 files changed, 19 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 39bea32..7d4b804 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 @@ -1,11 +1,14 @@ package com.iailab.module.model.mdk.sample.dto; +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; @@ -32,9 +35,24 @@ private Integer sampleCycle; - private BigDecimal[][] 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