From 6533b1914de3b1412318f9ca0f36266bac59031a Mon Sep 17 00:00:00 2001 From: lcr <977192391@qq.com> Date: Mon, 17 Jun 2024 18:12:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B5=84=E6=BA=90=E5=BA=93?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResourceLibraryController.java | 110 ++++++++++++++++++ .../business/domain/ResourceLibrary.java | 87 ++++++++++++++ .../mapper/ResourceLibraryMapper.java | 24 ++++ .../service/IResourceLibraryService.java | 24 ++++ .../service/impl/ApplyPlanServiceImpl.java | 26 +++-- .../impl/ResourceLibraryServiceImpl.java | 34 ++++++ .../resources/mapper/business/ApplyMapper.xml | 2 +- .../mapper/business/ResourceLibraryMapper.xml | 65 +++++++++++ 8 files changed, 359 insertions(+), 13 deletions(-) create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/controller/ResourceLibraryController.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/domain/ResourceLibrary.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/mapper/ResourceLibraryMapper.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/service/IResourceLibraryService.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ResourceLibraryServiceImpl.java create mode 100644 ruoyi-business/src/main/resources/mapper/business/ResourceLibraryMapper.xml diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/ResourceLibraryController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/ResourceLibraryController.java new file mode 100644 index 0000000..dbfdd13 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/controller/ResourceLibraryController.java @@ -0,0 +1,110 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.business.domain.ResourceLibrary; +import com.ruoyi.business.service.IResourceLibraryService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 资源库管理Controller + * + * @author LiuChengRan + * @date 2024-06-17 + */ +@Api(tags = "资源库管理接口") +@RestController +@RequestMapping("/business/ctResourceLibrary") +public class ResourceLibraryController extends BaseController +{ + @Autowired + private IResourceLibraryService resourceLibraryService; + + /** + * 查询资源库管理列表 + */ + @ApiOperation(value="查询资源库管理列表", httpMethod = "GET", response = ResourceLibrary.class) + @GetMapping("/list") + public TableDataInfo list(ResourceLibrary resourceLibrary) + { + startPage(); + List list = resourceLibraryService.list(resourceLibrary); + return getDataTable(list); + } + + /** + * 导出资源库管理列表 + */ + @ApiOperation(value="导出资源库管理列表", httpMethod = "POST") + @Log(title = "资源库管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ResourceLibrary resourceLibrary) + { + List list = resourceLibraryService.list(resourceLibrary); + ExcelUtil util = new ExcelUtil(ResourceLibrary.class); + util.exportExcel(response, list, "资源库管理数据"); + } + + /** + * 获取资源库管理详细信息 + */ + @ApiOperation(value="获取资源库管理详细信息", httpMethod = "GET", response = ResourceLibrary.class) + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(resourceLibraryService.getById(id)); + } + + /** + * 新增资源库管理 + */ + @ApiOperation(value="新增资源库管理", httpMethod = "POST") + @Log(title = "资源库管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ResourceLibrary resourceLibrary) + { + return toAjax(resourceLibraryService.save(resourceLibrary)); + } + + /** + * 修改资源库管理 + */ + @ApiOperation(value="修改资源库管理", httpMethod = "PUT") + @Log(title = "资源库管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ResourceLibrary resourceLibrary) + { + return toAjax(resourceLibraryService.updateById(resourceLibrary)); + } + + /** + * 删除资源库管理 + */ + @ApiOperation(value="删除资源库管理", httpMethod = "DELETE") + @Log(title = "资源库管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(resourceLibraryService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/ResourceLibrary.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/ResourceLibrary.java new file mode 100644 index 0000000..c88de70 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/ResourceLibrary.java @@ -0,0 +1,87 @@ +package com.ruoyi.business.domain; + +import com.baomidou.mybatisplus.annotation.*; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import lombok.Data; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.NoArgsConstructor; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.IdType; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 资源库管理对象 ct_resource_library + * + * @author LiuChengRan + * @date 2024-06-17 + */ +@Data +@Builder(toBuilder = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value="ResourceLibrary",description = "资源库管理") +@TableName(value = "ct_resource_library") +public class ResourceLibrary extends BaseEntity +{ + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + + + /** 资源描述 */ + @Excel(name = "资源描述") + @ApiModelProperty(name="resource",value = "资源描述") + private String resource; + + /** 资源内容 */ + @Excel(name = "资源内容") + @ApiModelProperty(name="resourceValue",value = "资源内容") + private String resourceValue; + + /** 资源类型 */ + @Excel(name = "资源类型") + @ApiModelProperty(name="resourceType",value = "资源类型") + private String resourceType; + + /** 资源键 */ + @Excel(name = "资源键") + @ApiModelProperty(name="resourceName",value = "资源键") + private String resourceName; + + /** 所属应用名称 */ + @Excel(name = "所属应用名称") + @ApiModelProperty(name="appName",value = "所属应用名称") + private String appName; + + /** 部门id */ + @Excel(name = "部门id") + @ApiModelProperty(name="deptId",value = "部门id") + private Long deptId; + + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("resource", getResource()) + .append("resourceValue", getResourceValue()) + .append("resourceType", getResourceType()) + .append("resourceName", getResourceName()) + .append("appName", getAppName()) + .append("deptId", getDeptId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("deleted", getDeleted()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/ResourceLibraryMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/ResourceLibraryMapper.java new file mode 100644 index 0000000..441e0f4 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/ResourceLibraryMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.business.domain.ResourceLibrary; + +/** + * 资源库管理Mapper接口 + * + * @author LiuChengRan + * @date 2024-06-17 + */ +public interface ResourceLibraryMapper extends BaseMapper +{ + + /** + * 查询资源库管理列表 + * + * @param resourceLibrary 资源库管理 + * @return 资源库管理集合 + */ + List selectResourceLibraryList(ResourceLibrary resourceLibrary); + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IResourceLibraryService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IResourceLibraryService.java new file mode 100644 index 0000000..d762945 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IResourceLibraryService.java @@ -0,0 +1,24 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.ResourceLibrary; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 资源库管理Service接口 + * + * @author LiuChengRan + * @date 2024-06-17 + */ +public interface IResourceLibraryService extends IService +{ + + /** + * 查询资源库管理列表 + * + * @param resourceLibrary 资源库管理 + * @return 资源库管理集合 + */ + List list(ResourceLibrary resourceLibrary); + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyPlanServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyPlanServiceImpl.java index 48d95ee..a8e2172 100644 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyPlanServiceImpl.java +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyPlanServiceImpl.java @@ -90,7 +90,7 @@ public class ApplyPlanServiceImpl extends ServiceImpl implements IResourceLibraryService +{ + + + /** + * 查询资源库管理列表 + * + * @param resourceLibrary 资源库管理 + * @return 资源库管理 + */ + @Override + public List list(ResourceLibrary resourceLibrary) + { + return baseMapper.selectResourceLibraryList(resourceLibrary); + } +} diff --git a/ruoyi-business/src/main/resources/mapper/business/ApplyMapper.xml b/ruoyi-business/src/main/resources/mapper/business/ApplyMapper.xml index 84b1305..579a5c7 100644 --- a/ruoyi-business/src/main/resources/mapper/business/ApplyMapper.xml +++ b/ruoyi-business/src/main/resources/mapper/business/ApplyMapper.xml @@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and support_param = #{supportParam} and dept_id = #{deptId} and dept_name like concat(#{deptName}, '%') - and version != '未发版' + and version != '未发版' and apply.manual_time != null ${params.dataScope} diff --git a/ruoyi-business/src/main/resources/mapper/business/ResourceLibraryMapper.xml b/ruoyi-business/src/main/resources/mapper/business/ResourceLibraryMapper.xml new file mode 100644 index 0000000..7cb239d --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/ResourceLibraryMapper.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select + id, + resource, + resource_value, + resource_type, + resource_name, + app_name, + dept_id, + create_by, + create_time, + update_by, + update_time, + remark, + deleted + + + \ No newline at end of file