From 1f5695b4cfb96735c09444ab13672c12b9fa57a3 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期三, 26 三月 2025 11:11:09 +0800
Subject: [PATCH] 模型测试运行日志

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

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleConstructor.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleConstructor.java
index 32e0930..95a8c7b 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleConstructor.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleConstructor.java
@@ -1,13 +1,12 @@
 package com.iailab.module.model.mdk.sample;
 
+import com.iailab.module.model.mdk.vo.StAdjustDeviationDTO;
 import com.iailab.module.model.mdk.common.exceptions.ModelInvokeException;
-import com.iailab.module.model.mdk.sample.dto.ColumnItemPort;
 import com.iailab.module.model.mdk.sample.dto.SampleData;
 import com.iailab.module.model.mdk.sample.dto.SampleInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import org.springframework.util.CollectionUtils;
 
 import java.text.MessageFormat;
 import java.util.Date;
@@ -44,4 +43,23 @@
 
 
     }
+
+    public List<SampleData> constructSample(String typeA, String modelId, Date runTime,String itemName,
+                                            Map<Integer, Integer> dynamicDataLength, List<StAdjustDeviationDTO> deviationList) throws ModelInvokeException {
+        try {
+            SampleInfoConstructor sampleInfoConstructor = sampleFactory.createSampleInfo(typeA, modelId);
+            SampleInfo sampleInfo = sampleInfoConstructor.prepareSampleInfo(modelId, runTime, dynamicDataLength);
+            sampleInfo.setDeviation(deviationList);
+            sampleInfo.setIsAdjust(true);
+            SampleDataConstructor sampleDataConstructor = sampleFactory.createSampleData(typeA);
+            return sampleDataConstructor.prepareSampleData(sampleInfo);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("获取模型的算法参数异常",e);
+            throw new ModelInvokeException(MessageFormat.format("{0},Name:{1}",
+                    ModelInvokeException.errorGetModelArithParam, itemName));
+        }
+
+
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3