资产展示修改cml跨库查询
parent
c119051a8a
commit
435883dd31
|
@ -184,7 +184,9 @@ public class DataRunNameServiceImpl implements DataRunNameService {
|
||||||
log.info("数据库表名称:{}",dataName.getTableNames());
|
log.info("数据库表名称:{}",dataName.getTableNames());
|
||||||
if (CollectionUtils.isEmpty(dataName.getTableNames())) {return;}
|
if (CollectionUtils.isEmpty(dataName.getTableNames())) {return;}
|
||||||
//在内部封装方法
|
//在内部封装方法
|
||||||
dataName.getTableNames().forEach(tableName1 -> {this.tableNameRun(tableName1,dataName);});
|
dataName.getTableNames().forEach(tableName1 -> {
|
||||||
|
this.tableNameRun(tableName1,dataName);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -250,18 +252,16 @@ public class DataRunNameServiceImpl implements DataRunNameService {
|
||||||
tableName1.setTableFie(fieArrayList);
|
tableName1.setTableFie(fieArrayList);
|
||||||
|
|
||||||
//创建线程池
|
//创建线程池
|
||||||
ExecutorService executorService = Executors.newFixedThreadPool(500);
|
ExecutorService executorService = Executors.newFixedThreadPool(50);
|
||||||
List<DataValue> tableValue = this.findTableValue(String.valueOf(dataName.getId()), tableName1.getName());
|
List<DataValue> tableValue = this.findTableValue(String.valueOf(dataName.getId()), tableName1.getName());
|
||||||
|
|
||||||
// fieArrayList.stream().filter(item->item.getField().equals(tableValue.stream().filter(key -> key.getKey()!=null).toList()))
|
// fieArrayList.stream().filter(item->item.getField().equals(tableValue.stream().filter(key -> key.getKey()!=null).toList()))
|
||||||
// .forEach(item->{
|
// .forEach(item->{
|
||||||
// item.setDataMapping(item.getType());
|
// item.setDataMapping(item.getType());
|
||||||
// });
|
// });
|
||||||
fieArrayList.forEach(tableFy -> {
|
fieArrayList.forEach(tableFy -> {
|
||||||
|
//查询字段映射信息
|
||||||
String str = this.tableFySelect(dataName.getName(),tableName1.getName(),tableFy.getField());
|
String str = this.tableFySelect(dataName.getName(),tableName1.getName(),tableFy.getField());
|
||||||
tableFy.setDataValue(str);
|
tableFy.setDataValue(str);
|
||||||
|
|
||||||
executorService.submit(
|
executorService.submit(
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -278,6 +278,9 @@ public class DataRunNameServiceImpl implements DataRunNameService {
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -286,6 +289,13 @@ public class DataRunNameServiceImpl implements DataRunNameService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询值
|
||||||
|
* @param dataDame
|
||||||
|
* @param tableName
|
||||||
|
* @param field
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
private String tableFySelect(String dataDame, String tableName, String field) {
|
private String tableFySelect(String dataDame, String tableName, String field) {
|
||||||
|
|
||||||
// 从连接池获取数据库连接
|
// 从连接池获取数据库连接
|
||||||
|
@ -345,6 +355,13 @@ public class DataRunNameServiceImpl implements DataRunNameService {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权后资产展示
|
||||||
|
* @param conn
|
||||||
|
* @param list
|
||||||
|
* @param preparedStatement
|
||||||
|
* @throws SQLException
|
||||||
|
*/
|
||||||
private void getDataResult(DruidPooledConnection conn, List<DataValue> list, PreparedStatement preparedStatement) throws SQLException {
|
private void getDataResult(DruidPooledConnection conn, List<DataValue> list, PreparedStatement preparedStatement) throws SQLException {
|
||||||
ResultSet resultSet = preparedStatement.executeQuery();
|
ResultSet resultSet = preparedStatement.executeQuery();
|
||||||
ResultSetMetaData metaData = resultSet.getMetaData();
|
ResultSetMetaData metaData = resultSet.getMetaData();
|
||||||
|
|
Loading…
Reference in New Issue