From a63a4fb72bf194b4db108cc0911b0b2c0a710451 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 11 九月 2024 09:04:01 +0800 Subject: [PATCH] 指标数据集 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldSaveReqVO.java | 9 iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql | 5 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/entity/IndDataSetFieldEntity.java | 54 ++++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/IndDataSetFieldService.java | 26 ++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/admin/IndDataSetController.java | 76 ++++++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetPageReqVO.java | 22 ++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/category/controller/admin/IndItemCategoryController.java | 8 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/impl/IndDataSetFieldServiceImpl.java | 55 +++++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/package-info.java | 1 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/IndDataSetService.java | 25 ++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldRespVO.java | 9 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/dao/IndDataSetFieldDao.java | 25 ++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldPageReqVO.java | 22 ++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/admin/IndDataSetFieldController.java | 75 ++++++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/entity/IndDataSetEntity.java | 75 ++++++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/dao/IndDataSetDao.java | 25 ++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetSaveReqVO.java | 34 +++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/impl/IndDataSetServiceImpl.java | 56 +++++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetRespVO.java | 9 19 files changed, 605 insertions(+), 6 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql b/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql index c716368..dfc4e83 100644 --- a/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql +++ b/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( diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/category/controller/admin/IndItemCategoryController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/category/controller/admin/IndItemCategoryController.java index 6db3666..072dbcf 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/category/controller/admin/IndItemCategoryController.java +++ b/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)); } diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/admin/IndDataSetController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/admin/IndDataSetController.java new file mode 100644 index 0000000..aa769eb --- /dev/null +++ b/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)); + } +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/admin/IndDataSetFieldController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/admin/IndDataSetFieldController.java new file mode 100644 index 0000000..a4cd4ab --- /dev/null +++ b/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)); + } +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/package-info.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/controller/package-info.java new file mode 100644 index 0000000..2c86952 --- /dev/null +++ b/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; \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/dao/IndDataSetDao.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/dao/IndDataSetDao.java new file mode 100644 index 0000000..2b138f4 --- /dev/null +++ b/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)); + } +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/dao/IndDataSetFieldDao.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/dao/IndDataSetFieldDao.java new file mode 100644 index 0000000..6d14b25 --- /dev/null +++ b/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)); + } +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/entity/IndDataSetEntity.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/entity/IndDataSetEntity.java new file mode 100644 index 0000000..8d4c669 --- /dev/null +++ b/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; +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/entity/IndDataSetFieldEntity.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/entity/IndDataSetFieldEntity.java new file mode 100644 index 0000000..7d87b91 --- /dev/null +++ b/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; +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/IndDataSetFieldService.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/IndDataSetFieldService.java new file mode 100644 index 0000000..c57a331 --- /dev/null +++ b/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); +} diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/IndDataSetService.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/IndDataSetService.java new file mode 100644 index 0000000..abcf86d --- /dev/null +++ b/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); +} diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/impl/IndDataSetFieldServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/impl/IndDataSetFieldServiceImpl.java new file mode 100644 index 0000000..457327b --- /dev/null +++ b/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); + } +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/impl/IndDataSetServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/service/impl/IndDataSetServiceImpl.java new file mode 100644 index 0000000..25f46b7 --- /dev/null +++ b/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); + } +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldPageReqVO.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldPageReqVO.java new file mode 100644 index 0000000..1c5fc5c --- /dev/null +++ b/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; +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldRespVO.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldRespVO.java new file mode 100644 index 0000000..de6ff32 --- /dev/null +++ b/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 { +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldSaveReqVO.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetFieldSaveReqVO.java new file mode 100644 index 0000000..5e40317 --- /dev/null +++ b/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 { +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetPageReqVO.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetPageReqVO.java new file mode 100644 index 0000000..666c9fe --- /dev/null +++ b/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; +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetRespVO.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetRespVO.java new file mode 100644 index 0000000..4704dc7 --- /dev/null +++ b/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 { +} \ No newline at end of file diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetSaveReqVO.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/data/vo/IndDataSetSaveReqVO.java new file mode 100644 index 0000000..6872bda --- /dev/null +++ b/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; +} \ No newline at end of file -- Gitblit v1.9.3