fix: 数据资产详细信息,数据结构完成
parent
15484a31a5
commit
28d6400be9
|
@ -2,14 +2,12 @@ package com.muyu.etl.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.TreeEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.muyu.common.core.annotation.Excel;
|
|
||||||
import com.muyu.common.core.web.domain.TreeEntity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库表基础信息对象 table_info
|
* 库表基础信息对象 table_info
|
||||||
|
@ -27,7 +25,7 @@ public class TableInfo extends TreeEntity
|
||||||
|
|
||||||
/** 主键 */
|
/** 主键 */
|
||||||
|
|
||||||
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@ -50,4 +48,7 @@ public class TableInfo extends TreeEntity
|
||||||
private String center;
|
private String center;
|
||||||
|
|
||||||
|
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ public class TableInfoStructureResp
|
||||||
/** 表备注 */
|
/** 表备注 */
|
||||||
@Excel(name = "表备注")
|
@Excel(name = "表备注")
|
||||||
private String tableRemark;
|
private String tableRemark;
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
/** 数据量 */
|
/** 数据量 */
|
||||||
@Excel(name = "数据量")
|
@Excel(name = "数据量")
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMapp
|
||||||
System.out.println("Connected to the MySQL server successfully.");
|
System.out.println("Connected to the MySQL server successfully.");
|
||||||
//同步数据库信息
|
//同步数据库信息
|
||||||
//树级结构,库,表
|
//树级结构,库,表
|
||||||
TableInfo tableInfo = new TableInfo().builder()
|
TableInfo tableInfo = TableInfo.builder()
|
||||||
.basicId(basicConfigInfo.getId())
|
.basicId(basicConfigInfo.getId())
|
||||||
.parentId(0L)
|
.parentId(0L)
|
||||||
.tableRemark("")
|
.tableRemark("")
|
||||||
|
@ -154,14 +154,14 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMapp
|
||||||
String tableName1 = rs.getString("TABLE_NAME");
|
String tableName1 = rs.getString("TABLE_NAME");
|
||||||
String tableRemark = rs.getString("REMARKS");
|
String tableRemark = rs.getString("REMARKS");
|
||||||
Connection finalConn = conn;
|
Connection finalConn = conn;
|
||||||
PreparedStatement ps = conn.prepareStatement("select * from " + tableName1);
|
PreparedStatement ps = conn.prepareStatement("select* from " + tableName1);
|
||||||
ResultSet rset = ps.executeQuery();
|
ResultSet rset = ps.executeQuery();
|
||||||
Long rowCount = 0L;
|
Long rowCount = 0L;
|
||||||
while(rset.next()) {rowCount++;}
|
while(rset.next()) {rowCount++;}
|
||||||
TableInfo build = TableInfo.builder()
|
TableInfo build = TableInfo.builder()
|
||||||
.basicId(basicConfigInfo.getId())
|
.basicId(basicConfigInfo.getId())
|
||||||
.tableName(tableName1)
|
.tableName(tableName1)
|
||||||
.tableRemark(tableRemark.isEmpty()? "":tableRemark)
|
.tableRemark(tableRemark.isEmpty()? "null":tableRemark)
|
||||||
.parentId(tableInfo.getId())
|
.parentId(tableInfo.getId())
|
||||||
.center("Y")
|
.center("Y")
|
||||||
.updateBy(SecurityUtils.getUsername())
|
.updateBy(SecurityUtils.getUsername())
|
||||||
|
@ -318,6 +318,7 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMapp
|
||||||
.center(info.getCenter())
|
.center(info.getCenter())
|
||||||
.tableRemark(info.getTableRemark())
|
.tableRemark(info.getTableRemark())
|
||||||
.dataNum(info.getDataNum())
|
.dataNum(info.getDataNum())
|
||||||
|
.parentId(info.getParentId())
|
||||||
.databaseType(basicConfigInfo.getDatabaseType())
|
.databaseType(basicConfigInfo.getDatabaseType())
|
||||||
.structureList(structureList)
|
.structureList(structureList)
|
||||||
.basicId(info.getBasicId())
|
.basicId(info.getBasicId())
|
||||||
|
|
Loading…
Reference in New Issue