iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
@@ -260,7 +260,8 @@ `field_name` VARCHAR(30) COMMENT '中文名' , `field_type` VARCHAR(30) COMMENT '数据类型' , `sort` int COMMENT '排序', PRIMARY KEY (id) USING BTREE PRIMARY KEY (id) USING BTREE, INDEX `idx_data_set_id` (`data_set_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '指标数据集字段'; CREATE TABLE t_ind_item_category( @@ -291,7 +292,7 @@ `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (id) USING BTREE, UNIQUE KEY `uk_item_no` (`item_no`) USING BTREE UNIQUE INDEX `uk_item_no` (`item_no`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '指标项表'; CREATE TABLE t_ind_item_atom( iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/category/controller/admin/IndItemCategoryController.java
@@ -47,7 +47,7 @@ @PostMapping("/create") @Operation(summary = "创建指标分类") @PreAuthorize("@ss.hasPermission('data:ind-item-category:create')") public CommonResult<Boolean> createMenu(@Valid @RequestBody IndItemCategorySaveReqVO createReqVO) { public CommonResult<Boolean> create(@Valid @RequestBody IndItemCategorySaveReqVO createReqVO) { indItemCategoryService.create(createReqVO); return success(true); } @@ -55,7 +55,7 @@ @PutMapping("/update") @Operation(summary = "修改指标分类") @PreAuthorize("@ss.hasPermission('data:ind-item-category:update')") public CommonResult<Boolean> updateMenu(@Valid @RequestBody IndItemCategorySaveReqVO updateReqVO) { public CommonResult<Boolean> update(@Valid @RequestBody IndItemCategorySaveReqVO updateReqVO) { indItemCategoryService.update(updateReqVO); return success(true); } @@ -64,7 +64,7 @@ @Operation(summary = "删除指标分类") @Parameter(name = "id", description = "指标分类编号", required= true, example = "1024") @PreAuthorize("@ss.hasPermission('data:ind-item-category:delete')") public CommonResult<Boolean> deleteMenu(@RequestParam("id") String id) { public CommonResult<Boolean> delete(@RequestParam("id") String id) { indItemCategoryService.delete(id); return success(true); } @@ -72,7 +72,7 @@ @GetMapping("/get") @Operation(summary = "获取指标分类信息") @PreAuthorize("@ss.hasPermission('system:ind-item-category:query')") public CommonResult<IndItemCategoryRespVO> getMenu(String id) { public CommonResult<IndItemCategoryRespVO> get(String id) { IndItemCategoryEntity entity = indItemCategoryService.get(id); return success(BeanUtils.toBean(entity, IndItemCategoryRespVO.class)); } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/admin/IndDataSetController.java
对比新文件 @@ -0,0 +1,76 @@ package com.iailab.module.data.ind.data.controller.admin; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.data.ind.data.entity.IndDataSetEntity; import com.iailab.module.data.ind.data.service.IndDataSetService; import com.iailab.module.data.ind.data.vo.IndDataSetPageReqVO; import com.iailab.module.data.ind.data.vo.IndDataSetRespVO; import com.iailab.module.data.ind.data.vo.IndDataSetSaveReqVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import static com.iailab.framework.common.pojo.CommonResult.success; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @Tag(name = "数据平台 - 指标数据集") @RestController @RequestMapping("/data/ind-data-set") @Validated public class IndDataSetController { @Autowired private IndDataSetService indDataSetService; @GetMapping("/page") @Operation(summary = "获取指标分类列表", description = "用于【指标分类】界面") @PreAuthorize("@ss.hasPermission('data:ind-data-set:query')") public CommonResult<PageResult<IndDataSetRespVO>> page(IndDataSetPageReqVO reqVO) { PageResult<IndDataSetEntity> page = indDataSetService.page(reqVO); return success(BeanUtils.toBean(page, IndDataSetRespVO.class)); } @PostMapping("/create") @Operation(summary = "创建指标分类") @PreAuthorize("@ss.hasPermission('data:ind-data-set:create')") public CommonResult<Boolean> create(@Valid @RequestBody IndDataSetSaveReqVO createReqVO) { indDataSetService.create(createReqVO); return success(true); } @PutMapping("/update") @Operation(summary = "修改指标分类") @PreAuthorize("@ss.hasPermission('data:ind-data-set:update')") public CommonResult<Boolean> update(@Valid @RequestBody IndDataSetSaveReqVO updateReqVO) { indDataSetService.update(updateReqVO); return success(true); } @DeleteMapping("/delete") @Operation(summary = "删除指标分类") @Parameter(name = "id", description = "指标分类编号", required= true, example = "1024") @PreAuthorize("@ss.hasPermission('data:ind-data-set:delete')") public CommonResult<Boolean> delete(@RequestParam("id") String id) { indDataSetService.delete(id); return success(true); } @GetMapping("/get") @Operation(summary = "获取指标分类信息") @PreAuthorize("@ss.hasPermission('system:ind-data-set:query')") public CommonResult<IndDataSetRespVO> get(String id) { IndDataSetEntity entity = indDataSetService.get(id); return success(BeanUtils.toBean(entity, IndDataSetRespVO.class)); } } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/admin/IndDataSetFieldController.java
对比新文件 @@ -0,0 +1,75 @@ package com.iailab.module.data.ind.data.controller.admin; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.data.ind.data.entity.IndDataSetFieldEntity; import com.iailab.module.data.ind.data.service.IndDataSetFieldService; import com.iailab.module.data.ind.data.vo.*; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import static com.iailab.framework.common.pojo.CommonResult.success; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @Tag(name = "数据平台 - 指标数据集字段") @RestController @RequestMapping("/data/ind-data-set-field") @Validated public class IndDataSetFieldController { @Autowired private IndDataSetFieldService indDataSetFieldService; @GetMapping("/page") @Operation(summary = "获取指标分类列表", description = "用于【指标分类】界面") @PreAuthorize("@ss.hasPermission('data:ind-data-set:query')") public CommonResult<PageResult<IndDataSetRespVO>> page(IndDataSetFieldPageReqVO reqVO) { PageResult<IndDataSetFieldEntity> page = indDataSetFieldService.page(reqVO); return success(BeanUtils.toBean(page, IndDataSetRespVO.class)); } @PostMapping("/create") @Operation(summary = "创建指标分类") @PreAuthorize("@ss.hasPermission('data:ind-data-set:create')") public CommonResult<Boolean> create(@Valid @RequestBody IndDataSetFieldSaveReqVO createReqVO) { indDataSetFieldService.create(createReqVO); return success(true); } @PutMapping("/update") @Operation(summary = "修改指标分类") @PreAuthorize("@ss.hasPermission('data:ind-data-set:update')") public CommonResult<Boolean> update(@Valid @RequestBody IndDataSetFieldSaveReqVO updateReqVO) { indDataSetFieldService.update(updateReqVO); return success(true); } @DeleteMapping("/delete") @Operation(summary = "删除指标分类") @Parameter(name = "id", description = "指标分类编号", required= true, example = "1024") @PreAuthorize("@ss.hasPermission('data:ind-data-set:delete')") public CommonResult<Boolean> delete(@RequestParam("id") String id) { indDataSetFieldService.delete(id); return success(true); } @GetMapping("/get") @Operation(summary = "获取指标分类信息") @PreAuthorize("@ss.hasPermission('system:ind-data-set:query')") public CommonResult<IndDataSetRespVO> get(String id) { IndDataSetFieldEntity entity = indDataSetFieldService.get(id); return success(BeanUtils.toBean(entity, IndDataSetRespVO.class)); } } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/package-info.java
对比新文件 @@ -0,0 +1 @@ package com.iailab.module.data.ind.data.controller; iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/dao/IndDataSetDao.java
对比新文件 @@ -0,0 +1,25 @@ package com.iailab.module.data.ind.data.dao; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.framework.tenant.core.db.dynamic.TenantDS; import com.iailab.module.data.ind.data.entity.IndDataSetEntity; import com.iailab.module.data.ind.data.vo.IndDataSetPageReqVO; import org.apache.ibatis.annotations.Mapper; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @TenantDS @Mapper public interface IndDataSetDao extends BaseMapperX<IndDataSetEntity> { default PageResult<IndDataSetEntity> selectPage(IndDataSetPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX<IndDataSetEntity>() .likeIfPresent(IndDataSetEntity::getName, reqVO.getName()) .orderByDesc(IndDataSetEntity::getCreateTime)); } } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/dao/IndDataSetFieldDao.java
对比新文件 @@ -0,0 +1,25 @@ package com.iailab.module.data.ind.data.dao; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.framework.tenant.core.db.dynamic.TenantDS; import com.iailab.module.data.ind.data.entity.IndDataSetFieldEntity; import com.iailab.module.data.ind.data.vo.IndDataSetFieldPageReqVO; import org.apache.ibatis.annotations.Mapper; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @TenantDS @Mapper public interface IndDataSetFieldDao extends BaseMapperX<IndDataSetFieldEntity> { default PageResult<IndDataSetFieldEntity> selectPage(IndDataSetFieldPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX<IndDataSetFieldEntity>() .eq(IndDataSetFieldEntity::getDataSetId, reqVO.getDataSetId()) .orderByDesc(IndDataSetFieldEntity::getSort)); } } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/entity/IndDataSetEntity.java
对比新文件 @@ -0,0 +1,75 @@ package com.iailab.module.data.ind.data.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * 指标数据集 * * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @Data @TableName("t_ind_data_set") public class IndDataSetEntity implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @Schema(description = "主键") @TableId(value = "id",type = IdType.INPUT) private String id; /** * 名称 */ private String name; /** * 数据源 */ private String dataSource; /** * 查询语句 */ private String querySql; /** * 备注 */ private String remark; /** * 排序 */ private Integer sort; /** * 创建者 */ private String creator; /** * 创建时间 */ private Date createTime; /** * 更新者 */ private String updater; /** * 更新时间 */ private Date updateTime; } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/entity/IndDataSetFieldEntity.java
对比新文件 @@ -0,0 +1,54 @@ package com.iailab.module.data.ind.data.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serializable; /** * 指标数据集字段 * * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @Data @TableName("t_ind_data_set_field") public class IndDataSetFieldEntity implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @Schema(description = "主键") @TableId(value = "id",type = IdType.INPUT) private String id; /** * 数据集ID */ private String dataSetId; /** * 英文名 */ private String fieldCode; /** * 中文名 */ private String fieldName; /** * 数据类型 */ private String fieldType; /** * 排序 */ private Integer sort; } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/IndDataSetFieldService.java
对比新文件 @@ -0,0 +1,26 @@ package com.iailab.module.data.ind.data.service; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.BaseService; import com.iailab.module.data.ind.data.entity.IndDataSetFieldEntity; import com.iailab.module.data.ind.data.vo.IndDataSetFieldPageReqVO; import com.iailab.module.data.ind.data.vo.IndDataSetFieldSaveReqVO; import com.iailab.module.data.ind.data.vo.IndDataSetPageReqVO; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ public interface IndDataSetFieldService extends BaseService<IndDataSetFieldEntity> { PageResult<IndDataSetFieldEntity> page(IndDataSetFieldPageReqVO reqVO); void create(IndDataSetFieldSaveReqVO reqVO); void update(IndDataSetFieldSaveReqVO reqVO); IndDataSetFieldEntity get(String id); void delete(String id); } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/IndDataSetService.java
对比新文件 @@ -0,0 +1,25 @@ package com.iailab.module.data.ind.data.service; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.BaseService; import com.iailab.module.data.ind.data.entity.IndDataSetEntity; import com.iailab.module.data.ind.data.vo.IndDataSetPageReqVO; import com.iailab.module.data.ind.data.vo.IndDataSetSaveReqVO; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ public interface IndDataSetService extends BaseService<IndDataSetEntity> { PageResult<IndDataSetEntity> page(IndDataSetPageReqVO reqVO); void create(IndDataSetSaveReqVO reqVO); void update(IndDataSetSaveReqVO reqVO); IndDataSetEntity get(String id); void delete(String id); } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/impl/IndDataSetFieldServiceImpl.java
对比新文件 @@ -0,0 +1,55 @@ package com.iailab.module.data.ind.data.service.impl; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.data.ind.data.dao.IndDataSetFieldDao; import com.iailab.module.data.ind.data.entity.IndDataSetFieldEntity; import com.iailab.module.data.ind.data.entity.IndDataSetFieldEntity; import com.iailab.module.data.ind.data.service.IndDataSetFieldService; import com.iailab.module.data.ind.data.vo.IndDataSetFieldPageReqVO; import com.iailab.module.data.ind.data.vo.IndDataSetFieldSaveReqVO; import com.iailab.module.data.ind.data.vo.IndDataSetPageReqVO; import com.iailab.module.data.ind.data.vo.IndDataSetSaveReqVO; import org.springframework.stereotype.Service; import java.util.Date; import java.util.UUID; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @Service public class IndDataSetFieldServiceImpl extends BaseServiceImpl<IndDataSetFieldDao, IndDataSetFieldEntity> implements IndDataSetFieldService { @Override public PageResult<IndDataSetFieldEntity> page(IndDataSetFieldPageReqVO reqVO) { return baseDao.selectPage(reqVO); } @Override public void create(IndDataSetFieldSaveReqVO createReqVO) { IndDataSetFieldEntity entity = BeanUtils.toBean(createReqVO, IndDataSetFieldEntity.class); entity.setId(UUID.randomUUID().toString()); baseDao.insert(entity); } @Override public void update(IndDataSetFieldSaveReqVO updateReqVO) { IndDataSetFieldEntity entity = BeanUtils.toBean(updateReqVO, IndDataSetFieldEntity.class); baseDao.updateById(entity); } @Override public IndDataSetFieldEntity get(String id) { return baseDao.selectById(id); } @Override public void delete(String id) { baseDao.deleteById(id); } } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/impl/IndDataSetServiceImpl.java
对比新文件 @@ -0,0 +1,56 @@ package com.iailab.module.data.ind.data.service.impl; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.data.ind.category.entity.IndItemCategoryEntity; import com.iailab.module.data.ind.data.dao.IndDataSetDao; import com.iailab.module.data.ind.data.entity.IndDataSetEntity; import com.iailab.module.data.ind.data.service.IndDataSetService; import com.iailab.module.data.ind.data.vo.IndDataSetPageReqVO; import com.iailab.module.data.ind.data.vo.IndDataSetSaveReqVO; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.UUID; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @Service public class IndDataSetServiceImpl extends BaseServiceImpl<IndDataSetDao, IndDataSetEntity> implements IndDataSetService { @Override public PageResult<IndDataSetEntity> page(IndDataSetPageReqVO reqVO) { return baseDao.selectPage(reqVO); } @Override public void create(IndDataSetSaveReqVO createReqVO) { IndDataSetEntity entity = BeanUtils.toBean(createReqVO, IndDataSetEntity.class); entity.setId(UUID.randomUUID().toString()); entity.setCreateTime(new Date()); baseDao.insert(entity); } @Override public void update(IndDataSetSaveReqVO updateReqVO) { IndDataSetEntity entity = BeanUtils.toBean(updateReqVO, IndDataSetEntity.class); entity.setUpdateTime(new Date()); baseDao.updateById(entity); } @Override public IndDataSetEntity get(String id) { return baseDao.selectById(id); } @Override public void delete(String id) { baseDao.deleteById(id); } } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldPageReqVO.java
对比新文件 @@ -0,0 +1,22 @@ package com.iailab.module.data.ind.data.vo; import com.iailab.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @Schema(description = "数据平台 - 指标数据集字段分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class IndDataSetFieldPageReqVO extends PageParam { @Schema(description = "数据集ID", example = "") private String dataSetId; } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldRespVO.java
对比新文件 @@ -0,0 +1,9 @@ package com.iailab.module.data.ind.data.vo; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ public class IndDataSetFieldRespVO { } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldSaveReqVO.java
对比新文件 @@ -0,0 +1,9 @@ package com.iailab.module.data.ind.data.vo; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ public class IndDataSetFieldSaveReqVO { } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetPageReqVO.java
对比新文件 @@ -0,0 +1,22 @@ package com.iailab.module.data.ind.data.vo; import com.iailab.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @Schema(description = "模型服务 - 调度模型分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class IndDataSetPageReqVO extends PageParam { @Schema(description = "名称,模糊匹配", example = "") private String name; } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetRespVO.java
对比新文件 @@ -0,0 +1,9 @@ package com.iailab.module.data.ind.data.vo; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ public class IndDataSetRespVO { } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetSaveReqVO.java
对比新文件 @@ -0,0 +1,34 @@ package com.iailab.module.data.ind.data.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; /** * @author PanZhibao * @Description * @createTime 2024年09月10日 */ @Schema(description = "数据平台 - 数据集创建/修改 Request VO") @Data public class IndDataSetSaveReqVO { @Schema(description = "ID") private String id; @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "名称不能为空") private String name; @Schema(description = "数据源", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "数据源不能为空") private String dataSource; @Schema(description = "查询语句", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "查询语句不能为空") private String querySql; @Schema(description = "备注") private String remark; }