From 73c79effac8c75ea0113201252b4be6212d4b478 Mon Sep 17 00:00:00 2001 From: Jiang Peng <2622360564@qq.com> Date: Wed, 1 May 2024 16:02:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E4=BB=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../muyu/common/system/domain/SysDept.java | 12 - .../muyu/common/system/domain/SysUser.java | 10 - .../java/com/muyu/etl/MuYuEtlApplication.java | 18 ++ .../com/muyu/etl/domain/AssetAccredit.java | 89 ++++++++ .../com/muyu/etl/domain/SourceAccredit.java | 86 ++++++++ .../muyu/etl/domain/custom/TableAssets.java | 67 ++++++ .../com/muyu/etl/domain/custom/VTClass.java | 15 ++ .../muyu/etl/domain/model/AccreditModel.java | 26 +++ .../mapper/system/AssetModelMapper.xml | 206 ++++++++++++++++++ .../mapper/system/DataAssetMapper.xml | 120 ++++++++++ 10 files changed, 627 insertions(+), 22 deletions(-) create mode 100644 muyu-modules/muyu-etl/src/main/java/com/muyu/etl/MuYuEtlApplication.java create mode 100644 muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/AssetAccredit.java create mode 100644 muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/SourceAccredit.java create mode 100644 muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/TableAssets.java create mode 100644 muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/VTClass.java create mode 100644 muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/model/AccreditModel.java create mode 100644 muyu-modules/muyu-etl/src/main/resources/mapper/system/AssetModelMapper.xml create mode 100644 muyu-modules/muyu-etl/src/main/resources/mapper/system/DataAssetMapper.xml diff --git a/muyu-common/muyu-common-system/src/main/java/com/muyu/common/system/domain/SysDept.java b/muyu-common/muyu-common-system/src/main/java/com/muyu/common/system/domain/SysDept.java index 7687e7c..9569d64 100644 --- a/muyu-common/muyu-common-system/src/main/java/com/muyu/common/system/domain/SysDept.java +++ b/muyu-common/muyu-common-system/src/main/java/com/muyu/common/system/domain/SysDept.java @@ -88,18 +88,6 @@ public class SysDept extends BaseEntity { * 子部门 */ private List children = new ArrayList(); - /** - * 是否授权 - */ - private Boolean IsAuth=false; - - public Boolean getAuth() { - return IsAuth; - } - - public void setAuth(Boolean auth) { - IsAuth = auth; - } public Long getDeptId () { return deptId; diff --git a/muyu-common/muyu-common-system/src/main/java/com/muyu/common/system/domain/SysUser.java b/muyu-common/muyu-common-system/src/main/java/com/muyu/common/system/domain/SysUser.java index 10d82dd..6be7436 100644 --- a/muyu-common/muyu-common-system/src/main/java/com/muyu/common/system/domain/SysUser.java +++ b/muyu-common/muyu-common-system/src/main/java/com/muyu/common/system/domain/SysUser.java @@ -108,16 +108,6 @@ public class SysUser extends BaseEntity { @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) private Date loginDate; - private Boolean isAuth = false; - - public Boolean getAuth() { - return isAuth; - } - - public void setAuth(Boolean auth) { - isAuth = auth; - } - /** * 部门对象 */ diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/MuYuEtlApplication.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/MuYuEtlApplication.java new file mode 100644 index 0000000..69d0805 --- /dev/null +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/MuYuEtlApplication.java @@ -0,0 +1,18 @@ +package com.muyu.etl; + +import com.muyu.common.security.annotation.EnableCustomConfig; +import com.muyu.common.security.annotation.EnableMyFeignClients; +import com.muyu.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; + +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableMyFeignClients +@SpringBootApplication +public class MuYuEtlApplication { + public static void main (String[] args) { + SpringApplication.run(MuYuEtlApplication.class, args); + } +} diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/AssetAccredit.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/AssetAccredit.java new file mode 100644 index 0000000..b7f6f0c --- /dev/null +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/AssetAccredit.java @@ -0,0 +1,89 @@ +package com.muyu.etl.domain; + +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +public class AssetAccredit extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 部门id */ + @Excel(name = "部门id") + private Long deptId; + + /** 数据表id */ + @Excel(name = "数据表id") + private Long dataAssetId; + + + /** 用户id */ + @Excel(name = "用户id") + private Long userId; + + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getDeptId() + { + return deptId; + } + public void setDataAssetId(Long dataAssetId) + { + this.dataAssetId = dataAssetId; + } + + public Long getDataAssetId() + { + return dataAssetId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("deptId", getDeptId()) + .append("dataAssetId", getDataAssetId()) + .append("userId", getUserId()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/SourceAccredit.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/SourceAccredit.java new file mode 100644 index 0000000..e9ab5a1 --- /dev/null +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/SourceAccredit.java @@ -0,0 +1,86 @@ +package com.muyu.etl.domain; + +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +public class SourceAccredit extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 部门id */ + @Excel(name = "部门id") + private Long deptId; + + /** 数据源id */ + @Excel(name = "数据源id") + private Long dataSourceId; + + + /** 用户id */ + @Excel(name = "用户id") + private Long userId; + + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public Long getDataSourceId() { + return dataSourceId; + } + + public void setDataSourceId(Long dataSourceId) { + this.dataSourceId = dataSourceId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("deptId", getDeptId()) + .append("dataSourceId", getDataSourceId()) + .append("userId", getUserId()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/TableAssets.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/TableAssets.java new file mode 100644 index 0000000..0b65619 --- /dev/null +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/TableAssets.java @@ -0,0 +1,67 @@ +package com.muyu.etl.domain.custom; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class TableAssets { + + /** + * 字段名 + */ + private String name; + + /** + * 字段注释 + */ + private String comment; + + /** + * 是否主键 + */ + private String isPrimaryKey; + + /** + * 类型 + */ + private String type; + + /** + * 映射类型 + */ + private String mappingType; + + /** + * 长度 + */ + private String length; + + /** + * 小数位 + */ + private String decimalPlaces; + + /** + * 是否可为空 + */ + private String isNull; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 是否字典 + */ + private String isDict; + + /** + * 字段key + */ + private String dictKey; + +} diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/VTClass.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/VTClass.java new file mode 100644 index 0000000..e257fe6 --- /dev/null +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/VTClass.java @@ -0,0 +1,15 @@ +package com.muyu.etl.domain.custom; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class VTClass { + + private String value; + private String type; + +} diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/model/AccreditModel.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/model/AccreditModel.java new file mode 100644 index 0000000..86fd426 --- /dev/null +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/model/AccreditModel.java @@ -0,0 +1,26 @@ +package com.muyu.etl.domain.model; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +public class AccreditModel { + + /** + * 用于存储与用户认证相关的模型ID + */ + private List userAccreditModelIds; + + /** + * 用于存储与部门认证相关的模型ID + */ + private List deptAccreditModelIds; + +} diff --git a/muyu-modules/muyu-etl/src/main/resources/mapper/system/AssetModelMapper.xml b/muyu-modules/muyu-etl/src/main/resources/mapper/system/AssetModelMapper.xml new file mode 100644 index 0000000..94642ea --- /dev/null +++ b/muyu-modules/muyu-etl/src/main/resources/mapper/system/AssetModelMapper.xml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, data_asset_id, name, comment, is_primary_key, type, mapping_type, length, decimal_places, is_null, is_dict,default_value, dict_key, create_by, create_time, update_by, update_time, remark from asset_model + + + + + + + + insert into asset_model + + data_asset_id, + name, + comment, + is_primary_key, + type, + mapping_type, + length, + decimal_places, + is_null, + is_dict, + default_value, + dict_key, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{dataAssetId}, + #{name}, + #{comment}, + #{isPrimaryKey}, + #{type}, + #{mappingType}, + #{length}, + #{decimalPlaces}, + #{isNull}, + #{isDict}, + #{defaultValue}, + #{dictKey}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + insert into `asset_model` ( + `data_asset_id`, + `name`, + comment, + is_primary_key, + `type`, + mapping_type, + `length`, + decimal_places, + is_null, + is_dict, + default_value, + dict_key, + create_by, + create_time + ) values + + ( + #{item.dataAssetId}, + #{item.name}, + #{item.comment}, + #{item.isPrimaryKey}, + #{item.type}, + #{item.mappingType}, + #{item.length}, + #{item.decimalPlaces}, + #{item.isNull}, + #{item.isDict}, + #{item.defaultValue}, + #{item.dictKey}, + #{item.createBy}, + #{item.createTime} + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update asset_model + + data_asset_id = #{dataAssetId}, + name = #{name}, + comment = #{comment}, + is_primary_key = #{isPrimaryKey}, + type = #{type}, + mapping_type = #{mappingType}, + length = #{length}, + decimal_places = #{decimalPlaces}, + is_null = #{isNull}, + is_dict = #{isDict}, + default_value = #{defaultValue}, + dict_key = #{dictKey}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from asset_model where id = #{id} + + + + delete from asset_model where id in + + #{id} + + + diff --git a/muyu-modules/muyu-etl/src/main/resources/mapper/system/DataAssetMapper.xml b/muyu-modules/muyu-etl/src/main/resources/mapper/system/DataAssetMapper.xml new file mode 100644 index 0000000..203ec50 --- /dev/null +++ b/muyu-modules/muyu-etl/src/main/resources/mapper/system/DataAssetMapper.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + select id, data_source_id, table_name, table_comment, table_count, fields, create_by, create_time, update_by, update_time, remark from data_asset + + + + + + + + insert into data_asset + + data_source_id, + table_name, + table_comment, + table_count, + fields, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{dataSourceId}, + #{tableName}, + #{tableComment}, + #{tableCount}, + #{fields}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + insert into data_asset + + data_source_id, + `table_name`, + table_comment, + table_count, + fields, + create_by, + create_time, + + values + + + #{item.dataSourceId}, + #{item.tableName}, + #{item.tableComment}, + #{item.tableCount}, + #{item.fields}, + #{item.createBy}, + #{item.createTime}, + + + + + + update data_asset + + data_source_id = #{dataSourceId}, + table_name = #{tableName}, + table_comment = #{tableComment}, + table_count = #{tableCount}, + fields = #{fields}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from data_asset where id = #{id} + + + + delete from data_asset where id in + + #{id} + + + \ No newline at end of file