添加字段和表
parent
96e79bc9c2
commit
5f812afbb7
|
@ -71,7 +71,7 @@ public class TaskInput extends BaseEntity {
|
|||
/**
|
||||
* 字段规则
|
||||
*/
|
||||
private String fieIdAsEngineId;
|
||||
private Long fieIdAsEngineId;
|
||||
|
||||
public static TaskInputResp build(TaskInput node) {
|
||||
return TaskInputResp.builder()
|
||||
|
|
|
@ -20,4 +20,6 @@ public class TaskOutput {
|
|||
private Long taskId;
|
||||
private String newFieName;
|
||||
private String lastFieName;
|
||||
private Long tableId;
|
||||
private Long basicId;
|
||||
}
|
||||
|
|
|
@ -54,5 +54,5 @@ public class TaskInputUpdReq {
|
|||
/**
|
||||
* 字段规则
|
||||
*/
|
||||
private String fieIdAsEngineId;
|
||||
private Long fieIdAsEngineId;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ public class TaskInputResp {
|
|||
/**
|
||||
* 字段规则
|
||||
*/
|
||||
private String fieIdAsEngineId;
|
||||
private Long fieIdAsEngineId;
|
||||
}
|
||||
|
|
|
@ -25,5 +25,5 @@ public class TableVo {
|
|||
/**
|
||||
* 字段规则
|
||||
*/
|
||||
private String fieIdAsEngineId;
|
||||
private Long fieIdAsEngineId;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.muyu.common.domain.DataValue;
|
|||
import com.muyu.common.domian.NodeJoint;
|
||||
import com.muyu.common.domian.TaskInfo;
|
||||
import com.muyu.common.domian.TaskInput;
|
||||
import com.muyu.common.domian.TaskOutput;
|
||||
import com.muyu.common.domian.req.TaskInfoListReq;
|
||||
import com.muyu.common.domian.resp.TaskInfoResp;
|
||||
import com.muyu.remote.feign.DatasourceFeign;
|
||||
|
@ -17,11 +18,13 @@ import com.muyu.task.server.mapper.TaskInfoMapper;
|
|||
import com.muyu.task.server.service.NodeJointService;
|
||||
import com.muyu.task.server.service.TaskInfoService;
|
||||
import com.muyu.task.server.service.TaskInputService;
|
||||
import com.muyu.task.server.service.TaskOutputService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -39,6 +42,10 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
|
|||
@Autowired
|
||||
private NodeJointService nodeJointService;
|
||||
|
||||
@Autowired
|
||||
private TaskOutputService taskOutputService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private DatasourceFeign datasourceFeign;
|
||||
|
||||
|
@ -73,10 +80,14 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
|
|||
return "没有选择字段";
|
||||
}
|
||||
String fieName = "";
|
||||
HashMap<String, Long> hashMap = new HashMap<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
fieName += "," + list.get(i).getTableAsFieId();
|
||||
Long databaseId = list.get(i).getDatabaseId();
|
||||
longs.add(databaseId);
|
||||
String tableFieId = list.get(i).getTableFieId();
|
||||
Long fieIdAsEngineId = list.get(i).getFieIdAsEngineId();
|
||||
hashMap.put(tableFieId,fieIdAsEngineId);
|
||||
}
|
||||
if (longs.size() > 1) {
|
||||
return "你选择的不是同一个数据库";
|
||||
|
@ -112,10 +123,22 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
|
|||
String sql = " SELECT " + fieName + " FROM "+ joint;
|
||||
System.out.println(sql);
|
||||
Result<List<List<DataValue>>> tableValueResult = datasourceFeign.findTableValue(basicId, sql);
|
||||
QueryWrapper<TaskOutput> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("task_id", taskId);
|
||||
List<TaskOutput> list1 = taskOutputService.list(queryWrapper);
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
for (TaskOutput taskOutput : list1) {
|
||||
String lastFieName = taskOutput.getLastFieName();
|
||||
String newFieName = taskOutput.getNewFieName();
|
||||
map.put(lastFieName, newFieName);
|
||||
}
|
||||
List<List<DataValue>> tableValue = tableValueResult.getData();
|
||||
for (List<DataValue> dataValues : tableValue) {
|
||||
System.out.println(dataValues);
|
||||
|
||||
}
|
||||
return null;
|
||||
|
||||
|
||||
|
||||
return "执行成功";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue