From 3dc7b35e049822afc432c620aae0927e63ac354a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E8=B1=AA?= <1437200870@qq.com> Date: Wed, 21 Aug 2024 20:48:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=84=B1=E6=95=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 13 +- .../java/com/muyu/domain/AssetDataDict.java | 74 +++++- .../java/com/muyu/domain/AssetImpower.java | 101 +++++++- .../main/java/com/muyu/domain/DictInfo.java | 84 ++++++- .../main/java/com/muyu/domain/Dictionary.java | 104 +++++++- .../java/com/muyu/domain/DictionaryTYpe.java | 33 ++- .../src/main/java/com/muyu/domain/Source.java | 71 +++--- .../main/java/com/muyu/domain/SourceType.java | 11 +- .../main/java/com/muyu/domain/Structure.java | 179 +++++++++++++- .../main/java/com/muyu/domain/TableInfo.java | 121 +++++++++- .../com/muyu/domain/req/AssetImpowerReq.java | 64 ++++- .../java/com/muyu/domain/req/SourceReq.java | 227 ++++++++++++++---- cloud-etl-server/pom.xml | 72 +++++- .../muyu/cloud/etl/MuYuEtlApplication.java | 3 + .../etl/controller/DictionaryController.java | 33 --- .../etl/controller/SourceController.java | 62 ++++- .../etl/controller/SourceTypeController.java | 4 +- .../cloud/etl/mapper/DictionaryMapper.java | 20 -- .../com/muyu/cloud/etl/mapper/EtlMapper.java | 2 +- .../cloud/etl/service/DictionaryService.java | 16 -- .../muyu/cloud/etl/service/SourceService.java | 9 + .../cloud/etl/service/SourceTypeService.java | 2 - .../service/impl/DictionaryServiceImpl.java | 32 --- .../etl/service/impl/SourceServiceImpl.java | 31 +++ .../src/main/resources/bootstrap.yml | 14 ++ .../resources/mapper/DictionaryMapper.xml | 12 - .../src/main/resources/mapper/EtlMapper.xml | 2 +- 27 files changed, 1130 insertions(+), 266 deletions(-) delete mode 100644 cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/DictionaryController.java delete mode 100644 cloud-etl-server/src/main/java/com/muyu/cloud/etl/mapper/DictionaryMapper.java delete mode 100644 cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/DictionaryService.java delete mode 100644 cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/DictionaryServiceImpl.java delete mode 100644 cloud-etl-server/src/main/resources/mapper/DictionaryMapper.xml diff --git a/Dockerfile b/Dockerfile index 698c37b..ad06902 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,18 @@ +# 指定构建镜像的起始镜像 FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/dragonwell:17.0.4.0.4.8-standard-ga-8.6 +# 执行一些必须的条件 +# 定义时区参数 ENV TZ=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone +# 执行一些必备的条件 +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo "$TZ" > /etc/timezone -VOLUME ["/home/logs/cloud-etl"] +# 挂载工作目录 +VOLUME ["/home/logs"] +# 拷贝执行 jar 包文件 COPY ./cloud-etl-server/target/cloud-etl.jar /home/app.jar -ENTRYPOINT ["java","-jar"]CMD ["/home/app.jar"] +# 构建启动命令 +ENTRYPOINT ["java", "-Dfile.encoding=utf-8", "-jar", "/home/app.jar"] diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/AssetDataDict.java b/cloud-etl-common/src/main/java/com/muyu/domain/AssetDataDict.java index 8f3bae2..3cd820f 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/AssetDataDict.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/AssetDataDict.java @@ -9,16 +9,16 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; +import java.util.Date; +import java.util.Map; + /** * 资产数据字典对象 asset_data_dict * * @author Saisai * @date 2024-04-24 */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@SuperBuilder + public class AssetDataDict extends BaseEntity { private static final long serialVersionUID = 1L; @@ -31,6 +31,72 @@ public class AssetDataDict extends BaseEntity @Excel(name = "数据接入id") private Long basicId; + + @Override + public String toString() { + return "AssetDataDict{" + + "id=" + id + + ", basicId=" + basicId + + ", dictName='" + dictName + '\'' + + ", dictType='" + dictType + '\'' + + '}'; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getBasicId() { + return basicId; + } + + public void setBasicId(Long basicId) { + this.basicId = basicId; + } + + public String getDictName() { + return dictName; + } + + public void setDictName(String dictName) { + this.dictName = dictName; + } + + public String getDictType() { + return dictType; + } + + public void setDictType(String dictType) { + this.dictType = dictType; + } + + public AssetDataDict(BaseEntityBuilder b, Long id, Long basicId, String dictName, String dictType) { + super(b); + this.id = id; + this.basicId = basicId; + this.dictName = dictName; + this.dictType = dictType; + } + + public AssetDataDict(Long id, Long basicId, String dictName, String dictType) { + this.id = id; + this.basicId = basicId; + this.dictName = dictName; + this.dictType = dictType; + } + + public AssetDataDict(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map params, Long id, Long basicId, String dictName, String dictType) { + super(searchValue, createBy, createTime, updateBy, updateTime, remark, params); + this.id = id; + this.basicId = basicId; + this.dictName = dictName; + this.dictType = dictType; + } + /** 字典名称 */ @Excel(name = "字典名称") private String dictName; diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/AssetImpower.java b/cloud-etl-common/src/main/java/com/muyu/domain/AssetImpower.java index 5069e1e..50b4c47 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/AssetImpower.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/AssetImpower.java @@ -7,16 +7,16 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; +import java.util.Date; +import java.util.Map; + /** * 资产赋权对象 asset_impower * * @author Saisai * @date 2024-04-28 */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@SuperBuilder + public class AssetImpower extends BaseEntity { private static final long serialVersionUID = 1L; @@ -25,6 +25,57 @@ public class AssetImpower extends BaseEntity { */ private Long id; + @Override + public String toString() { + return "AssetImpower{" + + "id=" + id + + ", tableId=" + tableId + + ", deptId=" + deptId + + ", basicId=" + basicId + + ", userId=" + userId + + '}'; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getTableId() { + return tableId; + } + + public void setTableId(Long tableId) { + this.tableId = tableId; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public Long getBasicId() { + return basicId; + } + + public void setBasicId(Long basicId) { + this.basicId = basicId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + /** * 表id */ @@ -49,14 +100,40 @@ public class AssetImpower extends BaseEntity { @Excel(name = "用户id") private Long userId; - public static AssetImpower saveAssetImpower - (Long deptId,Long userId,AssetImpower assetImpower){ - return AssetImpower.builder() - .basicId(assetImpower.getBasicId()) - .tableId(assetImpower.getTableId()) - .deptId(deptId) - .userId(userId) - .build(); + public AssetImpower(BaseEntityBuilder b, Long id, Long tableId, Long deptId, Long basicId, Long userId) { + super(b); + this.id = id; + this.tableId = tableId; + this.deptId = deptId; + this.basicId = basicId; + this.userId = userId; } + public AssetImpower(Long id, Long tableId, Long deptId, Long basicId, Long userId) { + this.id = id; + this.tableId = tableId; + this.deptId = deptId; + this.basicId = basicId; + this.userId = userId; + } + + public AssetImpower(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map params, Long id, Long tableId, Long deptId, Long basicId, Long userId) { + super(searchValue, createBy, createTime, updateBy, updateTime, remark, params); + this.id = id; + this.tableId = tableId; + this.deptId = deptId; + this.basicId = basicId; + this.userId = userId; + } + +// public static AssetImpower saveAssetImpower +// (Long deptId,Long userId,AssetImpower assetImpower){ +// return AssetImpower.builder() +// .basicId(assetImpower.getBasicId()) +// .tableId(assetImpower.getTableId()) +// .deptId(deptId) +// .userId(userId) +// .build(); +// } + } diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/DictInfo.java b/cloud-etl-common/src/main/java/com/muyu/domain/DictInfo.java index 2793a0c..b21dccc 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/DictInfo.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/DictInfo.java @@ -10,20 +10,30 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; +import java.util.Date; +import java.util.Map; + /** * 字典详细内容对象 dict_info * * @author Saisai * @date 2024-04-24 */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@SuperBuilder public class DictInfo extends BaseEntity { private static final long serialVersionUID = 1L; + @Override + public String toString() { + return "DictInfo{" + + "id=" + id + + ", dictId=" + dictId + + ", infoName='" + infoName + '\'' + + ", infoValue='" + infoValue + '\'' + + ", isEdit=" + isEdit + + '}'; + } + /** 主键 */ @TableId(value = "id",type = IdType.AUTO) private Long id; @@ -32,6 +42,72 @@ public class DictInfo extends BaseEntity @Excel(name = "字典id") private Long dictId; + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getDictId() { + return dictId; + } + + public void setDictId(Long dictId) { + this.dictId = dictId; + } + + public String getInfoName() { + return infoName; + } + + public void setInfoName(String infoName) { + this.infoName = infoName; + } + + public String getInfoValue() { + return infoValue; + } + + public void setInfoValue(String infoValue) { + this.infoValue = infoValue; + } + + public boolean isEdit() { + return isEdit; + } + + public void setEdit(boolean edit) { + isEdit = edit; + } + + public DictInfo(BaseEntityBuilder b, Long id, Long dictId, String infoName, String infoValue, boolean isEdit) { + super(b); + this.id = id; + this.dictId = dictId; + this.infoName = infoName; + this.infoValue = infoValue; + this.isEdit = isEdit; + } + + public DictInfo(Long id, Long dictId, String infoName, String infoValue, boolean isEdit) { + this.id = id; + this.dictId = dictId; + this.infoName = infoName; + this.infoValue = infoValue; + this.isEdit = isEdit; + } + + public DictInfo(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map params, Long id, Long dictId, String infoName, String infoValue, boolean isEdit) { + super(searchValue, createBy, createTime, updateBy, updateTime, remark, params); + this.id = id; + this.dictId = dictId; + this.infoName = infoName; + this.infoValue = infoValue; + this.isEdit = isEdit; + } + /** 字典名称 */ @Excel(name = "字典名称") private String infoName; diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/Dictionary.java b/cloud-etl-common/src/main/java/com/muyu/domain/Dictionary.java index d388c9b..6f05391 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/Dictionary.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/Dictionary.java @@ -14,14 +14,110 @@ import java.util.Date; * @name:Dictionary * @Date:2024/8/21 10:31 */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@SuperBuilder public class Dictionary { private Integer createBy; private Date createTime; private Integer updateBy; + + @Override + public String toString() { + return "Dictionary{" + + "createBy=" + createBy + + ", createTime=" + createTime + + ", updateBy=" + updateBy + + ", updateTime=" + updateTime + + ", remark='" + remark + '\'' + + ", id=" + id + + ", code='" + code + '\'' + + ", descriotion='" + descriotion + '\'' + + ", typeId=" + typeId + + '}'; + } + + public Integer getCreateBy() { + return createBy; + } + + public void setCreateBy(Integer createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Integer getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(Integer updateBy) { + this.updateBy = updateBy; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDescriotion() { + return descriotion; + } + + public void setDescriotion(String descriotion) { + this.descriotion = descriotion; + } + + public Integer getTypeId() { + return typeId; + } + + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + public Dictionary(Integer createBy, Date createTime, Integer updateBy, Date updateTime, String remark, Long id, String code, String descriotion, Integer typeId) { + this.createBy = createBy; + this.createTime = createTime; + this.updateBy = updateBy; + this.updateTime = updateTime; + this.remark = remark; + this.id = id; + this.code = code; + this.descriotion = descriotion; + this.typeId = typeId; + } + private Date updateTime; private String remark; private Long id; diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/DictionaryTYpe.java b/cloud-etl-common/src/main/java/com/muyu/domain/DictionaryTYpe.java index a4296ee..85f8b6d 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/DictionaryTYpe.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/DictionaryTYpe.java @@ -13,11 +13,36 @@ import lombok.experimental.SuperBuilder; * @name:DictionaryTYpe * @Date:2024/8/21 10:32 */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@SuperBuilder public class DictionaryTYpe { private Long id; private String typeName; + + @Override + public String toString() { + return "DictionaryTYpe{" + + "id=" + id + + ", typeName='" + typeName + '\'' + + '}'; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public DictionaryTYpe(Long id, String typeName) { + this.id = id; + this.typeName = typeName; + } } diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/Source.java b/cloud-etl-common/src/main/java/com/muyu/domain/Source.java index cb531cc..c7631d8 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/Source.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/Source.java @@ -3,6 +3,7 @@ package com.muyu.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.common.core.annotation.Excel; import com.muyu.common.core.web.domain.BaseEntity; import lombok.AllArgsConstructor; import lombok.Data; @@ -11,8 +12,8 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; @Data -@NoArgsConstructor @AllArgsConstructor +@NoArgsConstructor @SuperBuilder @EqualsAndHashCode(callSuper = true) @TableName(value ="source",autoResultMap = true) //数据库表相关 @@ -21,70 +22,54 @@ public class Source extends BaseEntity { @TableId(value = "id", type = IdType.AUTO) private Long id; - - /** - *数据接入源 - */ + /** 接入源名称 */ + @Excel(name = "接入源名称") private String dataResourceName; - - /** - * 数据来源表 - */ + /** 数据来源系统名称 */ + @Excel(name = "数据来源系统名称") private String dataSourcesSystemName; - /** - * 主机Ip地址 - */ + /** 主机ip地址 */ + @Excel(name = "主机ip地址") private String host; - /** - * 端口 - */ + /** 端口 */ + @Excel(name = "端口") private String port; - - /** - * 数据类型 - */ + /** 数据接入类型 */ + @Excel(name = "数据接入类型") private String databaseType; - /** - * 数据库名称 - */ + /** 数据库名称 */ + @Excel(name = "数据库名称") private String databaseName; - /** - * 初始化连接数量 - */ + /** 初始化连接数量 */ + @Excel(name = "初始化连接数量") private Long initLinkNum; - /** - * 多大连接数量 - */ + /** 最大连接数量 */ + @Excel(name = "最大连接数量") private Long maxLinkNum; - /** - * 最长等待时间 - */ + /** 最大等待时间 */ + @Excel(name = "最大等待时间") private Long maxWaitTime; - /** - * 最多连接数量 - */ + /** 最大等待次数 */ + @Excel(name = "最大等待次数") private Long maxWaitTimes; - /** - * 连接参数 - */ + + @Excel(name ="连接参数") private String connectionParams; - /** - * 用户名 - */ + @Excel(name ="用户名") private String username; - /** - * 密码 - */ + @Excel(name ="密码") private String password; + + } diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/SourceType.java b/cloud-etl-common/src/main/java/com/muyu/domain/SourceType.java index 48cd07b..6ab2d0f 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/SourceType.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/SourceType.java @@ -1,5 +1,6 @@ package com.muyu.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.muyu.common.core.web.domain.BaseEntity; import lombok.AllArgsConstructor; @@ -13,11 +14,19 @@ import lombok.experimental.SuperBuilder; @NoArgsConstructor @SuperBuilder @EqualsAndHashCode(callSuper = true) -@TableName(value ="SourceType",autoResultMap = true) //数据库表相关 +@TableName(value ="sourcetype",autoResultMap = true) //数据库表相关 public class SourceType extends BaseEntity { private static final long serialVersionUID = 1L; //数据源类型ID private Integer id; + //数据源类型名称 private String name; + // + @TableField(value = "driver_class") + private String driverClass; + + private String prefix; + + private String suffix; } diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/Structure.java b/cloud-etl-common/src/main/java/com/muyu/domain/Structure.java index 65aefd7..7a4da10 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/Structure.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/Structure.java @@ -9,16 +9,15 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; +import java.util.Date; +import java.util.Map; + /** * 结构对象 structure * * @author Saisai * @date 2024-04-22 */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@SuperBuilder public class Structure extends BaseEntity { private static final long serialVersionUID = 1L; @@ -76,4 +75,176 @@ public class Structure extends BaseEntity private String dictionaryTable; + @Override + public String toString() { + return "Structure{" + + "id=" + id + + ", tableId=" + tableId + + ", columnName='" + columnName + '\'' + + ", columnRemark='" + columnRemark + '\'' + + ", isPrimary='" + isPrimary + '\'' + + ", columnType='" + columnType + '\'' + + ", javaType='" + javaType + '\'' + + ", columnLength='" + columnLength + '\'' + + ", columnDecimals='" + columnDecimals + '\'' + + ", isNull='" + isNull + '\'' + + ", defaultValue='" + defaultValue + '\'' + + ", isDictionary='" + isDictionary + '\'' + + ", dictionaryTable='" + dictionaryTable + '\'' + + '}'; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getTableId() { + return tableId; + } + + public void setTableId(Long tableId) { + this.tableId = tableId; + } + + public String getColumnName() { + return columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public String getColumnRemark() { + return columnRemark; + } + + public void setColumnRemark(String columnRemark) { + this.columnRemark = columnRemark; + } + + public String getIsPrimary() { + return isPrimary; + } + + public void setIsPrimary(String isPrimary) { + this.isPrimary = isPrimary; + } + + public String getColumnType() { + return columnType; + } + + public void setColumnType(String columnType) { + this.columnType = columnType; + } + + public String getJavaType() { + return javaType; + } + + public void setJavaType(String javaType) { + this.javaType = javaType; + } + + public String getColumnLength() { + return columnLength; + } + + public void setColumnLength(String columnLength) { + this.columnLength = columnLength; + } + + public String getColumnDecimals() { + return columnDecimals; + } + + public void setColumnDecimals(String columnDecimals) { + this.columnDecimals = columnDecimals; + } + + public String getIsNull() { + return isNull; + } + + public void setIsNull(String isNull) { + this.isNull = isNull; + } + + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + public String getIsDictionary() { + return isDictionary; + } + + public void setIsDictionary(String isDictionary) { + this.isDictionary = isDictionary; + } + + public String getDictionaryTable() { + return dictionaryTable; + } + + public void setDictionaryTable(String dictionaryTable) { + this.dictionaryTable = dictionaryTable; + } + + public Structure(BaseEntityBuilder b, Long id, Long tableId, String columnName, String columnRemark, String isPrimary, String columnType, String javaType, String columnLength, String columnDecimals, String isNull, String defaultValue, String isDictionary, String dictionaryTable) { + super(b); + this.id = id; + this.tableId = tableId; + this.columnName = columnName; + this.columnRemark = columnRemark; + this.isPrimary = isPrimary; + this.columnType = columnType; + this.javaType = javaType; + this.columnLength = columnLength; + this.columnDecimals = columnDecimals; + this.isNull = isNull; + this.defaultValue = defaultValue; + this.isDictionary = isDictionary; + this.dictionaryTable = dictionaryTable; + } + + public Structure(Long id, Long tableId, String columnName, String columnRemark, String isPrimary, String columnType, String javaType, String columnLength, String columnDecimals, String isNull, String defaultValue, String isDictionary, String dictionaryTable) { + this.id = id; + this.tableId = tableId; + this.columnName = columnName; + this.columnRemark = columnRemark; + this.isPrimary = isPrimary; + this.columnType = columnType; + this.javaType = javaType; + this.columnLength = columnLength; + this.columnDecimals = columnDecimals; + this.isNull = isNull; + this.defaultValue = defaultValue; + this.isDictionary = isDictionary; + this.dictionaryTable = dictionaryTable; + } + + public Structure(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map params, Long id, Long tableId, String columnName, String columnRemark, String isPrimary, String columnType, String javaType, String columnLength, String columnDecimals, String isNull, String defaultValue, String isDictionary, String dictionaryTable) { + super(searchValue, createBy, createTime, updateBy, updateTime, remark, params); + this.id = id; + this.tableId = tableId; + this.columnName = columnName; + this.columnRemark = columnRemark; + this.isPrimary = isPrimary; + this.columnType = columnType; + this.javaType = javaType; + this.columnLength = columnLength; + this.columnDecimals = columnDecimals; + this.isNull = isNull; + this.defaultValue = defaultValue; + this.isDictionary = isDictionary; + this.dictionaryTable = dictionaryTable; + } } diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/TableInfo.java b/cloud-etl-common/src/main/java/com/muyu/domain/TableInfo.java index 7a8b2a3..0adaffd 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/TableInfo.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/TableInfo.java @@ -9,16 +9,14 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; +import java.util.List; + /** * 库表基础信息对象 table_info * * @author Saisai * @date 2024-04-22 */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@SuperBuilder public class TableInfo extends TreeEntity { private static final long serialVersionUID = 1L; @@ -30,6 +28,121 @@ public class TableInfo extends TreeEntity private Long basicId; + @Override + public String toString() { + return "TableInfo{" + + "id=" + id + + ", basicId=" + basicId + + ", tableName='" + tableName + '\'' + + ", tableRemark='" + tableRemark + '\'' + + ", type='" + type + '\'' + + ", dataNum=" + dataNum + + ", center='" + center + '\'' + + ", parentId=" + parentId + + '}'; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getBasicId() { + return basicId; + } + + public void setBasicId(Long basicId) { + this.basicId = basicId; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getTableRemark() { + return tableRemark; + } + + public void setTableRemark(String tableRemark) { + this.tableRemark = tableRemark; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Long getDataNum() { + return dataNum; + } + + public void setDataNum(Long dataNum) { + this.dataNum = dataNum; + } + + public String getCenter() { + return center; + } + + public void setCenter(String center) { + this.center = center; + } + + @Override + public Long getParentId() { + return parentId; + } + + @Override + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public TableInfo(TreeEntityBuilder b, Long id, Long basicId, String tableName, String tableRemark, String type, Long dataNum, String center, Long parentId) { + super(b); + this.id = id; + this.basicId = basicId; + this.tableName = tableName; + this.tableRemark = tableRemark; + this.type = type; + this.dataNum = dataNum; + this.center = center; + this.parentId = parentId; + } + + public TableInfo(Long id, Long basicId, String tableName, String tableRemark, String type, Long dataNum, String center, Long parentId) { + this.id = id; + this.basicId = basicId; + this.tableName = tableName; + this.tableRemark = tableRemark; + this.type = type; + this.dataNum = dataNum; + this.center = center; + this.parentId = parentId; + } + + public TableInfo(String parentName, Long parentId, Integer orderNum, String ancestors, List children, Long id, Long basicId, String tableName, String tableRemark, String type, Long dataNum, String center, Long parentId1) { + super(parentName, parentId, orderNum, ancestors, children); + this.id = id; + this.basicId = basicId; + this.tableName = tableName; + this.tableRemark = tableRemark; + this.type = type; + this.dataNum = dataNum; + this.center = center; + this.parentId = parentId1; + } + /** 表名称/数据库 */ @Excel(name = "表名称/数据库") private String tableName; diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/req/AssetImpowerReq.java b/cloud-etl-common/src/main/java/com/muyu/domain/req/AssetImpowerReq.java index 9bdbd71..1427e87 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/req/AssetImpowerReq.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/req/AssetImpowerReq.java @@ -14,10 +14,7 @@ import lombok.experimental.SuperBuilder; * @Author SaiSai.Liu * @Date 2024/4/29 14:04 */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@SuperBuilder + public class AssetImpowerReq { private static final long serialVersionUID = 1L; @@ -34,6 +31,65 @@ public class AssetImpowerReq { @Excel(name = "表id") private Long tableId; + @Override + public String toString() { + return "AssetImpowerReq{" + + "id=" + id + + ", tableId=" + tableId + + ", basicId=" + basicId + + ", deptId=" + deptId + + ", userId=" + userId + + '}'; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getTableId() { + return tableId; + } + + public void setTableId(Long tableId) { + this.tableId = tableId; + } + + public Long getBasicId() { + return basicId; + } + + public void setBasicId(Long basicId) { + this.basicId = basicId; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public AssetImpowerReq(Long id, Long tableId, Long basicId, Long deptId, Long userId) { + this.id = id; + this.tableId = tableId; + this.basicId = basicId; + this.deptId = deptId; + this.userId = userId; + } + /** * 接入id */ diff --git a/cloud-etl-common/src/main/java/com/muyu/domain/req/SourceReq.java b/cloud-etl-common/src/main/java/com/muyu/domain/req/SourceReq.java index 5afde2d..e6e224c 100644 --- a/cloud-etl-common/src/main/java/com/muyu/domain/req/SourceReq.java +++ b/cloud-etl-common/src/main/java/com/muyu/domain/req/SourceReq.java @@ -2,78 +2,213 @@ package com.muyu.domain.req; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; +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 java.util.Date; +import java.util.Map; + + -@Data -@AllArgsConstructor -@NoArgsConstructor -@SuperBuilder public class SourceReq extends BaseEntity { /** 主键 */ @TableId(value = "id", type = IdType.AUTO) private Long id; - /** - * - *数据接入源 - */ + + /** 接入源名称 */ + @Excel(name = "接入源名称") private String dataResourceName; - - /** - * 数据来源表 - */ + /** 数据来源系统名称 */ + @Excel(name = "数据来源系统名称") private String dataSourcesSystemName; - /** - * 主机Ip地址 - */ + /** 主机ip地址 */ + @Excel(name = "主机ip地址") private String host; - /** - * 端口 - */ + /** 端口 */ + @Excel(name = "端口") private String port; - - /** - * 数据类型 - */ + /** 数据接入类型 */ + @Excel(name = "数据接入类型") private String databaseType; - /** - * 数据库名称 - */ + /** 数据库名称 */ + @Excel(name = "数据库名称") private String databaseName; - /** - * 初始化连接数量 - */ + /** 初始化连接数量 */ + @Excel(name = "初始化连接数量") private Long initLinkNum; - /** - * 多大连接数量 - */ + /** 最大连接数量 */ + @Excel(name = "最大连接数量") private Long maxLinkNum; - /** - * 最长等待时间 - */ + /** 最大等待时间 */ + @Excel(name = "最大等待时间") private Long maxWaitTime; - /** - * 最多连接数量 - */ + /** 最大等待次数 */ + @Excel(name = "最大等待次数") private Long maxWaitTimes; - /** - * 连接参数 - */ - private String connectionParams; + + @Override + public String toString() { + return "SourceReq{" + + "id=" + id + + ", dataResourceName='" + dataResourceName + '\'' + + ", dataSourcesSystemName='" + dataSourcesSystemName + '\'' + + ", host='" + host + '\'' + + ", port='" + port + '\'' + + ", databaseType='" + databaseType + '\'' + + ", databaseName='" + databaseName + '\'' + + ", initLinkNum=" + initLinkNum + + ", maxLinkNum=" + maxLinkNum + + ", maxWaitTime=" + maxWaitTime + + ", maxWaitTimes=" + maxWaitTimes + + '}'; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDataResourceName() { + return dataResourceName; + } + + public void setDataResourceName(String dataResourceName) { + this.dataResourceName = dataResourceName; + } + + public String getDataSourcesSystemName() { + return dataSourcesSystemName; + } + + public void setDataSourcesSystemName(String dataSourcesSystemName) { + this.dataSourcesSystemName = dataSourcesSystemName; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port; + } + + public String getDatabaseType() { + return databaseType; + } + + public void setDatabaseType(String databaseType) { + this.databaseType = databaseType; + } + + public String getDatabaseName() { + return databaseName; + } + + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + public Long getInitLinkNum() { + return initLinkNum; + } + + public void setInitLinkNum(Long initLinkNum) { + this.initLinkNum = initLinkNum; + } + + public Long getMaxLinkNum() { + return maxLinkNum; + } + + public void setMaxLinkNum(Long maxLinkNum) { + this.maxLinkNum = maxLinkNum; + } + + public Long getMaxWaitTime() { + return maxWaitTime; + } + + public void setMaxWaitTime(Long maxWaitTime) { + this.maxWaitTime = maxWaitTime; + } + + public Long getMaxWaitTimes() { + return maxWaitTimes; + } + + public void setMaxWaitTimes(Long maxWaitTimes) { + this.maxWaitTimes = maxWaitTimes; + } + + + + public SourceReq(BaseEntityBuilder b, Long id, String dataResourceName, String dataSourcesSystemName, String host, String port, String databaseType, String databaseName, Long initLinkNum, Long maxLinkNum, Long maxWaitTime, Long maxWaitTimes, String connectionParams) { + super(b); + this.id = id; + this.dataResourceName = dataResourceName; + this.dataSourcesSystemName = dataSourcesSystemName; + this.host = host; + this.port = port; + this.databaseType = databaseType; + this.databaseName = databaseName; + this.initLinkNum = initLinkNum; + this.maxLinkNum = maxLinkNum; + this.maxWaitTime = maxWaitTime; + this.maxWaitTimes = maxWaitTimes; + + } + + public SourceReq(Long id, String dataResourceName, String dataSourcesSystemName, String host, String port, String databaseType, String databaseName, Long initLinkNum, Long maxLinkNum, Long maxWaitTime, Long maxWaitTimes, String connectionParams) { + this.id = id; + this.dataResourceName = dataResourceName; + this.dataSourcesSystemName = dataSourcesSystemName; + this.host = host; + this.port = port; + this.databaseType = databaseType; + this.databaseName = databaseName; + this.initLinkNum = initLinkNum; + this.maxLinkNum = maxLinkNum; + this.maxWaitTime = maxWaitTime; + this.maxWaitTimes = maxWaitTimes; + } + + public SourceReq(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map params, Long id, String dataResourceName, String dataSourcesSystemName, String host, String port, String databaseType, String databaseName, Long initLinkNum, Long maxLinkNum, Long maxWaitTime, Long maxWaitTimes, String connectionParams) { + super(searchValue, createBy, createTime, updateBy, updateTime, remark, params); + this.id = id; + this.dataResourceName = dataResourceName; + this.dataSourcesSystemName = dataSourcesSystemName; + this.host = host; + this.port = port; + this.databaseType = databaseType; + this.databaseName = databaseName; + this.initLinkNum = initLinkNum; + this.maxLinkNum = maxLinkNum; + this.maxWaitTime = maxWaitTime; + this.maxWaitTimes = maxWaitTimes; + + } + + } diff --git a/cloud-etl-server/pom.xml b/cloud-etl-server/pom.xml index 42ef980..23ba1ae 100644 --- a/cloud-etl-server/pom.xml +++ b/cloud-etl-server/pom.xml @@ -3,18 +3,26 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + com.muyu cloud-etl 1.0.0 + com.muyu + cloud-etl-server + 1.0.0 + + com.muyu + cloud-common-core + com.muyu @@ -65,11 +73,12 @@ cloud-common-datascope - - - - - + + + com.muyu + cloud-common-log + 3.6.3 + @@ -77,17 +86,60 @@ cloud-common-api-doc - - - - - + + + com.muyu + cloud-common-xxl + 3.6.3 + + + + + + + + + + + + + + + + + + + cloud-etl + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/MuYuEtlApplication.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/MuYuEtlApplication.java index fe66521..9c1999d 100644 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/MuYuEtlApplication.java +++ b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/MuYuEtlApplication.java @@ -2,13 +2,16 @@ package com.muyu.cloud.etl; import com.muyu.common.security.annotation.EnableCustomConfig; import com.muyu.common.security.annotation.EnableMyFeignClients; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; + @EnableCustomConfig @EnableMyFeignClients @SpringBootApplication +@MapperScan("com.muyu.cloud.etl.mapper") public class MuYuEtlApplication { public static void main (String[] args) { SpringApplication.run(MuYuEtlApplication.class, args); diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/DictionaryController.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/DictionaryController.java deleted file mode 100644 index 8f10e8a..0000000 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/DictionaryController.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.muyu.cloud.etl.controller; - -import com.muyu.cloud.etl.service.DictionaryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.xml.transform.Result; - -/** - * @Author:qdm - * @Package:com.muyu.cloud.etl.controller - * @Project:cloud-etlsdadawd - * @name:DictionaryController - * @Date:2024/8/21 10:34 - */ -@RestController -@RequestMapping("/etl") -public class DictionaryController { - @Autowired - private DictionaryService dictionaryService; - @PostMapping("/open/{id}") - public Result open(@PathVariable Long id){ - return dictionaryService.open(id); - } - - @PostMapping("/close/{id}") - public Result close(@PathVariable Long id){ - return dictionaryService.close(id); - } -} diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/SourceController.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/SourceController.java index 50bfdfc..0b8b9d2 100644 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/SourceController.java +++ b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/SourceController.java @@ -2,15 +2,15 @@ package com.muyu.cloud.etl.controller; import com.muyu.cloud.etl.service.SourceService; import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.security.annotation.RequiresPermissions; import com.muyu.domain.Source; import com.muyu.domain.req.SourceReq; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -30,4 +30,60 @@ public class SourceController extends BaseController { return getDataTable(list); } + /* + * 导出 + */ + @RequiresPermissions("etl:info:export") + @PostMapping("/export") + public void export(HttpServletResponse response, SourceReq sourceReq) { + List list= sourceService.selectSourceList(sourceReq); + ExcelUtil util = new ExcelUtil<>(Source.class); + util.exportExcel(response,list,"基础信息"); + } + + /** + * 获取基础信息详细信息 + */ + @RequiresPermissions("etl:info:query") + @GetMapping(value = "/{id}") + public Result getInfo(@PathVariable("id") Long id) { + Source source= sourceService.getInfo(id); + return success(source); + } + + /** + * 新增基础信息 + */ + @RequiresPermissions("etl:info:add") + @PostMapping + public Result add(@RequestBody Source sourceReq) { + + return toAjax(sourceService.insertBasicConfigInfo(sourceReq)); + } + + //批量删除 + @RequiresPermissions("etl:info:deleteIds") + @DeleteMapping("{ids}") + public Integer delete(@PathVariable("ids") String ids) { + return sourceService.deleteByIds(ids); + } + + /** + * 修改 + */ +// @RequiresPermissions("etl:info:updata") +// @PostMapping +// public Result update(@RequestBody Source sourceReq) { +// +// return toAjax(sourceService.updataSource(sourceReq)); +// } + + + + + + + + + } diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/SourceTypeController.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/SourceTypeController.java index 85ca0b8..072746f 100644 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/SourceTypeController.java +++ b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/controller/SourceTypeController.java @@ -4,7 +4,6 @@ package com.muyu.cloud.etl.controller; import com.muyu.cloud.etl.service.SourceTypeService; import com.muyu.common.core.domain.Result; import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.security.annotation.RequiresPermissions; import com.muyu.domain.SourceType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -19,8 +18,7 @@ public class SourceTypeController extends BaseController { @Autowired private SourceTypeService sourceTypeService; - //查询数据源类型 - @RequiresPermissions("etl:type:list") + @GetMapping("/findSourceType") public Result> findSourceType() { List sourceTypeList=sourceTypeService.findSourceType(); diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/mapper/DictionaryMapper.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/mapper/DictionaryMapper.java deleted file mode 100644 index 5c6dbf0..0000000 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/mapper/DictionaryMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.muyu.cloud.etl.mapper; - -import feign.Param; -import org.apache.ibatis.annotations.Mapper; - -import javax.xml.transform.Result; - -/** - * @Author:qdm - * @Package:com.muyu.cloud.etl.mapper - * @Project:cloud-etlsdadawd - * @name:DictionaryMapper - * @Date:2024/8/21 10:39 - */ -@Mapper -public interface DictionaryMapper { - Result open(@Param("id") Long id); - - Result close(@Param("id") Long id); -} diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/mapper/EtlMapper.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/mapper/EtlMapper.java index fa80b74..6a08f84 100644 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/mapper/EtlMapper.java +++ b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/mapper/EtlMapper.java @@ -15,7 +15,7 @@ import java.util.List; * @Date:2024/8/20 20:47 */ @Mapper -public interface EtlMapper { +public interface EtlMapper{ List list(AssetImpower assetImpower); Result deleteAssetImpowerByIds(@Param("ids") Long[] ids); diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/DictionaryService.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/DictionaryService.java deleted file mode 100644 index 8ac60c9..0000000 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/DictionaryService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.muyu.cloud.etl.service; - -import javax.xml.transform.Result; - -/** - * @Author:qdm - * @Package:com.muyu.cloud.etl.service - * @Project:cloud-etlsdadawd - * @name:DictionaryService - * @Date:2024/8/21 10:35 - */ -public interface DictionaryService { - Result open(Long id); - - Result close(Long id); -} diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/SourceService.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/SourceService.java index c1d0d8e..ad4d30b 100644 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/SourceService.java +++ b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/SourceService.java @@ -8,4 +8,13 @@ import java.util.List; public interface SourceService extends IService { List selectSourceList(SourceReq sourceReq); + + Source getInfo(Long id); + + int insertBasicConfigInfo(Source sourceReq); + + Integer deleteByIds(String ids); + +// int updataSource(Source sourceReq); + } diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/SourceTypeService.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/SourceTypeService.java index c87a8eb..c0342ef 100644 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/SourceTypeService.java +++ b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/SourceTypeService.java @@ -8,6 +8,4 @@ import java.util.List; public interface SourceTypeService extends IService { List findSourceType(); - - } diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/DictionaryServiceImpl.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/DictionaryServiceImpl.java deleted file mode 100644 index 67a7018..0000000 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/DictionaryServiceImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.muyu.cloud.etl.service.impl; - -import com.muyu.cloud.etl.mapper.DictionaryMapper; -import com.muyu.cloud.etl.service.DictionaryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.xml.transform.Result; -import java.util.List; - -/** - * @Author:qdm - * @Package:com.muyu.cloud.etl.service.impl - * @Project:cloud-etlsdadawd - * @name:DictionaryServiceImpl - * @Date:2024/8/21 10:35 - */ -@Service -public class DictionaryServiceImpl implements DictionaryService { - @Autowired - private DictionaryMapper dictionaryMapper; - - @Override - public Result open(Long id) { - return dictionaryMapper.open(id); - } - - @Override - public Result close(Long id) { - return dictionaryMapper.close(id); - } -} diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/SourceServiceImpl.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/SourceServiceImpl.java index 9839aaa..d3fab66 100644 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/SourceServiceImpl.java +++ b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/SourceServiceImpl.java @@ -1,5 +1,6 @@ package com.muyu.cloud.etl.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.muyu.cloud.etl.mapper.SourceMapper; import com.muyu.cloud.etl.service.SourceService; @@ -19,4 +20,34 @@ public class SourceServiceImpl extends ServiceImpl impleme public List selectSourceList(SourceReq sourceReq) { return sourceMapper.selectSourceList(sourceReq); } + + @Override + public Source getInfo(Long id) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(Source::getId, id); + return this.sourceMapper.selectOne(lambdaQueryWrapper); + } + + //新增 + @Override + public int insertBasicConfigInfo(Source sourceReq) { + int insert = sourceMapper.insert(sourceReq); + return insert; + } + + @Override + public Integer deleteByIds(String ids) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(Source::getId, ids); + int delete = sourceMapper.delete(lambdaQueryWrapper); + return delete; + } + +// @Override +// public int updataSource(Source sourceReq) { +// LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); +// int update = sourceMapper.update(lambdaQueryWrapper); +// return update; +// } + } diff --git a/cloud-etl-server/src/main/resources/bootstrap.yml b/cloud-etl-server/src/main/resources/bootstrap.yml index e015494..31293d1 100644 --- a/cloud-etl-server/src/main/resources/bootstrap.yml +++ b/cloud-etl-server/src/main/resources/bootstrap.yml @@ -10,6 +10,7 @@ nacos: namespace: text # Spring spring: + application: # 应用名称 name: cloud-etl @@ -45,3 +46,16 @@ spring: # 系统环境Config共享配置 - application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + - application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # rabbit 配置文件 + - application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 配置 MyBatis 的日志输出实现类,这里是输出到控制台 + mapper-locations: classpath:/mapper/*.xml # MyBatis Mapper 文件的位置,这里假设是 XML 形式的 Mapper + global-config: + db-config: + id-type: auto # 主键生成策略,这里设置为自动增长 + logic-delete-value: 1 # 逻辑删除标记值,例如设置为 1 表示已删除 + logic-not-delete-value: 0 # 逻辑未删除标记值,例如设置为 0 表示未删除 + banner: false # 关闭控制台打印的 MyBatis-Plus Banner diff --git a/cloud-etl-server/src/main/resources/mapper/DictionaryMapper.xml b/cloud-etl-server/src/main/resources/mapper/DictionaryMapper.xml deleted file mode 100644 index ce5aad0..0000000 --- a/cloud-etl-server/src/main/resources/mapper/DictionaryMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - update dictionary set status = 1 where id = #{id} - - - update dictionary set status = 2 where id = #{id} - - diff --git a/cloud-etl-server/src/main/resources/mapper/EtlMapper.xml b/cloud-etl-server/src/main/resources/mapper/EtlMapper.xml index 1a60cbd..eb3a66e 100644 --- a/cloud-etl-server/src/main/resources/mapper/EtlMapper.xml +++ b/cloud-etl-server/src/main/resources/mapper/EtlMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - select id, basic_id, dict_name, dict_type, remark, create_by, create_time, update_by, update_time from asset_data_dict + select id, basic_id, dict_name, dict_type, remark, create_by, create_time, update_by, update_time from asset_data_dict select id, basic_id, dict_name, dict_type, remark, create_by, create_time, update_by, update_time from asset_data_dict