|
@@ -101,7 +101,8 @@ public class TrainTaskController {
|
|
|
if (dataAcquisition != null) {
|
|
|
Boolean isEnable = parseEnableValue(dataAcquisition.get("isEnable"), "数据获取");
|
|
|
String type = (String) dataAcquisition.get("componentType");
|
|
|
- Component component = createComponent(taskId, type, dataAcquisition, isEnable);
|
|
|
+ String url = "http://ds3:10001/mysql_to_mongo";
|
|
|
+ Component component = createComponent(taskId, type, dataAcquisition, isEnable ,url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -114,7 +115,8 @@ public class TrainTaskController {
|
|
|
if (dataCleaning != null) {
|
|
|
Boolean isEnable = parseEnableValue(dataCleaning.get("isEnable"), "数据处理");
|
|
|
String type = (String) dataCleaning.get("componentType");
|
|
|
- Component component = createComponent(taskId, type, dataCleaning, isEnable);
|
|
|
+ String url = "http://ds3:10013/pre_process";
|
|
|
+ Component component = createComponent(taskId, type, dataCleaning, isEnable , url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -127,7 +129,13 @@ public class TrainTaskController {
|
|
|
if (powerRationing != null) {
|
|
|
Boolean isEnable = parseEnableValue(powerRationing.get("isEnable"), "限电清洗");
|
|
|
String type = (String) powerRationing.get("componentType");
|
|
|
- Component component = createComponent(taskId, type, powerRationing, isEnable);
|
|
|
+ String url = "";
|
|
|
+ if ("限电清洗-光伏".equals(type)){
|
|
|
+ url = "http://ds3:10008/processing_limit_power_by_statistics_light";
|
|
|
+ }else if ("限电清洗-风电".equals(type)){
|
|
|
+ url = "http://ds3:10009/processing_limit_power_by_statistics_wind";
|
|
|
+ }
|
|
|
+ Component component = createComponent(taskId, type, powerRationing, isEnable , url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -140,7 +148,19 @@ public class TrainTaskController {
|
|
|
if (model != null) {
|
|
|
Boolean modelIsEnable = parseEnableValue(model.get("isEnable"), "模型");
|
|
|
String modelType = (String) model.get("componentType");
|
|
|
- Component modelComponent = createComponent(taskId, modelType, model, modelIsEnable);
|
|
|
+ String url = "";
|
|
|
+ if ("光伏物理模型".equals(modelType)){
|
|
|
+ url = "http://ds3:10014/model_prediction_photovoltaic_physical";
|
|
|
+ }else if ("风电物理模型".equals(modelType)){
|
|
|
+ url = "http://ds3:10014/model_prediction_wind_physical";
|
|
|
+ }else if ("Holtwinters模型".equals(modelType)){
|
|
|
+ url = "http://ds3:10007/model_prediction_holtwinters";
|
|
|
+ }else if ("LSTM-训练".equals(modelType)){
|
|
|
+ url = "http://ds3:10003/tf_lstm_training";
|
|
|
+ }else if ("机器学习模型-训练".equals(modelType)){
|
|
|
+ url = "http://ds3:10005/model_training_ml";
|
|
|
+ }
|
|
|
+ Component modelComponent = createComponent(taskId, modelType, model, modelIsEnable,url);
|
|
|
if (componentService.save(modelComponent)) {
|
|
|
componentIds.add(modelComponent.getComponentId());
|
|
|
|
|
@@ -150,7 +170,8 @@ public class TrainTaskController {
|
|
|
if (modelTest != null) {
|
|
|
Boolean testIsEnable = parseEnableValue(modelTest.get("isEnable"), "模型测试");
|
|
|
String testType = (String) modelTest.get("componentType");
|
|
|
- Component testComponent = createComponent(taskId, testType, modelTest, testIsEnable);
|
|
|
+ //暂无测试模型接口
|
|
|
+ Component testComponent = createComponent(taskId, testType, modelTest, testIsEnable , url);
|
|
|
if (componentService.save(testComponent)) {
|
|
|
componentIds.add(testComponent.getComponentId());
|
|
|
} else {
|
|
@@ -168,7 +189,8 @@ public class TrainTaskController {
|
|
|
if (postProcessing != null) {
|
|
|
Boolean isEnable = parseEnableValue(postProcessing.get("isEnable"), "后处理");
|
|
|
String type = (String) postProcessing.get("componentType");
|
|
|
- Component component = createComponent(taskId, type, postProcessing, isEnable);
|
|
|
+ String url = "http://ds3:10013/post_process";
|
|
|
+ Component component = createComponent(taskId, type, postProcessing, isEnable , url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -181,7 +203,8 @@ public class TrainTaskController {
|
|
|
if (analysisReport != null) {
|
|
|
Boolean isEnable = parseEnableValue(analysisReport.get("isEnable"), "分析报告");
|
|
|
String type = (String) analysisReport.get("componentType");
|
|
|
- Component component = createComponent(taskId, type, analysisReport, isEnable);
|
|
|
+ String url = "http://ds1:10099/analysis_report_small";
|
|
|
+ Component component = createComponent(taskId, type, analysisReport, isEnable , url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -342,7 +365,8 @@ public class TrainTaskController {
|
|
|
if (dataAcquisition != null) {
|
|
|
Boolean isEnable = parseEnableValue(dataAcquisition.get("isEnable"), "数据获取");
|
|
|
String type = (String) dataAcquisition.get("componentType");
|
|
|
- Component component = createComponent(tTaskId, type, dataAcquisition, isEnable);
|
|
|
+ String url = "http://ds3:10001/mysql_to_mongo";
|
|
|
+ Component component = createComponent(tTaskId, type, dataAcquisition, isEnable ,url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -355,7 +379,8 @@ public class TrainTaskController {
|
|
|
if (dataCleaning != null) {
|
|
|
Boolean isEnable = parseEnableValue(dataCleaning.get("isEnable"), "数据处理");
|
|
|
String type = (String) dataCleaning.get("componentType");
|
|
|
- Component component = createComponent(tTaskId, type, dataCleaning, isEnable);
|
|
|
+ String url = "http://ds3:10013/pre_process";
|
|
|
+ Component component = createComponent(tTaskId, type, dataCleaning, isEnable , url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -368,7 +393,13 @@ public class TrainTaskController {
|
|
|
if (powerRationing != null) {
|
|
|
Boolean isEnable = parseEnableValue(powerRationing.get("isEnable"), "限电清洗");
|
|
|
String type = (String) powerRationing.get("componentType");
|
|
|
- Component component = createComponent(tTaskId, type, powerRationing, isEnable);
|
|
|
+ String url = "";
|
|
|
+ if ("限电清洗-光伏".equals(type)){
|
|
|
+ url = "http://ds3:10008/processing_limit_power_by_statistics_light";
|
|
|
+ }else if ("限电清洗-风电".equals(type)){
|
|
|
+ url = "http://ds3:10009/processing_limit_power_by_statistics_wind";
|
|
|
+ }
|
|
|
+ Component component = createComponent(tTaskId, type, powerRationing, isEnable , url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -381,7 +412,19 @@ public class TrainTaskController {
|
|
|
if (model != null) {
|
|
|
Boolean modelIsEnable = parseEnableValue(model.get("isEnable"), "模型");
|
|
|
String modelType = (String) model.get("componentType");
|
|
|
- Component modelComponent = createComponent(tTaskId, modelType, model, modelIsEnable);
|
|
|
+ String url = "";
|
|
|
+ if ("光伏物理模型".equals(modelType)){
|
|
|
+ url = "http://ds3:10014/model_prediction_photovoltaic_physical";
|
|
|
+ }else if ("风电物理模型".equals(modelType)){
|
|
|
+ url = "http://ds3:10014/model_prediction_wind_physical";
|
|
|
+ }else if ("Holtwinters模型".equals(modelType)){
|
|
|
+ url = "http://ds3:10007/model_prediction_holtwinters";
|
|
|
+ }else if ("LSTM-训练".equals(modelType)){
|
|
|
+ url = "http://ds3:10003/tf_lstm_training";
|
|
|
+ }else if ("机器学习模型-训练".equals(modelType)){
|
|
|
+ url = "http://ds3:10005/model_training_ml";
|
|
|
+ }
|
|
|
+ Component modelComponent = createComponent(tTaskId, modelType, model, modelIsEnable,url);
|
|
|
if (componentService.save(modelComponent)) {
|
|
|
componentIds.add(modelComponent.getComponentId());
|
|
|
|
|
@@ -391,7 +434,8 @@ public class TrainTaskController {
|
|
|
if (modelTest != null) {
|
|
|
Boolean testIsEnable = parseEnableValue(modelTest.get("isEnable"), "模型测试");
|
|
|
String testType = (String) modelTest.get("componentType");
|
|
|
- Component testComponent = createComponent(tTaskId, testType, modelTest, testIsEnable);
|
|
|
+ //暂无测试模型接口
|
|
|
+ Component testComponent = createComponent(tTaskId, testType, modelTest, testIsEnable , url);
|
|
|
if (componentService.save(testComponent)) {
|
|
|
componentIds.add(testComponent.getComponentId());
|
|
|
} else {
|
|
@@ -409,7 +453,11 @@ public class TrainTaskController {
|
|
|
if (postProcessing != null) {
|
|
|
Boolean isEnable = parseEnableValue(postProcessing.get("isEnable"), "后处理");
|
|
|
String type = (String) postProcessing.get("componentType");
|
|
|
- Component component = createComponent(tTaskId, type, postProcessing, isEnable);
|
|
|
+ String url = "";
|
|
|
+ if ("后处理".equals(type)){
|
|
|
+ url = "http://ds3:10013/post_process";
|
|
|
+ }
|
|
|
+ Component component = createComponent(tTaskId, type, postProcessing, isEnable , url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -422,7 +470,11 @@ public class TrainTaskController {
|
|
|
if (analysisReport != null) {
|
|
|
Boolean isEnable = parseEnableValue(analysisReport.get("isEnable"), "分析报告");
|
|
|
String type = (String) analysisReport.get("componentType");
|
|
|
- Component component = createComponent(tTaskId, type, analysisReport, isEnable);
|
|
|
+ String url = "";
|
|
|
+ if ("分析报告".equals(type)){
|
|
|
+ url = "http://ds1:10099/analysis_report_small";
|
|
|
+ }
|
|
|
+ Component component = createComponent(tTaskId, type, analysisReport, isEnable , url);
|
|
|
if (componentService.save(component)) {
|
|
|
componentIds.add(component.getComponentId());
|
|
|
} else {
|
|
@@ -451,14 +503,14 @@ public class TrainTaskController {
|
|
|
/**
|
|
|
* 使用解析后的isEnable,删除错误强转
|
|
|
*/
|
|
|
- private Component createComponent(Long taskId, String componentType, Map<String, Object> config, Boolean isEnable) {
|
|
|
+ private Component createComponent(Long taskId, String componentType, Map<String, Object> config, Boolean isEnable , String url) {
|
|
|
Component component = new Component();
|
|
|
component.setTaskId(taskId);
|
|
|
component.setTaskType(0); // 训练任务固定标识
|
|
|
component.setComponentType(componentType);
|
|
|
component.setParamsMap((Map<String, Object>) config.get("params")); // 组件参数
|
|
|
component.setIsEnable(isEnable); // 仅使用解析后的isEnable值,无强转
|
|
|
- component.setInterfaceUrl((String) config.get("interfaceUrl")); // 接口地址
|
|
|
+ component.setInterfaceUrl(url); // 接口地址
|
|
|
return component;
|
|
|
}
|
|
|
|