资产更新版本3.0豪华版优化字段名称查询

master
Yueng 2024-09-07 09:46:32 +08:00
parent 638070605d
commit e127f8824f
1 changed files with 9 additions and 8 deletions

View File

@ -116,7 +116,7 @@ public class DataRunNameServiceImpl implements DataRunNameService {
//数据库名称查询 //数据库名称查询
List<DataName> dataNameList = dataNameService.list().stream() List<DataName> dataNameList = dataNameService.list().stream()
.map(DataName::dataNameBuild).toList(); .map(DataName::dataNameBuild).toList();
HashSet<TableNames> set = new HashSet<>();
//遍历获取数据数据库名称对象 //遍历获取数据数据库名称对象
dataNameList.forEach(dataName -> { dataNameList.forEach(dataName -> {
@ -143,13 +143,13 @@ public class DataRunNameServiceImpl implements DataRunNameService {
tableIdAndBasicIdByUserId.forEach(tableIdAndBasicId -> { tableIdAndBasicIdByUserId.forEach(tableIdAndBasicId -> {
this.dataDeptShow(tableIdAndBasicId,dataName); List<TableNames> tableNames = this.dataDeptShow(tableIdAndBasicId, dataName);
set.addAll(tableNames);
}); });
idByDeptId.forEach(tableIdAndBasicId -> { idByDeptId.forEach(tableIdAndBasicId -> {
this.dataDeptShow(tableIdAndBasicId,dataName); List<TableNames> tableNames = this.dataDeptShow(tableIdAndBasicId, dataName);
set.addAll(tableNames);
}); });
} }
@ -158,7 +158,7 @@ public class DataRunNameServiceImpl implements DataRunNameService {
return dataNameList; return dataNameList;
} }
private void dataDeptShow(AssetAuthorization tableIdAndBasicId, DataName dataName) { private List<TableNames> dataDeptShow(AssetAuthorization tableIdAndBasicId, DataName dataName) {
List<TableNames> tableNamesList = tableRunNameService.list(new LambdaQueryWrapper<TableNames>() List<TableNames> tableNamesList = tableRunNameService.list(new LambdaQueryWrapper<TableNames>()
.eq(TableNames::getDataId, dataName.getId()) .eq(TableNames::getDataId, dataName.getId())
.eq(TableNames::getId, tableIdAndBasicId.getTableId())) .eq(TableNames::getId, tableIdAndBasicId.getTableId()))
@ -169,7 +169,7 @@ public class DataRunNameServiceImpl implements DataRunNameService {
//判断tableNamesList查询数据为空直接返回 //判断tableNamesList查询数据为空直接返回
if (CollectionUtils.isEmpty(tableNamesList)) { if (CollectionUtils.isEmpty(tableNamesList)) {
return; return null;
} }
//在每一次循环中创建一个新的集合 //在每一次循环中创建一个新的集合
@ -178,11 +178,12 @@ public class DataRunNameServiceImpl implements DataRunNameService {
dataName.setTableNames(namesArrayList); dataName.setTableNames(namesArrayList);
//将添加好的实体类集合进行遍历操作 //将添加好的实体类集合进行遍历操作
log.info("数据库表名称:{}",dataName.getTableNames()); log.info("数据库表名称:{}",dataName.getTableNames());
if (CollectionUtils.isEmpty(dataName.getTableNames())) {return;} if (CollectionUtils.isEmpty(dataName.getTableNames())) {return null;}
//在内部封装方法 //在内部封装方法
dataName.getTableNames().forEach(tableName1 -> { dataName.getTableNames().forEach(tableName1 -> {
this.tableStructureShow(tableName1); this.tableStructureShow(tableName1);
}); });
return tableNamesList;
} }
/** /**