From 3dcb49402c3e893ee804d8772f6d50e27499d83b Mon Sep 17 00:00:00 2001 From: litao Date: Tue, 14 Feb 2023 09:07:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=90=E7=BB=B4=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DataBaseController.java | 16 +++ .../operation/database/entity/DataBase.java | 15 --- .../operation/database/entity/DataTable.java | 30 +++++ .../controller/ModuleInfoController.java | 113 ++++++++++++++++++ .../controller/ProjectInfoController.java | 103 ++++++++++++++++ .../operation/system/entity/ModuleInfo.java | 17 +++ .../operation/system/entity/ProjectInfo.java | 9 -- .../system/mapper/ModuleInfoMapper.java | 14 +++ .../system/mapper/ProjectInfoMapper.java | 15 +++ .../system/service/IModuleInfoService.java | 15 +++ .../system/service/IProjectInfoService.java | 15 +++ .../service/impl/ModuleInfoServiceImpl.java | 21 ++++ .../service/impl/ProjectInfoServiceImpl.java | 21 ++++ .../task/controller/TaskInfoController.java | 106 ++++++++++++++++ .../operation/task/mapper/TaskInfoMapper.java | 15 +++ .../operation/task/mapper/TaskInfoMapper.xml | 5 + .../task/service/ITaskInfoService.java | 15 +++ .../service/impl/TaskInfoServiceImpl.java | 21 ++++ 18 files changed, 542 insertions(+), 24 deletions(-) create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/entity/DataTable.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/controller/ModuleInfoController.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/controller/ProjectInfoController.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/mapper/ModuleInfoMapper.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/mapper/ProjectInfoMapper.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/IModuleInfoService.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/IProjectInfoService.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/impl/ModuleInfoServiceImpl.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/impl/ProjectInfoServiceImpl.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/controller/TaskInfoController.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/mapper/TaskInfoMapper.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/mapper/TaskInfoMapper.xml create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/service/ITaskInfoService.java create mode 100644 lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/service/impl/TaskInfoServiceImpl.java diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/controller/DataBaseController.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/controller/DataBaseController.java index d0b9b79..1bfa06e 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/controller/DataBaseController.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/controller/DataBaseController.java @@ -13,6 +13,8 @@ import org.springblade.core.cache.utils.CacheUtil; import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tenant.annotation.NonDS; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; @@ -130,7 +132,21 @@ public class DataBaseController extends BladeController { */ @GetMapping("exportTemplate") public void exportUser(HttpServletResponse response) { + BladeUser user = AuthUtil.getUser(); List excels = new ArrayList<>(); + DatabaseExcel excel = new DatabaseExcel(); + excel.setDataBaseIp("127.0.0.1"); + excel.setDataBasePort("1000"); + excel.setDataBaseName("work_order"); + excel.setDataBaseType("mysql"); + excel.setDataBaseAlias("工单数据库"); + excel.setSystemName("工单系统"); + excel.setSystemModuleName("数据运维"); + excel.setDeptId("数据科"); + excel.setCompany("A公司"); + excel.setDataTableName("t_task_info"); + excel.setDataTableAlias("任务种类"); + excels.add(excel); ExcelUtil.export(response, "数据库数据" + DateUtil.time(), "数据库数据", excels, DatabaseExcel.class); } } diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/entity/DataBase.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/entity/DataBase.java index d72e7d6..30b063e 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/entity/DataBase.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/entity/DataBase.java @@ -47,21 +47,6 @@ public class DataBase extends TenantEntity { */ private String systemName; - /** - * 模块名称 - */ - private String systemModuleName; - - /** - * 表名称 - */ - private String dataTableName; - - /** - * 中文别名 - */ - private String dataTableAlias; - /** * 管理部门id */ diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/entity/DataTable.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/entity/DataTable.java new file mode 100644 index 0000000..b06b646 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/database/entity/DataTable.java @@ -0,0 +1,30 @@ +package org.springblade.plugin.operation.database.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +@Data +@TableName("t_data_table") +@EqualsAndHashCode(callSuper = true) +public class DataTable extends TenantEntity { + + private static final long serialVersionUID = 1L; + + /** + * 模块名称 + */ + private String systemModuleName; + + /** + * 表名称 + */ + private String dataTableName; + + /** + * 中文别名 + */ + private String dataTableAlias; + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/controller/ModuleInfoController.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/controller/ModuleInfoController.java new file mode 100644 index 0000000..8058f3f --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/controller/ModuleInfoController.java @@ -0,0 +1,113 @@ + +package org.springblade.plugin.operation.system.controller; + +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.cache.utils.CacheUtil; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tenant.annotation.NonDS; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springblade.plugin.operation.system.entity.ModuleInfo; +import org.springblade.plugin.operation.system.service.IModuleInfoService; +import org.springblade.plugin.operation.system.service.IProjectInfoService; +import org.springblade.plugin.operation.task.entity.TaskInfo; +import org.springblade.plugin.operation.task.service.ITaskInfoService; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +import java.util.List; + +import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; + +/** + * + * + */ +@NonDS +@RestController +@AllArgsConstructor +@RequestMapping("/moduleInfo") +@Api(value = "接口权限", tags = "接口权限") +public class ModuleInfoController extends BladeController { + + private final IModuleInfoService moduleInfoService; + + private final IProjectInfoService projectInfoService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入dataScope") + public R detail(ModuleInfo moduleInfo) { + ModuleInfo detail = moduleInfoService.getOne(Condition.getQueryWrapper(moduleInfo)); + return R.data(detail); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入dataScope") + public R> list(ModuleInfo moduleInfo, Query query) { + IPage pages = moduleInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(moduleInfo)); + List infoList = pages.getRecords(); + if (CollectionUtils.isNotEmpty(infoList)) { + infoList.forEach(item-> item.setProjectName(projectInfoService.getById(item.getProjectInfoId()).getProjectName())); + } + return R.data(pages); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "新增", notes = "传入dataScope") + public R save(@Valid @RequestBody ModuleInfo moduleInfo) { + return R.status(moduleInfoService.save(moduleInfo)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "修改", notes = "传入dataScope") + public R update(@Valid @RequestBody ModuleInfo moduleInfo) { + return R.status(moduleInfoService.updateById(moduleInfo)); + } + + /** + * 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "新增或修改", notes = "传入dataScope") + public R submit(@Valid @RequestBody ModuleInfo moduleInfo) { + return R.status(moduleInfoService.saveOrUpdate(moduleInfo)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(moduleInfoService.deleteLogic(Func.toLongList(ids))); + } + + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/controller/ProjectInfoController.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/controller/ProjectInfoController.java new file mode 100644 index 0000000..7166a8d --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/controller/ProjectInfoController.java @@ -0,0 +1,103 @@ + +package org.springblade.plugin.operation.system.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.cache.utils.CacheUtil; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tenant.annotation.NonDS; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springblade.plugin.operation.system.entity.ProjectInfo; +import org.springblade.plugin.operation.system.service.IProjectInfoService; +import org.springblade.plugin.operation.task.entity.TaskInfo; +import org.springblade.plugin.operation.task.service.ITaskInfoService; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; + +/** + * + * + */ +@NonDS +@RestController +@AllArgsConstructor +@RequestMapping("/projectInfo") +@Api(value = "接口权限", tags = "接口权限") +public class ProjectInfoController extends BladeController { + + private final IProjectInfoService projectInfoService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入dataScope") + public R detail(ProjectInfo projectInfo) { + ProjectInfo detail = projectInfoService.getOne(Condition.getQueryWrapper(projectInfo)); + return R.data(detail); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入dataScope") + public R> list(ProjectInfo projectInfo, Query query) { + IPage pages = projectInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(projectInfo)); + return R.data(pages); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "新增", notes = "传入dataScope") + public R save(@Valid @RequestBody ProjectInfo projectInfo) { + return R.status(projectInfoService.save(projectInfo)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "修改", notes = "传入dataScope") + public R update(@Valid @RequestBody ProjectInfo projectInfo) { + return R.status(projectInfoService.updateById(projectInfo)); + } + + /** + * 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "新增或修改", notes = "传入dataScope") + public R submit(@Valid @RequestBody ProjectInfo projectInfo) { + return R.status(projectInfoService.saveOrUpdate(projectInfo)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(projectInfoService.deleteLogic(Func.toLongList(ids))); + } + + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/entity/ModuleInfo.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/entity/ModuleInfo.java index b01cf16..a4d1b22 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/entity/ModuleInfo.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/entity/ModuleInfo.java @@ -1,5 +1,6 @@ package org.springblade.plugin.operation.system.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -22,4 +23,20 @@ public class ModuleInfo extends TenantEntity { */ private String moduleName; + /** + * 管理部门id + */ + private Long manageDeptId; + + /** + * 运维部门id + */ + private Long maintenanceDeptId; + + /** + * 系统名称 + */ + @TableField(exist = false) + private String projectName; + } diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/entity/ProjectInfo.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/entity/ProjectInfo.java index 79a60a8..774ebc5 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/entity/ProjectInfo.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/entity/ProjectInfo.java @@ -17,13 +17,4 @@ public class ProjectInfo extends TenantEntity { */ private String projectName; - /** - * 管理部门id - */ - private Long manageDeptId; - - /** - * 运维部门id - */ - private Long maintenanceDeptId; } diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/mapper/ModuleInfoMapper.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/mapper/ModuleInfoMapper.java new file mode 100644 index 0000000..96d9011 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/mapper/ModuleInfoMapper.java @@ -0,0 +1,14 @@ + +package org.springblade.plugin.operation.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.plugin.operation.system.entity.ModuleInfo; + +/** + * Mapper 接口 + * + * @author BladeX + */ +public interface ModuleInfoMapper extends BaseMapper { + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/mapper/ProjectInfoMapper.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/mapper/ProjectInfoMapper.java new file mode 100644 index 0000000..07532b0 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/mapper/ProjectInfoMapper.java @@ -0,0 +1,15 @@ + +package org.springblade.plugin.operation.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.plugin.operation.system.entity.ProjectInfo; +import org.springblade.plugin.operation.task.entity.TaskInfo; + +/** + * Mapper 接口 + * + * @author BladeX + */ +public interface ProjectInfoMapper extends BaseMapper { + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/IModuleInfoService.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/IModuleInfoService.java new file mode 100644 index 0000000..3a350d9 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/IModuleInfoService.java @@ -0,0 +1,15 @@ + +package org.springblade.plugin.operation.system.service; + +import org.springblade.core.mp.base.BaseService; +import org.springblade.plugin.operation.system.entity.ModuleInfo; +import org.springblade.plugin.operation.task.entity.TaskInfo; + +/** + * 服务类 + * + * @author BladeX + */ +public interface IModuleInfoService extends BaseService { + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/IProjectInfoService.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/IProjectInfoService.java new file mode 100644 index 0000000..f785c32 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/IProjectInfoService.java @@ -0,0 +1,15 @@ + +package org.springblade.plugin.operation.system.service; + +import org.springblade.core.mp.base.BaseService; +import org.springblade.plugin.operation.system.entity.ProjectInfo; +import org.springblade.plugin.operation.task.entity.TaskInfo; + +/** + * 服务类 + * + * @author BladeX + */ +public interface IProjectInfoService extends BaseService { + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/impl/ModuleInfoServiceImpl.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/impl/ModuleInfoServiceImpl.java new file mode 100644 index 0000000..ed21569 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/impl/ModuleInfoServiceImpl.java @@ -0,0 +1,21 @@ + +package org.springblade.plugin.operation.system.service.impl; + +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.plugin.operation.system.entity.ModuleInfo; +import org.springblade.plugin.operation.system.mapper.ModuleInfoMapper; +import org.springblade.plugin.operation.system.service.IModuleInfoService; +import org.springblade.plugin.operation.task.entity.TaskInfo; +import org.springblade.plugin.operation.task.mapper.TaskInfoMapper; +import org.springblade.plugin.operation.task.service.ITaskInfoService; +import org.springframework.stereotype.Service; + +/** + * 服务实现类 + * + * @author BladeX + */ +@Service +public class ModuleInfoServiceImpl extends BaseServiceImpl implements IModuleInfoService { + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/impl/ProjectInfoServiceImpl.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/impl/ProjectInfoServiceImpl.java new file mode 100644 index 0000000..bc371ea --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/system/service/impl/ProjectInfoServiceImpl.java @@ -0,0 +1,21 @@ + +package org.springblade.plugin.operation.system.service.impl; + +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.plugin.operation.system.entity.ProjectInfo; +import org.springblade.plugin.operation.system.mapper.ProjectInfoMapper; +import org.springblade.plugin.operation.system.service.IProjectInfoService; +import org.springblade.plugin.operation.task.entity.TaskInfo; +import org.springblade.plugin.operation.task.mapper.TaskInfoMapper; +import org.springblade.plugin.operation.task.service.ITaskInfoService; +import org.springframework.stereotype.Service; + +/** + * 服务实现类 + * + * @author BladeX + */ +@Service +public class ProjectInfoServiceImpl extends BaseServiceImpl implements IProjectInfoService { + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/controller/TaskInfoController.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/controller/TaskInfoController.java new file mode 100644 index 0000000..8e126b0 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/controller/TaskInfoController.java @@ -0,0 +1,106 @@ + +package org.springblade.plugin.operation.task.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.cache.utils.CacheUtil; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tenant.annotation.NonDS; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springblade.plugin.operation.database.entity.DataBase; +import org.springblade.plugin.operation.database.service.IDataBaseService; +import org.springblade.plugin.operation.task.entity.TaskInfo; +import org.springblade.plugin.operation.task.service.ITaskInfoService; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; + +/** + * + * + */ +@NonDS +@RestController +@AllArgsConstructor +@RequestMapping("/taskInfo") +@Api(value = "接口权限", tags = "接口权限") +public class TaskInfoController extends BladeController { + + private final ITaskInfoService taskInfoService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入dataScope") + public R detail(TaskInfo taskInfo) { + BladeUser user = AuthUtil.getUser(); + TaskInfo detail = taskInfoService.getOne(Condition.getQueryWrapper(taskInfo)); + return R.data(detail); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入dataScope") + public R> list(TaskInfo taskInfo, Query query) { + IPage pages = taskInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(taskInfo)); + return R.data(pages); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "新增", notes = "传入dataScope") + public R save(@Valid @RequestBody TaskInfo taskInfo) { + return R.status(taskInfoService.save(taskInfo)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "修改", notes = "传入dataScope") + public R update(@Valid @RequestBody TaskInfo taskInfo) { + return R.status(taskInfoService.updateById(taskInfo)); + } + + /** + * 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "新增或修改", notes = "传入dataScope") + public R submit(@Valid @RequestBody TaskInfo taskInfo) { + return R.status(taskInfoService.saveOrUpdate(taskInfo)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(taskInfoService.deleteLogic(Func.toLongList(ids))); + } + + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/mapper/TaskInfoMapper.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/mapper/TaskInfoMapper.java new file mode 100644 index 0000000..bbc1588 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/mapper/TaskInfoMapper.java @@ -0,0 +1,15 @@ + +package org.springblade.plugin.operation.task.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.plugin.operation.database.entity.DataBase; +import org.springblade.plugin.operation.task.entity.TaskInfo; + +/** + * Mapper 接口 + * + * @author BladeX + */ +public interface TaskInfoMapper extends BaseMapper { + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/mapper/TaskInfoMapper.xml b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/mapper/TaskInfoMapper.xml new file mode 100644 index 0000000..2956558 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/mapper/TaskInfoMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/service/ITaskInfoService.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/service/ITaskInfoService.java new file mode 100644 index 0000000..678f242 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/service/ITaskInfoService.java @@ -0,0 +1,15 @@ + +package org.springblade.plugin.operation.task.service; + +import org.springblade.core.mp.base.BaseService; +import org.springblade.plugin.operation.database.entity.DataBase; +import org.springblade.plugin.operation.task.entity.TaskInfo; + +/** + * 服务类 + * + * @author BladeX + */ +public interface ITaskInfoService extends BaseService { + +} diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/service/impl/TaskInfoServiceImpl.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/service/impl/TaskInfoServiceImpl.java new file mode 100644 index 0000000..4e54515 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/operation/task/service/impl/TaskInfoServiceImpl.java @@ -0,0 +1,21 @@ + +package org.springblade.plugin.operation.task.service.impl; + +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.plugin.operation.database.entity.DataBase; +import org.springblade.plugin.operation.database.mapper.DataBaseMapper; +import org.springblade.plugin.operation.database.service.IDataBaseService; +import org.springblade.plugin.operation.task.entity.TaskInfo; +import org.springblade.plugin.operation.task.mapper.TaskInfoMapper; +import org.springblade.plugin.operation.task.service.ITaskInfoService; +import org.springframework.stereotype.Service; + +/** + * 服务实现类 + * + * @author BladeX + */ +@Service +public class TaskInfoServiceImpl extends BaseServiceImpl implements ITaskInfoService { + +}