diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/AssetModelController.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/AssetModelController.java index f8a6b32..eca8a94 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/AssetModelController.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/AssetModelController.java @@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletResponse; import java.util.List; /** - * 【请填写功能名称】Controller + * 【数据模型】Controller * * @author ruoyi * @date 2024-04-22 @@ -71,10 +71,10 @@ public class AssetModelController extends BaseController @PutMapping("UpdateAssetModel") public Result edit(@RequestBody AssetModel assetModel) { + // 调用资产模型服务,更新资产模型信息,并将结果转换为Ajax形式返回 return toAjax(assetModelService.updateAssetModel(assetModel)); } - /** * 删除【请填写功能名称】 */ diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DataSourceController.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DataSourceController.java index c9793d5..7b3b2d0 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DataSourceController.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DataSourceController.java @@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletResponse; import java.util.List; /** - * 【请填写功能名称】Controller + * 【数据源】Controller * * @author ruoyi * @date 2024-04-20 @@ -111,6 +111,7 @@ public class DataSourceController extends BaseController public Result synchronization(@RequestBody DataSource dataSource){ return dataSourceService.synchronization(dataSource); } + @PostMapping("dataAssetList") public Result dataAssetList(@RequestBody DataSource dataSource){ return dataSourceService.dataAssetList(dataSource); @@ -123,4 +124,5 @@ public class DataSourceController extends BaseController public Result statisticsInfo(){ return dataSourceService.statisticsInfo(); } + } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DictionaryController.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DictionaryController.java index 74a898f..fe66316 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DictionaryController.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DictionaryController.java @@ -4,7 +4,6 @@ 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.etl.domain.Dictionary; import com.muyu.etl.service.DictionaryService; import org.springframework.beans.factory.annotation.Autowired; @@ -14,7 +13,7 @@ import javax.servlet.http.HttpServletResponse; import java.util.List; /** - * 【请填写功能名称】Controller + * 【字典】Controller * * @author ruoyi * @date 2024-04-24 @@ -70,15 +69,14 @@ public class DictionaryController extends BaseController * 修改【请填写功能名称】 */ @PutMapping - public Result edit(@RequestBody Dictionary dictionary) - { + public Result edit(@RequestBody Dictionary dictionary) { return toAjax(dictionaryService.updateDictionary(dictionary)); } /** * 删除【请填写功能名称】 */ - @DeleteMapping("/{ids}") + @DeleteMapping("/{ids}") public Result remove(@PathVariable Long[] ids) { return toAjax(dictionaryService.deleteDictionaryByIds(ids)); @@ -87,10 +85,8 @@ public class DictionaryController extends BaseController public Result getDictionaryList(@RequestParam("dataSourceId") Long dataSourceId){ return dictionaryService.getDictionaryList(dataSourceId); } - -// @GetMapping("delDict") -// public Result delDict(Long id){ -// return dictionaryService.delDict(id); -// } - + @GetMapping("delDict") + public Result delDict(Long id){ + return dictionaryService.delDict(id); + } } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DictionaryDataController.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DictionaryDataController.java index 203f33a..12cb324 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DictionaryDataController.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DictionaryDataController.java @@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletResponse; import java.util.List; /** - * 【请填写功能名称】Controller + * 【字典详情值】Controller * * @author ruoyi * @date 2024-04-24 @@ -82,4 +82,8 @@ public class DictionaryDataController extends BaseController { return toAjax(dictionaryDataService.deleteDictionaryDataByIds(ids)); } + @PostMapping("delById") + public Result delById(@RequestParam Long id){ + return toAjax(dictionaryDataService.deleteDictionaryDataById(id)); + } } 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 index b7f6f0c..aba8504 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -15,7 +14,6 @@ import org.apache.commons.lang3.builder.ToStringStyle; @NoArgsConstructor @SuperBuilder public class AssetAccredit extends BaseEntity { - private static final long serialVersionUID = 1L; /** $column.columnComment */ diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DataAsset.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DataAsset.java index 7de375c..cb22141 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DataAsset.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DataAsset.java @@ -8,7 +8,6 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import java.sql.ResultSet; -import java.sql.SQLException; import java.util.Date; /** @@ -18,9 +17,9 @@ import java.util.Date; * @Date 2024/4/22 20:41 */ @Data -@SuperBuilder @AllArgsConstructor @NoArgsConstructor +@SuperBuilder public class DataAsset extends BaseEntity { private Long id; private Long dataSourceId; @@ -29,67 +28,16 @@ public class DataAsset extends BaseEntity { private Long tableCount; private Long fields; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getDataSourceId() { - return dataSourceId; - } - - public void setDataSourceId(Long dataSourceId) { - this.dataSourceId = dataSourceId; - } - - public String getTableName() { - return tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public String getTableComment() { - return tableComment; - } - - public void setTableComment(String tableComment) { - this.tableComment = tableComment; - } - - public Long getTableCount() { - return tableCount; - } - - public void setTableCount(Long tableCount) { - this.tableCount = tableCount; - } - - public Long getFields() { - return fields; - } - - public void setFields(Long fields) { - this.fields = fields; - } - - public DataAsset dataAssetBuild(DataSource dataSource,ResultSet resultSet){ - try { - return DataAsset.builder() - .tableName(resultSet.getString("t_name")) - .tableComment(resultSet.getString("table_comment") == null ? "-":resultSet.getString("table_comment")) - .tableCount(Long.valueOf(resultSet.getString("table_rows"))) - .fields(Long.valueOf(resultSet.getString("fields"))) - .dataSourceId(dataSource.getId()) - .createBy(SecurityUtils.getUsername()) - .createTime(new Date()) - .build(); - } catch (SQLException e) { - throw new RuntimeException(e); - } + public DataAsset dataAsset(DataAsset dataAsset , ResultSet resultSet){ + return DataAsset.builder() + .id(dataAsset.getId()) + .dataSourceId(dataAsset.getDataSourceId()) + .tableName(dataAsset.getTableName()) + .tableComment(dataAsset.getTableComment()) + .tableCount(dataAsset.getTableCount()) + .fields(dataAsset.getFields()) + .updateBy(SecurityUtils.getUsername()) + .updateTime(new Date()) + .build(); } } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DictionaryData.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DictionaryData.java index 177e34d..0500b30 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DictionaryData.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DictionaryData.java @@ -17,28 +17,23 @@ import java.util.List; @AllArgsConstructor @NoArgsConstructor public class DictionaryData extends BaseEntity { - private Long id; /** * 字典表Id */ private Long dictionaryId; - /** * 字典标签 */ private String label; - /** * 字典值 */ private String val; - + private List dictionaryDatas; /** * 修改状态 */ + private Boolean isEdit = false; - - private List dictionaryDatas; - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/Statistics.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/Statistics.java deleted file mode 100644 index 832a9e5..0000000 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/Statistics.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.muyu.etl.domain; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Statistics { - - // 数据资产ID - private Long dataAsset; - // 资产模型ID - private Long assetModel; - // 数据模型ID - private Long dataModel; - -} diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/Statistics.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/Statistics.java index 564a1c8..a7a6387 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/Statistics.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/Statistics.java @@ -1,14 +1,12 @@ package com.muyu.etl.domain.custom; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor -@Builder public class Statistics { /** 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 deleted file mode 100644 index 0b65619..0000000 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/TableAssets.java +++ /dev/null @@ -1,67 +0,0 @@ -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 deleted file mode 100644 index e257fe6..0000000 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/custom/VTClass.java +++ /dev/null @@ -1,15 +0,0 @@ -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 index 86fd426..dc6bd93 100644 --- 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 @@ -12,7 +12,6 @@ import java.util.List; @NoArgsConstructor @SuperBuilder public class AccreditModel { - /** * 用于存储与用户认证相关的模型ID */ @@ -22,5 +21,4 @@ public class AccreditModel { * 用于存储与部门认证相关的模型ID */ private List deptAccreditModelIds; - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/req/AssetAccreditReq.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/req/AssetAccreditReq.java index be2912e..3286f8c 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/req/AssetAccreditReq.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/req/AssetAccreditReq.java @@ -12,9 +12,7 @@ import java.util.List; @SuperBuilder @AllArgsConstructor public class AssetAccreditReq { - private List deptIds; private Long userId; private Long dataAssetId; - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/req/SourceAccreditReq.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/req/SourceAccreditReq.java index a5dd269..3c034fc 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/req/SourceAccreditReq.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/req/SourceAccreditReq.java @@ -12,9 +12,7 @@ import java.util.List; @AllArgsConstructor @SuperBuilder public class SourceAccreditReq { - - private List deptIds; - private Long userId; - private Long dataSourceId; - + private List deptIds; + private Long userId; + private Long dataSourceId; } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/AssetAccreditMapper.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/AssetAccreditMapper.java index 9b579af..e9b7c0b 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/AssetAccreditMapper.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/AssetAccreditMapper.java @@ -4,14 +4,11 @@ import com.muyu.etl.domain.AssetAccredit; import com.muyu.etl.domain.req.AssetAccreditReq; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import org.springframework.beans.PropertyValues; -import java.util.ArrayList; import java.util.List; @Mapper public interface AssetAccreditMapper { - List selectAssetAccreditList(AssetAccredit assetAccredit); public AssetAccredit selectAssetAccreditById(Long id); @@ -31,5 +28,4 @@ public interface AssetAccreditMapper { List getSourceAccreditByUserId(Long userId); void insertBachAssetAccredit(@Param("assetAccredits") List assetAccredits); - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/AssetModelMapper.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/AssetModelMapper.java index 6352943..d26fc58 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/AssetModelMapper.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/AssetModelMapper.java @@ -68,7 +68,5 @@ public interface AssetModelMapper int clearTable1(@Param("id") Long[] id); void batchInsert(@Param("tableAssets") List tableAssets); - void updateAssetModelDiction(Long id); - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DataAssetMapper.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DataAssetMapper.java index ed1a0bd..c6dd282 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DataAssetMapper.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DataAssetMapper.java @@ -65,9 +65,7 @@ public interface DataAssetMapper public int deleteDataAssetByIds(Long[] ids); void batchInsert(@Param("dataAssets") ArrayList dataAssets); - List selectById(Long id); List getDataAssetByAssetId(@Param("assetIds") List assetIds); - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DictionaryMapper.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DictionaryMapper.java index 63119ea..ef2d89f 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DictionaryMapper.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DictionaryMapper.java @@ -56,7 +56,5 @@ public interface DictionaryMapper { List getDictionaryList(@Param("dataSourceId") Long dataSourceId); - List getDictionaryDataList(@Param("string") List string); - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/SourceAccreditMapper.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/SourceAccreditMapper.java index 9659df8..cff3ccd 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/SourceAccreditMapper.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/SourceAccreditMapper.java @@ -3,13 +3,18 @@ package com.muyu.etl.mapper; import com.muyu.etl.domain.SourceAccredit; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Service; import java.util.List; +/** + * 【请填写功能名称】Mapper接口 + * + * @author ruoyi + * @date 2024-04-25 + */ @Mapper -public interface SourceAccreditMapper { - +public interface SourceAccreditMapper +{ /** * 查询【请填写功能名称】 * @@ -67,5 +72,4 @@ public interface SourceAccreditMapper { void insertBatchSourceAccredit(@Param("sourceAccredits") List sourceAccredits); void deleteSourceAccreditByDeptUser(@Param("deptIds") List deptIds, @Param("userId") Long userId, @Param("dataSourceId") Long dataSourceId); - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/AssetAccreditService.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/AssetAccreditService.java index dd12cc3..85f9785 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/AssetAccreditService.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/AssetAccreditService.java @@ -3,28 +3,22 @@ package com.muyu.etl.service; import com.muyu.common.core.domain.Result; import com.muyu.etl.domain.AssetAccredit; import com.muyu.etl.domain.req.AssetAccreditReq; -import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Service; import java.util.List; @Service public interface AssetAccreditService { - List selectAssetAccreditList(AssetAccredit assetAccredit); AssetAccredit selectAssetAccreditById(Long id); public Result insertAssetAccredit(AssetAccreditReq assetAccreditReq); - public int updateAssetAccredit(AssetAccredit assetAccredit); - public int deleteAssetAccreditByIds(Long[] ids); - public int deleteAssetAccreditById(Long id); Result getAssetAccreditByDataAssetId(Long id); - Result deleteAssetAccreditByAssetId(AssetAccreditReq assetAccreditReq); } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DictionaryDataService.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DictionaryDataService.java index e70be80..cc3b23a 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DictionaryDataService.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DictionaryDataService.java @@ -1,6 +1,5 @@ package com.muyu.etl.service; -import com.muyu.common.core.domain.Result; import com.muyu.etl.domain.DictionaryData; import org.springframework.stereotype.Service; @@ -55,9 +54,4 @@ public interface DictionaryDataService { * @return 结果 */ public int deleteDictionaryDataById(Long id); - - Result getDictionaryList(Long dataSourceId); - - Result delDict(Long id); - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DictionaryService.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DictionaryService.java index 4488854..4ed38c6 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DictionaryService.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DictionaryService.java @@ -53,9 +53,7 @@ public interface DictionaryService { * @return 结果 */ public int deleteDictionaryById(Long id); - Result getDictionaryList(Long dataSourceId); Result delDict(Long id); - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/SourceAccreditService.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/SourceAccreditService.java index 21d2a49..58bca49 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/SourceAccreditService.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/SourceAccreditService.java @@ -14,8 +14,8 @@ import java.util.List; * @date 2024-04-25 */ @Service -public interface SourceAccreditService { - +public interface SourceAccreditService +{ /** * 查询【请填写功能名称】 * @@ -67,5 +67,4 @@ public interface SourceAccreditService { Result getSourceAccreditByDataSourceId(Long id); Result deleteSourceAccreditBySourceIds(SourceAccreditReq sourceAccreditReq); - } diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/AssetAccreditServiceImpl.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/AssetAccreditServiceImpl.java index 6508f6b..a9d86af 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/AssetAccreditServiceImpl.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/AssetAccreditServiceImpl.java @@ -16,12 +16,6 @@ import java.util.Date; import java.util.List; import java.util.Objects; -/** - * @ClassName AssetAccreditServiceImpl - * @Description 描述 - * @Author HaoRan.Zhang - * @Date 2024/4/28 15:11 - */ @Service public class AssetAccreditServiceImpl implements AssetAccreditService { @@ -42,7 +36,6 @@ public class AssetAccreditServiceImpl implements AssetAccreditService { @Override public Result insertAssetAccredit(AssetAccreditReq assetAccreditReq) { - // 根据资产ID删除资产授权信息 deleteAssetAccreditByAssetId(assetAccreditReq); List assetAccredits = new ArrayList<>(); @@ -116,7 +109,6 @@ public class AssetAccreditServiceImpl implements AssetAccreditService { return Result.success(accreditModel); } - @Override public Result deleteAssetAccreditByAssetId(AssetAccreditReq assetAccreditReq) { diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DataSourceServiceImpl.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DataSourceServiceImpl.java index 7794f36..f198596 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DataSourceServiceImpl.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DataSourceServiceImpl.java @@ -230,7 +230,7 @@ public class DataSourceServiceImpl implements DataSourceService{ case "varchar": case "char": case "text": - return "String"; + return "String"; case "datetime": return "Date"; case "blob": @@ -425,7 +425,7 @@ public class DataSourceServiceImpl implements DataSourceService{ //数据同步 @Override public Result synchronization(DataSource dataSource) { - List dataSources = dataSourceMapper.selectId(dataSource.getId()); // 根据数据源ID查询所有相关数据源 + List dataSources = dataSourceMapper.selectId(dataSource.getId()); // 根据数据源ID查询所有相关数据源-+ List longList = dataSources.stream().map(DataSource::getId).toList(); // 提取数据源ID列表 ArrayList l = new ArrayList<>(); for (Long aLong : longList) { diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DictionaryDataServiceImpl.java b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DictionaryDataServiceImpl.java index c38d4ba..bdd73e4 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DictionaryDataServiceImpl.java +++ b/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DictionaryDataServiceImpl.java @@ -1,14 +1,9 @@ package com.muyu.etl.service.impl; -import com.muyu.common.core.domain.Result; import com.muyu.common.core.utils.DateUtils; import com.muyu.common.security.utils.SecurityUtils; -import com.muyu.etl.domain.Dictionary; import com.muyu.etl.domain.DictionaryData; -import com.muyu.etl.mapper.AssetModelMapper; import com.muyu.etl.mapper.DictionaryDataMapper; -import com.muyu.etl.mapper.DictionaryMapper; -import com.muyu.etl.service.AssetModelService; import com.muyu.etl.service.DictionaryDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -17,16 +12,9 @@ import java.util.List; @Service public class DictionaryDataServiceImpl implements DictionaryDataService { - @Autowired private DictionaryDataMapper dictionaryDataMapper; - @Autowired - private DictionaryMapper dictionaryMapper; - - @Autowired - private AssetModelMapper assetModelMapper; - /** * 查询【请填写功能名称】 * @@ -102,66 +90,4 @@ public class DictionaryDataServiceImpl implements DictionaryDataService { { return dictionaryDataMapper.deleteDictionaryDataById(id); } - - /** - * 获取数据源对应的字典列表。 - * - * @param dataSourceId 数据源ID,用于查询与之相关的字典列表。 - * @return 返回字典列表的成功结果,其中包含了字典及其相关数据。 - */ - @Override - public Result getDictionaryList(Long dataSourceId) { - // 从字典mapper中查询指定数据源ID的字典列表 - List dictionaryList = dictionaryMapper.getDictionaryList(dataSourceId); - if (!dictionaryList.isEmpty()){ - // 将字典列表中每个字典的ID提取出来,形成一个新的ID列表 - List longs = dictionaryList.stream() - .map(Dictionary::getId).toList(); - // 根据提取出的ID列表,从字典数据mapper中查询相应的字典数据列表 - List dictionaryDataList = dictionaryDataMapper.getDictionaryDataList(longs); - // 为每个字典设置其对应的字典数据列表 - dictionaryList.stream() - .forEach(dictionary->{ - // 过滤出与当前字典ID匹配的字典数据,并为当前字典设置这个列表 - dictionaryDataList.stream().filter(dictionaryData -> dictionaryData.getDictionaryId().equals(dictionary.getId()) ).toList(); - dictionary.setDictionaryDataList(dictionaryDataList); - }); - } - // 返回成功结果,包含处理后的字典列表 - return Result.success(dictionaryList); - } - - @Override - public Result delDict(Long id) { - dictionaryDataMapper.deleteDictionaryDataBy(id); - dictionaryMapper.deleteDictionaryById(id); - assetModelMapper.updateAssetModelDiction(id); - return Result.success(); - } - /** - * 获取字典数据列表。 - * - * @param string 一个字符串列表,代表需要查询的字典项的标识符。 - * @return 返回一个结果对象,其中包含了查询到的字典数据列表。如果查询成功,则结果对象的状态为成功,并附带字典数据列表;如果查询失败,则结果对象的状态为失败,并可能包含错误信息。 - */ - public Result getDictionaryDataList(List string){ - // 通过字符串列表查询字典数据列表 - List dictionaryDataList = dictionaryMapper.getDictionaryDataList(string); - if (!dictionaryDataList.isEmpty()){ - // 将字典数据列表中的每个字典项的ID提取出来,形成一个新的ID列表 - List longs = dictionaryDataList.stream() - .map(Dictionary::getId).toList(); - // 根据ID列表查询相应的字典详细数据列表 - List dictionaryDataList1 = dictionaryDataMapper.getDictionaryDataList(longs); - // 为每个字典项设置其详细的字典数据列表 - dictionaryDataList.stream() - .forEach(dictionary -> { - dictionaryDataList1.stream().filter(dictionaryData -> dictionaryData.getDictionaryId() ==(dictionary.getId())).toList(); - dictionary.setDictionaryDataList(dictionaryDataList1); - }); - } - // 返回成功结果,包含处理后的字典数据列表 - return Result.success(dictionaryDataList); - } - } diff --git a/muyu-modules/muyu-etl/src/main/resources/mapper/AssetModelMapper.xml b/muyu-modules/muyu-etl/src/main/resources/mapper/AssetModelMapper.xml index a3a4cda..9ce072d 100644 --- a/muyu-modules/muyu-etl/src/main/resources/mapper/AssetModelMapper.xml +++ b/muyu-modules/muyu-etl/src/main/resources/mapper/AssetModelMapper.xml @@ -1,7 +1,7 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> @@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, update_time, remark, - + #{dataAssetId}, #{name}, @@ -91,47 +91,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{updateTime}, #{remark}, - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + INSERT INTO `asset_model_copy1` ( `data_asset_id`, `name`, `comment`, `is_primary_key`, `type`, `mapping_type`, @@ -181,9 +181,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - - update asset_model_copy1 set is_dict = '',dictionary_id = null where dictionary_id = #{id} - delete from asset_model_copy1 where id = #{id} diff --git a/muyu-modules/muyu-etl/src/main/resources/mapper/DataAssetMapper.xml b/muyu-modules/muyu-etl/src/main/resources/mapper/DataAssetMapper.xml index 3bf5caf..6a44279 100644 --- a/muyu-modules/muyu-etl/src/main/resources/mapper/DataAssetMapper.xml +++ b/muyu-modules/muyu-etl/src/main/resources/mapper/DataAssetMapper.xml @@ -37,22 +37,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - - - insert into data_asset diff --git a/muyu-modules/muyu-etl/src/main/resources/mapper/DataSourceMapper.xml b/muyu-modules/muyu-etl/src/main/resources/mapper/DataSourceMapper.xml index f7a643b..72f0dfc 100644 --- a/muyu-modules/muyu-etl/src/main/resources/mapper/DataSourceMapper.xml +++ b/muyu-modules/muyu-etl/src/main/resources/mapper/DataSourceMapper.xml @@ -1,7 +1,7 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> @@ -107,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" max_wait_time, connection_param, systemName, - + #{dataSourceName}, #{linkAddress}, @@ -126,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{maxWaitTime}, #{connectionParam}, #{systemName}, - + insert into data_asset @@ -214,8 +214,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from data_asset where data_source_id in - - #{item} - + + #{item} + diff --git a/muyu-modules/muyu-etl/src/main/resources/mapper/DictionaryDataMapper.xml b/muyu-modules/muyu-etl/src/main/resources/mapper/DictionaryDataMapper.xml index 783c004..becbee7 100644 --- a/muyu-modules/muyu-etl/src/main/resources/mapper/DictionaryDataMapper.xml +++ b/muyu-modules/muyu-etl/src/main/resources/mapper/DictionaryDataMapper.xml @@ -94,14 +94,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} - delete dictionarydata where dictionary_id in #{id} - delete from dictionarydata where dictionary_id = #{id} diff --git a/muyu-modules/muyu-etl/src/main/resources/mapper/DictionaryMapper.xml b/muyu-modules/muyu-etl/src/main/resources/mapper/DictionaryMapper.xml index 4fd8293..7c810a1 100644 --- a/muyu-modules/muyu-etl/src/main/resources/mapper/DictionaryMapper.xml +++ b/muyu-modules/muyu-etl/src/main/resources/mapper/DictionaryMapper.xml @@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and data_source_id = #{dataSourceId} + Group by id - - - and data_asset_id = #{dataAssetId} - and name like concat('%', #{name}, '%') - and comment = #{comment} - and is_primary_key = #{isPrimaryKey} - and type = #{type} - and mapping_type = #{mappingType} - and length = #{length} - and decimal_places = #{decimalPlaces} - and is_null = #{isNull} - and is_dict = #{isDict} - and default_value = #{defaultValue} - and dict_key = #{dictKey} - - - - - - - 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 deleted file mode 100644 index 203ec50..0000000 --- a/muyu-modules/muyu-etl/src/main/resources/mapper/system/DataAssetMapper.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - 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 diff --git a/muyu-modules/muyu-rule-engine/pom.xml b/muyu-modules/muyu-rule-engine/pom.xml new file mode 100644 index 0000000..c23a26a --- /dev/null +++ b/muyu-modules/muyu-rule-engine/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + + com.muyu + muyu-modules + 3.6.3 + + + muyu-rule-engine + + + 17 + 17 + UTF-8 + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + com.muyu + muyu-common-datasource + + + + + com.muyu + muyu-common-datascope + + + + + com.muyu + muyu-common-log + + + + + com.muyu + muyu-common-swagger + + + + + diff --git a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/MuYuEtlApplication.java b/muyu-modules/muyu-rule-engine/src/main/java/com/muyu/rule/engine/MuYuRuleEngineApplication.java similarity index 69% rename from muyu-modules/muyu-etl/src/main/java/com/muyu/etl/MuYuEtlApplication.java rename to muyu-modules/muyu-rule-engine/src/main/java/com/muyu/rule/engine/MuYuRuleEngineApplication.java index 69d0805..df531c7 100644 --- a/muyu-modules/muyu-etl/src/main/java/com/muyu/etl/MuYuEtlApplication.java +++ b/muyu-modules/muyu-rule-engine/src/main/java/com/muyu/rule/engine/MuYuRuleEngineApplication.java @@ -1,18 +1,22 @@ -package com.muyu.etl; +package com.muyu.rule.engine; 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; +/** + * 系统模块 + * + * @author muyu + */ @EnableCustomConfig @EnableCustomSwagger2 @EnableMyFeignClients @SpringBootApplication -public class MuYuEtlApplication { +public class MuYuRuleEngineApplication { public static void main (String[] args) { - SpringApplication.run(MuYuEtlApplication.class, args); + SpringApplication.run(MuYuRuleEngineApplication.class, args); } } diff --git a/muyu-modules/pom.xml b/muyu-modules/pom.xml index 931eb34..98b01f8 100644 --- a/muyu-modules/pom.xml +++ b/muyu-modules/pom.xml @@ -14,6 +14,7 @@ muyu-job muyu-file muyu-etl + muyu-rule-engine muyu-modules