|
@@ -99,8 +99,8 @@ public class TrainTaskController {
|
|
|
// 1. 数据获取组件
|
|
|
Map<String, Object> dataAcquisition = (Map<String, Object>) taskInfo.get("dataAcquisition");
|
|
|
if (dataAcquisition != null) {
|
|
|
- Boolean isEnable = parseEnableValue(dataAcquisition.get("enable"), "数据获取");
|
|
|
- String type = (String) dataAcquisition.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(dataAcquisition.get("isEnable"), "数据获取");
|
|
|
+ String type = (String) dataAcquisition.get("componentType");
|
|
|
Component component = createComponent(taskId, type, dataAcquisition, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -112,8 +112,8 @@ public class TrainTaskController {
|
|
|
// 2. 数据处理组件
|
|
|
Map<String, Object> dataCleaning = (Map<String, Object>) taskInfo.get("dataCleaning");
|
|
|
if (dataCleaning != null) {
|
|
|
- Boolean isEnable = parseEnableValue(dataCleaning.get("enable"), "数据处理");
|
|
|
- String type = (String) dataCleaning.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(dataCleaning.get("isEnable"), "数据处理");
|
|
|
+ String type = (String) dataCleaning.get("componentType");
|
|
|
Component component = createComponent(taskId, type, dataCleaning, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -125,8 +125,8 @@ public class TrainTaskController {
|
|
|
// 3. 限电清洗组件
|
|
|
Map<String, Object> powerRationing = (Map<String, Object>) taskInfo.get("powerRationing");
|
|
|
if (powerRationing != null) {
|
|
|
- Boolean isEnable = parseEnableValue(powerRationing.get("enable"), "限电清洗");
|
|
|
- String type = (String) powerRationing.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(powerRationing.get("isEnable"), "限电清洗");
|
|
|
+ String type = (String) powerRationing.get("componentType");
|
|
|
Component component = createComponent(taskId, type, powerRationing, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -138,8 +138,8 @@ public class TrainTaskController {
|
|
|
// 4. 模型组件 + 关联模型测试组件
|
|
|
Map<String, Object> model = (Map<String, Object>) taskInfo.get("model");
|
|
|
if (model != null) {
|
|
|
- Boolean modelIsEnable = parseEnableValue(model.get("enable"), "模型");
|
|
|
- String modelType = (String) model.get("name");
|
|
|
+ Boolean modelIsEnable = parseEnableValue(model.get("isEnable"), "模型");
|
|
|
+ String modelType = (String) model.get("componentType");
|
|
|
Component modelComponent = createComponent(taskId, modelType, model, modelIsEnable);
|
|
|
if (componentService.save(modelComponent)) {
|
|
|
componentIds.add(modelComponent.getComponentId());
|
|
@@ -148,8 +148,8 @@ public class TrainTaskController {
|
|
|
if ("LSTM-训练".equals(modelType) || "机器学习模型-训练".equals(modelType)) {
|
|
|
Map<String, Object> modelTest = (Map<String, Object>) taskInfo.get("modelTest");
|
|
|
if (modelTest != null) {
|
|
|
- Boolean testIsEnable = parseEnableValue(modelTest.get("enable"), "模型测试");
|
|
|
- String testType = (String) modelTest.get("name");
|
|
|
+ Boolean testIsEnable = parseEnableValue(modelTest.get("isEnable"), "模型测试");
|
|
|
+ String testType = (String) modelTest.get("componentType");
|
|
|
Component testComponent = createComponent(taskId, testType, modelTest, testIsEnable);
|
|
|
if (componentService.save(testComponent)) {
|
|
|
componentIds.add(testComponent.getComponentId());
|
|
@@ -166,8 +166,8 @@ public class TrainTaskController {
|
|
|
// 5. 后处理组件
|
|
|
Map<String, Object> postProcessing = (Map<String, Object>) taskInfo.get("processing");
|
|
|
if (postProcessing != null) {
|
|
|
- Boolean isEnable = parseEnableValue(postProcessing.get("enable"), "后处理");
|
|
|
- String type = (String) postProcessing.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(postProcessing.get("isEnable"), "后处理");
|
|
|
+ String type = (String) postProcessing.get("componentType");
|
|
|
Component component = createComponent(taskId, type, postProcessing, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -179,8 +179,8 @@ public class TrainTaskController {
|
|
|
// 6. 分析报告组件
|
|
|
Map<String, Object> analysisReport = (Map<String, Object>) taskInfo.get("report");
|
|
|
if (analysisReport != null) {
|
|
|
- Boolean isEnable = parseEnableValue(analysisReport.get("enable"), "分析报告");
|
|
|
- String type = (String) analysisReport.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(analysisReport.get("isEnable"), "分析报告");
|
|
|
+ String type = (String) analysisReport.get("componentType");
|
|
|
Component component = createComponent(taskId, type, analysisReport, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -340,8 +340,8 @@ public class TrainTaskController {
|
|
|
// 1. 数据获取组件
|
|
|
Map<String, Object> dataAcquisition = (Map<String, Object>) taskInfo.get("dataAcquisition");
|
|
|
if (dataAcquisition != null) {
|
|
|
- Boolean isEnable = parseEnableValue(dataAcquisition.get("enable"), "数据获取");
|
|
|
- String type = (String) dataAcquisition.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(dataAcquisition.get("isEnable"), "数据获取");
|
|
|
+ String type = (String) dataAcquisition.get("componentType");
|
|
|
Component component = createComponent(tTaskId, type, dataAcquisition, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -353,8 +353,8 @@ public class TrainTaskController {
|
|
|
// 2. 数据处理组件
|
|
|
Map<String, Object> dataCleaning = (Map<String, Object>) taskInfo.get("dataCleaning");
|
|
|
if (dataCleaning != null) {
|
|
|
- Boolean isEnable = parseEnableValue(dataCleaning.get("enable"), "数据处理");
|
|
|
- String type = (String) dataCleaning.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(dataCleaning.get("isEnable"), "数据处理");
|
|
|
+ String type = (String) dataCleaning.get("componentType");
|
|
|
Component component = createComponent(tTaskId, type, dataCleaning, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -366,8 +366,8 @@ public class TrainTaskController {
|
|
|
// 3. 限电清洗组件
|
|
|
Map<String, Object> powerRationing = (Map<String, Object>) taskInfo.get("powerRationing");
|
|
|
if (powerRationing != null) {
|
|
|
- Boolean isEnable = parseEnableValue(powerRationing.get("enable"), "限电清洗");
|
|
|
- String type = (String) powerRationing.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(powerRationing.get("isEnable"), "限电清洗");
|
|
|
+ String type = (String) powerRationing.get("componentType");
|
|
|
Component component = createComponent(tTaskId, type, powerRationing, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -379,8 +379,8 @@ public class TrainTaskController {
|
|
|
// 4. 模型组件 + 关联模型测试组件
|
|
|
Map<String, Object> model = (Map<String, Object>) taskInfo.get("model");
|
|
|
if (model != null) {
|
|
|
- Boolean modelIsEnable = parseEnableValue(model.get("enable"), "模型");
|
|
|
- String modelType = (String) model.get("name");
|
|
|
+ Boolean modelIsEnable = parseEnableValue(model.get("isEnable"), "模型");
|
|
|
+ String modelType = (String) model.get("componentType");
|
|
|
Component modelComponent = createComponent(tTaskId, modelType, model, modelIsEnable);
|
|
|
if (componentService.save(modelComponent)) {
|
|
|
componentIds.add(modelComponent.getComponentId());
|
|
@@ -389,8 +389,8 @@ public class TrainTaskController {
|
|
|
if ("LSTM-训练".equals(modelType) || "机器学习模型-训练".equals(modelType)) {
|
|
|
Map<String, Object> modelTest = (Map<String, Object>) taskInfo.get("modelTest");
|
|
|
if (modelTest != null) {
|
|
|
- Boolean testIsEnable = parseEnableValue(modelTest.get("enable"), "模型测试");
|
|
|
- String testType = (String) modelTest.get("name");
|
|
|
+ Boolean testIsEnable = parseEnableValue(modelTest.get("isEnable"), "模型测试");
|
|
|
+ String testType = (String) modelTest.get("componentType");
|
|
|
Component testComponent = createComponent(tTaskId, testType, modelTest, testIsEnable);
|
|
|
if (componentService.save(testComponent)) {
|
|
|
componentIds.add(testComponent.getComponentId());
|
|
@@ -407,8 +407,8 @@ public class TrainTaskController {
|
|
|
// 5. 后处理组件
|
|
|
Map<String, Object> postProcessing = (Map<String, Object>) taskInfo.get("processing");
|
|
|
if (postProcessing != null) {
|
|
|
- Boolean isEnable = parseEnableValue(postProcessing.get("enable"), "后处理");
|
|
|
- String type = (String) postProcessing.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(postProcessing.get("isEnable"), "后处理");
|
|
|
+ String type = (String) postProcessing.get("componentType");
|
|
|
Component component = createComponent(tTaskId, type, postProcessing, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -420,8 +420,8 @@ public class TrainTaskController {
|
|
|
// 6. 分析报告组件
|
|
|
Map<String, Object> analysisReport = (Map<String, Object>) taskInfo.get("report");
|
|
|
if (analysisReport != null) {
|
|
|
- Boolean isEnable = parseEnableValue(analysisReport.get("enable"), "分析报告");
|
|
|
- String type = (String) analysisReport.get("name");
|
|
|
+ Boolean isEnable = parseEnableValue(analysisReport.get("isEnable"), "分析报告");
|
|
|
+ String type = (String) analysisReport.get("componentType");
|
|
|
Component component = createComponent(tTaskId, type, analysisReport, isEnable);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
@@ -456,14 +456,14 @@ public class TrainTaskController {
|
|
|
component.setTaskId(taskId);
|
|
|
component.setTaskType(0); // 训练任务固定标识
|
|
|
component.setComponentType(componentType);
|
|
|
- component.setParamsMap((Map<String, Object>) config.get("value")); // 组件参数
|
|
|
- component.setIsEnable(isEnable); // 仅使用解析后的enable值,无强转
|
|
|
+ component.setParamsMap((Map<String, Object>) config.get("params")); // 组件参数
|
|
|
+ component.setIsEnable(isEnable); // 仅使用解析后的isEnable值,无强转
|
|
|
component.setInterfaceUrl((String) config.get("interfaceUrl")); // 接口地址
|
|
|
return component;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 统一解析enable值,兼容非Boolean类型
|
|
|
+ * 统一解析isEnable值,兼容非Boolean类型
|
|
|
*/
|
|
|
private Boolean parseEnableValue(Object enableObj, String componentName) {
|
|
|
if (enableObj instanceof Boolean) {
|