From 4d7e3bb9a93ac0bdba9075e5efa536a165f8aae9 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期一, 06 一月 2025 11:38:42 +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, 13 insertions(+), 9 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 ce7dd8b..32e0930 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,15 +1,18 @@ package com.iailab.module.model.mdk.sample; -import com.iailab.module.model.mdk.common.exceptions.DataAccessException; +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.sql.Timestamp; import java.text.MessageFormat; import java.util.Date; import java.util.List; +import java.util.Map; /** * 样本构造 @@ -18,24 +21,25 @@ * @Description * @createTime 2024年09月03日 */ +@Slf4j @Component public class SampleConstructor { @Autowired private SampleFactory sampleFactory; - public List<SampleData> constructSample(String typeA, String modelId, Date runTime) { + public List<SampleData> constructSample(String typeA, String modelId, Date runTime,String itemName, + Map<Integer, Integer> dynamicDataLength) throws ModelInvokeException { try { SampleInfoConstructor sampleInfoConstructor = sampleFactory.createSampleInfo(typeA, modelId); - SampleInfo sampleInfo = sampleInfoConstructor.prepareSampleInfo(modelId, runTime); - SampleDataConstructor sampleDataConstructor = sampleFactory.createSampelData(typeA); + SampleInfo sampleInfo = sampleInfoConstructor.prepareSampleInfo(modelId, runTime, dynamicDataLength); + SampleDataConstructor sampleDataConstructor = sampleFactory.createSampleData(typeA); return sampleDataConstructor.prepareSampleData(sampleInfo); } catch (Exception e) { - DataAccessException exception = new DataAccessException(MessageFormat.format("{0},类名为{1}", - DataAccessException.errorDataAccess, Thread.currentThread().getStackTrace()[1].getClassName())); - System.out.println(exception); e.printStackTrace(); - return null; + log.error("获取模型的算法参数异常",e); + throw new ModelInvokeException(MessageFormat.format("{0},Name:{1}", + ModelInvokeException.errorGetModelArithParam, itemName)); } -- Gitblit v1.9.3