fine:()修改规格

master
Yueng 2024-08-29 14:39:39 +08:00
parent 530a80e4fe
commit e001e2ea0d
15 changed files with 67186 additions and 48114 deletions

View File

@ -12,7 +12,7 @@ import java.util.function.Supplier;
/**
* @Author
* @Packagecom.muyu.common.domain
* @Packagecom.muyu.common.domain
* @Projectcloud-integration
* @nameConnection
* @Date2024/8/21 1:00

View File

@ -14,14 +14,13 @@ import java.util.function.Supplier;
/**
* @Author
* @Packagecom.muyu.server.pojo
* @Packagecom.muyu.server.pojo //核心数据
* @Projectcloud-integration
* @nameDataSourceList
* @Date2024/8/20 18:47
*/
@Data
@Builder
//核心数据
@TableName(value = "data_source")
@AllArgsConstructor
@NoArgsConstructor

View File

@ -1,76 +0,0 @@
package com.muyu.common.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
import java.util.function.Supplier;
/**
* @Author
* @Packagecom.muyu.server.pojo
* @Projectcloud-integration
* @nameDataSourceList
* @Date2024/8/20 18:47
*/
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@TableName(value = "data_source")
@AllArgsConstructor
@NoArgsConstructor
//
public class DataSourceInfo extends BaseEntity {
@TableId(value = "id",type = IdType.AUTO)
private String id ;
private String name ;
private String cardNo ;
private String descriot ;
private String ctfTp ;
private String ctfId ;
private String gender ;
private String birthday ;
private String address ;
private String zip ;
private String dirty ;
private String district1 ;
private String district2 ;
private String district3 ;
private String district4 ;
private String district5 ;
private String district6 ;
private String firstNm ;
private String lastNm ;
private String duty ;
private String mobile ;
private String tel ;
private String fax ;
private String eMail ;
private String nation ;
private String taste ;
private String education ;
private String company ;
private String cTel ;
private String cAddress ;
private String cZip ;
private String family ;
private String version ;
// public static DataSourceList updBuild(DataSourceList dataSourceList, Supplier<Long> idSupplier) {
// return DataSourceList.builder()
// .id(idSupplier.get())
// .name(dataSourceList.getName())
// .gender(dataSourceList.getGender())
// .
// ;
// }
}

View File

@ -33,7 +33,7 @@ public class TableFie{
*
*/
@TableField(value = "field")
private String fieId;
private String field;
/**
*
*/
@ -62,7 +62,7 @@ public class TableFie{
public static TableFie customerBuild(TableFie tableFie, Supplier<TableFie> function) {
return com.muyu.common.domain.TableFie.builder()
.fieId(tableFie.getFieId())
.field(tableFie.getField())
.type(tableFie.getType())
.collation(tableFie.getCollation())
.nullable(tableFie.getNullable())
@ -93,7 +93,7 @@ public class TableFie{
*/
public static TableFie updBuild(TableFie req, Supplier<String> idSupplier) {
return com.muyu.common.domain.TableFie.builder()
.fieId(idSupplier.get())
.field(idSupplier.get())
.type(req.getType())
.collation(req.getCollation())
.nullable(req.getNullable())
@ -104,8 +104,8 @@ public class TableFie{
public TableFie buildTableField() {
return com.muyu.common.domain.TableFie.builder()
.fieId(this.getFieId())
return TableFie.builder()
.field(this.getField())
.type(this.getType())
.collation(this.getCollation())
.nullable(this.getNullable())

View File

@ -33,7 +33,7 @@ public class CoreDataListController {
/**
*
* @param dataSourceList
* @param dataSourceList
* @return
*/
@PostMapping("/selectData")

View File

@ -15,6 +15,11 @@ import java.util.List;
*/
public interface DataSourceService extends IService<DataSourceList> {
/**
*
* @param connect
* @return
*/
List<DataSourceList> extractData(Connect connect);
/**

View File

@ -41,20 +41,21 @@ public class DataNameServiceImpl
String sql = null;
DruidDataSource druidDataSource = JdbcHelper.getConnRs();
sql = "SHOW DATABASES;";
try (Connection conn = druidDataSource.getConnection()) {
// 在这里执行你的数据库操作
PreparedStatement preparedStatement = conn.prepareStatement(sql);
ResultSet rs = preparedStatement.executeQuery();
try {
assert druidDataSource != null;
try (Connection conn = druidDataSource.getConnection()) {
// 在这里执行你的数据库操作
PreparedStatement preparedStatement = conn.prepareStatement(sql);
ResultSet rs = preparedStatement.executeQuery();
ArrayList<DataName> list = new ArrayList<>();
while (rs.next()) {
String database = rs.getString("Database");
ArrayList<DataName> list = new ArrayList<>();
while (rs.next()) {
list.add(new DataName(0, rs.getString("Database")));
}
JdbcHelper.close(conn,preparedStatement,rs);
list.add(new DataName(0,database));
return list;
}
JdbcHelper.close(conn,preparedStatement,rs);
return list;
} catch (SQLException e) {
e.printStackTrace();
}

View File

@ -32,6 +32,11 @@ public class DataSourceServiceImpl
extends ServiceImpl<DataSourceMapper, DataSourceList>
implements DataSourceService {
/**
*
* @param connect
* @return
*/
@Override
public List<DataSourceList> extractData(Connect connect) {
ExecutorService executorService = Executors.newFixedThreadPool(100);
@ -77,7 +82,6 @@ public class DataSourceServiceImpl
if (substring.contains("id")){
id = rs.getInt("id");
}
String name = (rs.getString("COLUMN_NAME"));
String gender = (rs.getString("gender"));
Date birthday = (rs.getDate("birthday"));
@ -140,12 +144,15 @@ public class DataSourceServiceImpl
ResultSet rs = preparedStatement.executeQuery();
ArrayList<TableFie> tableFIES = new ArrayList<>();
while (rs.next()) {
String fieldId = rs.getString("Field"); // 使用正确的列名 Field
// 使用正确的列名 Field
TableFie tableFie = TableFie.builder()
.fieId(fieldId) // 假设你修改了字段名为 fieldId以符合常规命名规范
// 假设你修改了字段名为 fieldId以符合常规命名规范
.field(rs.getString("Field"))
.type(rs.getString("Type"))
.collation(rs.getString("Collation"))
.nullable(rs.getString("Null")) // 转换为布尔值,假设你想要这个字段
// 转换为布尔值,假设你想要这个字段
.nullable(rs.getString("Null"))
.primarys(rs.getString("Key"))
.annotation(rs.getString("Comment"))
.build();

View File

@ -12,6 +12,8 @@ import org.springframework.stereotype.Service;
import java.util.List;
import static com.muyu.common.domain.TableFie.customerBuild;
/**
* @Authoryang
* @Packagecom.muyu.server.service.impl
@ -41,11 +43,11 @@ public class TableFieldServiceImpl
);
List<TableFie> tableFieList = this.list(queryWrapper);
return tableFieList.stream()
.map(orderPaytableField -> com.muyu.common.domain.TableFie.customerBuild(
.map(orderPaytableField -> customerBuild(
orderPaytableField,
() -> (TableFie) tableFieldServicelimt.selectOrderPayByAppCodeAndLimit(orderPaytableField.getFieId(),5)
.stream()
.map(com.muyu.common.domain.TableFie::buildTableField)
.map(TableFie::buildTableField)
.toList()
)
)

View File

@ -43,7 +43,7 @@ public class TableRunNameServiceImpl
ResultSet rs = preparedStatement.executeQuery();
ArrayList<TableNames> list = new ArrayList<>();
while (rs.next()) {
String tables = rs.getString("Tables_in_core_data_warehouse");
String tables = rs.getString("Tables_in_"+name);
list.add(new TableNames(tables,0));
}
JdbcHelper.close(conn,preparedStatement,rs);

View File

@ -19,7 +19,11 @@ import java.sql.*;
@Log4j2
public class JdbcHelper {
/**
*
* @param connect
* @return
*/
public static DruidDataSource getConn( Connect connect) {
while (0<connect.getMaxWaitTimes()){
try {
@ -39,13 +43,17 @@ public class JdbcHelper {
return druidDataSource;
} catch (Exception e) {
log.error("异常为:{}"+e);
log.error("异常为:{}", String.valueOf(e));
}
}
return null;
}
/**
*
* @return
*/
public static DruidDataSource getConnRs() {
try {
@ -54,21 +62,21 @@ public class JdbcHelper {
"=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8");
druidDataSource.setUsername("root");
druidDataSource.setPassword("Bwie-8666");
//"com.mysql.cj.jdbc.Driver"
druidDataSource.setDriverClassName(new ConnectReq().getDRIVER());
// druidDataSource.setInitialSize(connect.getInitSize());
// druidDataSource.setMaxActive(connect.getMaxNumConn());
// druidDataSource.setMaxWait(connect.getMaxWaitTime());
return druidDataSource;
} catch (Exception e) {
log.error("异常为:{}"+e);
log.error("异常为:{}", String.valueOf(e));
}
return null;
}
/**
*
* @return
*/
public static DruidDataSource getDataConnRs(String name) {
try {
@ -79,15 +87,11 @@ public class JdbcHelper {
"utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8");
druidDataSource.setUsername("root");
druidDataSource.setPassword("Bwie-8666");
//"com.mysql.cj.jdbc.Driver"
druidDataSource.setDriverClassName(new ConnectReq().getDRIVER());
// druidDataSource.setInitialSize(connect.getInitSize());
// druidDataSource.setMaxActive(connect.getMaxNumConn());
// druidDataSource.setMaxWait(connect.getMaxWaitTime());
return druidDataSource;
} catch (Exception e) {
log.error("异常为:{}"+e);
log.error("异常为:{}", String.valueOf(e));
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff