提交 | 用户 | 时间
|
7fd198
|
1 |
package com.iailab.module.model.mdk.sample; |
潘 |
2 |
|
|
3 |
import com.iailab.module.model.mdk.common.exceptions.DataAccessException; |
50084d
|
4 |
import com.iailab.module.model.mdk.common.exceptions.ModelInvokeException; |
7fd198
|
5 |
import com.iailab.module.model.mdk.sample.dto.SampleData; |
潘 |
6 |
import com.iailab.module.model.mdk.sample.dto.SampleInfo; |
|
7 |
import org.springframework.beans.factory.annotation.Autowired; |
|
8 |
import org.springframework.stereotype.Component; |
|
9 |
|
|
10 |
import java.sql.Timestamp; |
|
11 |
import java.text.MessageFormat; |
|
12 |
import java.util.Date; |
|
13 |
import java.util.List; |
|
14 |
|
|
15 |
/** |
|
16 |
* 样本构造 |
|
17 |
* |
|
18 |
* @author PanZhibao |
|
19 |
* @Description |
|
20 |
* @createTime 2024年09月03日 |
|
21 |
*/ |
|
22 |
@Component |
|
23 |
public class SampleConstructor { |
|
24 |
|
|
25 |
@Autowired |
|
26 |
private SampleFactory sampleFactory; |
|
27 |
|
50084d
|
28 |
public List<SampleData> constructSample(String typeA, String modelId, Date runTime,String itemName) throws ModelInvokeException { |
7fd198
|
29 |
try { |
潘 |
30 |
SampleInfoConstructor sampleInfoConstructor = sampleFactory.createSampleInfo(typeA, modelId); |
|
31 |
SampleInfo sampleInfo = sampleInfoConstructor.prepareSampleInfo(modelId, runTime); |
|
32 |
SampleDataConstructor sampleDataConstructor = sampleFactory.createSampelData(typeA); |
|
33 |
return sampleDataConstructor.prepareSampleData(sampleInfo); |
|
34 |
} catch (Exception e) { |
c9dd12
|
35 |
e.printStackTrace(); |
50084d
|
36 |
throw new ModelInvokeException(MessageFormat.format("{0},Name:{1}", |
D |
37 |
ModelInvokeException.errorGetModelArithParam, itemName)); |
7fd198
|
38 |
} |
潘 |
39 |
|
|
40 |
|
|
41 |
} |
|
42 |
} |