浏览代码

增加文档加密级别相关内容

wukai 1 年之前
父节点
当前提交
2a4327f368

+ 1 - 1
doc-admin/src/main/resources/application-t1.yml

@@ -22,7 +22,7 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: 192.168.1.28
+    host: 192.168.188.88
     # 端口,默认为6379
     port: 6379
     # 数据库索引

+ 14 - 0
doc-admin/src/main/resources/application.yml

@@ -1,3 +1,17 @@
+# 项目相关配置
+ruoyi:
+  # 名称
+  name: 聚聚通
+  # 版本
+  version: 3.8.6
+  # 版权年份
+  copyrightYear: 2023
+  # 实例演示开关
+  demoEnabled: false
+  # 获取ip地址开关
+  addressEnabled: false
+  # 验证码类型 math 数字计算 char 字符验证
+  captchaType: math
 # 公共配置
 server:
   servlet:

+ 114 - 0
doc-biz/src/main/java/com/doc/biz/controller/DocDirLevelController.java

@@ -0,0 +1,114 @@
+package com.doc.biz.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+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.doc.common.annotation.Log;
+import com.doc.common.core.controller.BaseController;
+import com.doc.common.core.domain.AjaxResult;
+import com.doc.common.enums.BusinessType;
+import com.doc.biz.domain.DocDirLevel;
+import com.doc.biz.service.IDocDirLevelService;
+import com.doc.common.utils.poi.ExcelUtil;
+import com.doc.common.core.page.TableDataInfo;
+
+/**
+ * 文档目录加密级别Controller
+ * 
+ * @author wukai
+ * @date 2023-10-19
+ */
+@Api(tags="文档目录加密级别")
+@RestController
+@RequestMapping("/biz/level")
+public class DocDirLevelController extends BaseController
+{
+    @Resource
+    private IDocDirLevelService docDirLevelService;
+
+    /**
+     * 查询文档目录加密级别列表
+     */
+    @ApiOperation("查询文档目录加密级别列表")
+    @PreAuthorize("@ss.hasPermi('biz:level:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(DocDirLevel docDirLevel)
+    {
+        startPage();
+        List<DocDirLevel> list = docDirLevelService.selectDocDirLevelList(docDirLevel);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出文档目录加密级别列表
+     */
+    @ApiOperation("导出文档目录加密级别列表")
+    @PreAuthorize("@ss.hasPermi('biz:level:export')")
+    @Log(title = "文档目录加密级别", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DocDirLevel docDirLevel)
+    {
+        List<DocDirLevel> list = docDirLevelService.selectDocDirLevelList(docDirLevel);
+        ExcelUtil<DocDirLevel> util = new ExcelUtil<DocDirLevel>(DocDirLevel.class);
+        util.exportExcel(response, list, "文档目录加密级别数据");
+    }
+
+    /**
+     * 获取文档目录加密级别详细信息
+     */
+    @ApiOperation("获取文档目录加密级别详细信息")
+    @PreAuthorize("@ss.hasPermi('biz:level:query')")
+    @GetMapping(value = "/{levelId}")
+    public AjaxResult getInfo(@PathVariable("levelId") Long levelId)
+    {
+        return success(docDirLevelService.selectDocDirLevelByLevelId(levelId));
+    }
+
+    /**
+     * 新增文档目录加密级别
+     */
+    @ApiOperation("新增文档目录加密级别")
+    @PreAuthorize("@ss.hasPermi('biz:level:add')")
+    @Log(title = "文档目录加密级别", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DocDirLevel docDirLevel)
+    {
+        return toAjax(docDirLevelService.insertDocDirLevel(docDirLevel));
+    }
+
+    /**
+     * 修改文档目录加密级别
+     */
+    @ApiOperation("修改文档目录加密级别")
+    @PreAuthorize("@ss.hasPermi('biz:level:edit')")
+    @Log(title = "文档目录加密级别", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DocDirLevel docDirLevel)
+    {
+        return toAjax(docDirLevelService.updateDocDirLevel(docDirLevel));
+    }
+
+    /**
+     * 删除文档目录加密级别
+     */
+    @ApiOperation("删除文档目录加密级别")
+    @PreAuthorize("@ss.hasPermi('biz:level:remove')")
+    @Log(title = "文档目录加密级别", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{levelIds}")
+    public AjaxResult remove(@PathVariable Long[] levelIds)
+    {
+        return toAjax(docDirLevelService.deleteDocDirLevelByLevelIds(levelIds));
+    }
+}

+ 4 - 0
doc-biz/src/main/java/com/doc/biz/domain/DocDir.java

@@ -56,6 +56,10 @@ public class DocDir extends TreeEntity {
     @ApiModelProperty("目录名称")
     @Excel(name = "目录名称")
     private String dirName;
+    @ApiModelProperty("是否加密")
+    private String isEncrypt;
+    @ApiModelProperty("加密级别")
+    private String encryptLevel;
 
     /**
      * 目录路径

+ 93 - 0
doc-biz/src/main/java/com/doc/biz/domain/DocDirLevel.java

@@ -0,0 +1,93 @@
+package com.doc.biz.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.doc.common.annotation.Excel;
+import com.doc.common.core.domain.BaseEntity;
+
+/**
+ * 文档目录加密级别对象 doc_dir_level
+ *
+ * @author wukai
+ * @date 2023-10-19
+ */
+@ApiModel(value = "DocDirLevel", description = "文档目录加密级别")
+public class DocDirLevel extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 目录ID */
+    @ApiModelProperty("目录ID")
+    @TableId
+    private Long levelId;
+
+    /** 等级名称; */
+    @ApiModelProperty("等级名称;")
+    @Excel(name = "等级名称;")
+    private String levelName;
+
+    /** 等级编码 */
+    @ApiModelProperty("等级编码")
+    @Excel(name = "等级编码")
+    private String levelCode;
+
+    /** 等级对应权限 */
+    @ApiModelProperty("等级对应权限")
+    @Excel(name = "等级对应权限")
+    private String levelRoles;
+
+    public void setLevelId(Long levelId)
+    {
+        this.levelId = levelId;
+    }
+
+    public Long getLevelId()
+    {
+        return levelId;
+    }
+    public void setLevelName(String levelName)
+    {
+        this.levelName = levelName;
+    }
+
+    public String getLevelName()
+    {
+        return levelName;
+    }
+    public void setLevelCode(String levelCode)
+    {
+        this.levelCode = levelCode;
+    }
+
+    public String getLevelCode()
+    {
+        return levelCode;
+    }
+    public void setLevelRoles(String levelRoles)
+    {
+        this.levelRoles = levelRoles;
+    }
+
+    public String getLevelRoles()
+    {
+        return levelRoles;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("levelId", getLevelId())
+            .append("levelName", getLevelName())
+            .append("levelCode", getLevelCode())
+            .append("levelRoles", getLevelRoles())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 62 - 0
doc-biz/src/main/java/com/doc/biz/mapper/DocDirLevelMapper.java

@@ -0,0 +1,62 @@
+package com.doc.biz.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doc.biz.domain.DocDirLevel;
+
+/**
+ * 文档目录加密级别Mapper接口
+ * 
+ * @author wukai
+ * @date 2023-10-19
+ */
+public interface DocDirLevelMapper extends BaseMapper<DocDirLevel>
+{
+    /**
+     * 查询文档目录加密级别
+     * 
+     * @param levelId 文档目录加密级别主键
+     * @return 文档目录加密级别
+     */
+    public DocDirLevel selectDocDirLevelByLevelId(Long levelId);
+
+    /**
+     * 查询文档目录加密级别列表
+     * 
+     * @param docDirLevel 文档目录加密级别
+     * @return 文档目录加密级别集合
+     */
+    public List<DocDirLevel> selectDocDirLevelList(DocDirLevel docDirLevel);
+
+    /**
+     * 新增文档目录加密级别
+     * 
+     * @param docDirLevel 文档目录加密级别
+     * @return 结果
+     */
+    public int insertDocDirLevel(DocDirLevel docDirLevel);
+
+    /**
+     * 修改文档目录加密级别
+     * 
+     * @param docDirLevel 文档目录加密级别
+     * @return 结果
+     */
+    public int updateDocDirLevel(DocDirLevel docDirLevel);
+
+    /**
+     * 删除文档目录加密级别
+     * 
+     * @param levelId 文档目录加密级别主键
+     * @return 结果
+     */
+    public int deleteDocDirLevelByLevelId(Long levelId);
+
+    /**
+     * 批量删除文档目录加密级别
+     * 
+     * @param levelIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDocDirLevelByLevelIds(Long[] levelIds);
+}

+ 61 - 0
doc-biz/src/main/java/com/doc/biz/service/IDocDirLevelService.java

@@ -0,0 +1,61 @@
+package com.doc.biz.service;
+
+import java.util.List;
+import com.doc.biz.domain.DocDirLevel;
+
+/**
+ * 文档目录加密级别Service接口
+ * 
+ * @author wukai
+ * @date 2023-10-19
+ */
+public interface IDocDirLevelService 
+{
+    /**
+     * 查询文档目录加密级别
+     * 
+     * @param levelId 文档目录加密级别主键
+     * @return 文档目录加密级别
+     */
+    public DocDirLevel selectDocDirLevelByLevelId(Long levelId);
+
+    /**
+     * 查询文档目录加密级别列表
+     * 
+     * @param docDirLevel 文档目录加密级别
+     * @return 文档目录加密级别集合
+     */
+    public List<DocDirLevel> selectDocDirLevelList(DocDirLevel docDirLevel);
+
+    /**
+     * 新增文档目录加密级别
+     * 
+     * @param docDirLevel 文档目录加密级别
+     * @return 结果
+     */
+    public int insertDocDirLevel(DocDirLevel docDirLevel);
+
+    /**
+     * 修改文档目录加密级别
+     * 
+     * @param docDirLevel 文档目录加密级别
+     * @return 结果
+     */
+    public int updateDocDirLevel(DocDirLevel docDirLevel);
+
+    /**
+     * 批量删除文档目录加密级别
+     * 
+     * @param levelIds 需要删除的文档目录加密级别主键集合
+     * @return 结果
+     */
+    public int deleteDocDirLevelByLevelIds(Long[] levelIds);
+
+    /**
+     * 删除文档目录加密级别信息
+     * 
+     * @param levelId 文档目录加密级别主键
+     * @return 结果
+     */
+    public int deleteDocDirLevelByLevelId(Long levelId);
+}

+ 89 - 0
doc-biz/src/main/java/com/doc/biz/service/impl/DocDirLevelServiceImpl.java

@@ -0,0 +1,89 @@
+package com.doc.biz.service.impl;
+
+import java.util.List;
+        import com.doc.common.utils.DateUtils;
+import org.springframework.stereotype.Service;
+import com.doc.biz.mapper.DocDirLevelMapper;
+import com.doc.biz.domain.DocDirLevel;
+import com.doc.biz.service.IDocDirLevelService;
+import javax.annotation.Resource;
+
+/**
+ * 文档目录加密级别Service业务层处理
+ *
+ * @author wukai
+ * @date 2023-10-19
+ */
+@Service
+public class DocDirLevelServiceImpl implements IDocDirLevelService {
+    @Resource
+    private DocDirLevelMapper docDirLevelMapper;
+
+    /**
+     * 查询文档目录加密级别
+     *
+     * @param levelId 文档目录加密级别主键
+     * @return 文档目录加密级别
+     */
+    @Override
+    public DocDirLevel selectDocDirLevelByLevelId(Long levelId) {
+        return docDirLevelMapper.selectDocDirLevelByLevelId(levelId);
+    }
+
+    /**
+     * 查询文档目录加密级别列表
+     *
+     * @param docDirLevel 文档目录加密级别
+     * @return 文档目录加密级别
+     */
+    @Override
+    public List<DocDirLevel> selectDocDirLevelList(DocDirLevel docDirLevel) {
+        return docDirLevelMapper.selectDocDirLevelList(docDirLevel);
+    }
+
+    /**
+     * 新增文档目录加密级别
+     *
+     * @param docDirLevel 文档目录加密级别
+     * @return 结果
+     */
+    @Override
+    public int insertDocDirLevel(DocDirLevel docDirLevel) {
+                docDirLevel.setCreateTime(DateUtils.getNowDate());
+            return docDirLevelMapper.insertDocDirLevel(docDirLevel);
+    }
+
+    /**
+     * 修改文档目录加密级别
+     *
+     * @param docDirLevel 文档目录加密级别
+     * @return 结果
+     */
+    @Override
+    public int updateDocDirLevel(DocDirLevel docDirLevel) {
+                docDirLevel.setUpdateTime(DateUtils.getNowDate());
+        return docDirLevelMapper.updateDocDirLevel(docDirLevel);
+    }
+
+    /**
+     * 批量删除文档目录加密级别
+     *
+     * @param levelIds 需要删除的文档目录加密级别主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDocDirLevelByLevelIds(Long[] levelIds) {
+        return docDirLevelMapper.deleteDocDirLevelByLevelIds(levelIds);
+    }
+
+    /**
+     * 删除文档目录加密级别信息
+     *
+     * @param levelId 文档目录加密级别主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDocDirLevelByLevelId(Long levelId) {
+        return docDirLevelMapper.deleteDocDirLevelByLevelId(levelId);
+    }
+}

+ 91 - 0
doc-biz/src/main/resources/mapper/biz/DocDirLevelMapper.xml

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.doc.biz.mapper.DocDirLevelMapper">
+    
+    <resultMap type="DocDirLevel" id="DocDirLevelResult">
+        <result property="levelId"    column="LEVEL_ID"    />
+        <result property="levelName"    column="LEVEL_NAME"    />
+        <result property="levelCode"    column="LEVEL_CODE"    />
+        <result property="levelRoles"    column="LEVEL_ROLES"    />
+        <result property="createBy"    column="CREATE_BY"    />
+        <result property="createTime"    column="CREATE_TIME"    />
+        <result property="updateBy"    column="UPDATE_BY"    />
+        <result property="updateTime"    column="UPDATE_TIME"    />
+        <result property="remark"    column="REMARK"    />
+    </resultMap>
+
+    <sql id="selectDocDirLevelVo">
+        select LEVEL_ID, LEVEL_NAME, LEVEL_CODE, LEVEL_ROLES, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK from doc_dir_level
+    </sql>
+
+    <select id="selectDocDirLevelList" parameterType="DocDirLevel" resultMap="DocDirLevelResult">
+        <include refid="selectDocDirLevelVo"/>
+        <where>  
+            <if test="levelName != null  and levelName != ''"> and LEVEL_NAME like concat('%', #{levelName}, '%')</if>
+            <if test="levelCode != null  and levelCode != ''"> and LEVEL_CODE = #{levelCode}</if>
+            <if test="levelRoles != null  and levelRoles != ''"> and LEVEL_ROLES = #{levelRoles}</if>
+            <if test="createBy != null  and createBy != ''"> and CREATE_BY = #{createBy}</if>
+            <if test="createTime != null "> and CREATE_TIME = #{createTime}</if>
+            <if test="updateBy != null  and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
+            <if test="updateTime != null "> and UPDATE_TIME = #{updateTime}</if>
+            <if test="remark != null  and remark != ''"> and REMARK = #{remark}</if>
+        </where>
+    </select>
+    
+    <select id="selectDocDirLevelByLevelId" parameterType="Long" resultMap="DocDirLevelResult">
+        <include refid="selectDocDirLevelVo"/>
+        where LEVEL_ID = #{levelId}
+    </select>
+        
+    <insert id="insertDocDirLevel" parameterType="DocDirLevel" useGeneratedKeys="true" keyProperty="levelId">
+        insert into doc_dir_level
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="levelName != null">LEVEL_NAME,</if>
+            <if test="levelCode != null and levelCode != ''">LEVEL_CODE,</if>
+            <if test="levelRoles != null and levelRoles != ''">LEVEL_ROLES,</if>
+            <if test="createBy != null">CREATE_BY,</if>
+            <if test="createTime != null">CREATE_TIME,</if>
+            <if test="updateBy != null">UPDATE_BY,</if>
+            <if test="updateTime != null">UPDATE_TIME,</if>
+            <if test="remark != null">REMARK,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="levelName != null">#{levelName},</if>
+            <if test="levelCode != null and levelCode != ''">#{levelCode},</if>
+            <if test="levelRoles != null and levelRoles != ''">#{levelRoles},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDocDirLevel" parameterType="DocDirLevel">
+        update doc_dir_level
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="levelName != null">LEVEL_NAME = #{levelName},</if>
+            <if test="levelCode != null and levelCode != ''">LEVEL_CODE = #{levelCode},</if>
+            <if test="levelRoles != null and levelRoles != ''">LEVEL_ROLES = #{levelRoles},</if>
+            <if test="createBy != null">CREATE_BY = #{createBy},</if>
+            <if test="createTime != null">CREATE_TIME = #{createTime},</if>
+            <if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
+            <if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
+            <if test="remark != null">REMARK = #{remark},</if>
+        </trim>
+        where LEVEL_ID = #{levelId}
+    </update>
+
+    <delete id="deleteDocDirLevelByLevelId" parameterType="Long">
+        delete from doc_dir_level where LEVEL_ID = #{levelId}
+    </delete>
+
+    <delete id="deleteDocDirLevelByLevelIds" parameterType="String">
+        delete from doc_dir_level where LEVEL_ID in 
+        <foreach item="levelId" collection="array" open="(" separator="," close=")">
+            #{levelId}
+        </foreach>
+    </delete>
+</mapper>

+ 10 - 0
doc-biz/src/main/resources/mapper/biz/DocDirMapper.xml

@@ -12,6 +12,8 @@
         <result property="dirName" column="DIR_NAME"/>
         <result property="parentId" column="PARENT_ID"/>
         <result property="dirPath" column="DIR_PATH"/>
+        <result property="isEncrypt" column="IS_ENCRYPT"/>
+        <result property="encryptLevel" column="ENCRYPT_LEVEL"/>
         <result property="createBy" column="CREATE_BY"/>
         <result property="createTime" column="CREATE_TIME"/>
         <result property="updateBy" column="UPDATE_BY"/>
@@ -27,6 +29,8 @@
                DIR_NAME,
                PARENT_ID,
                DIR_PATH,
+               IS_ENCRYPT,
+               ENCRYPT_LEVEL,
                CREATE_BY,
                CREATE_TIME,
                UPDATE_BY,
@@ -75,6 +79,8 @@
             <if test="dirName != null">DIR_NAME,</if>
             <if test="parentId != null">PARENT_ID,</if>
             <if test="dirPath != null">DIR_PATH,</if>
+            <if test="isEncrypt != null">IS_ENCRYPT,</if>
+            <if test="encryptLevel != null">ENCRYPT_LEVEL,</if>
             <if test="createBy != null">CREATE_BY,</if>
             <if test="createTime != null">CREATE_TIME,</if>
             <if test="updateBy != null">UPDATE_BY,</if>
@@ -88,6 +94,8 @@
             <if test="dirName != null">#{dirName},</if>
             <if test="parentId != null">#{parentId},</if>
             <if test="dirPath != null">#{dirPath},</if>
+            <if test="isEncrypt != null">#{isEncrypt},</if>
+            <if test="encryptLevel != null">#{encryptLevel},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -105,6 +113,8 @@
             <if test="dirName != null">DIR_NAME = #{dirName},</if>
             <if test="parentId != null">PARENT_ID = #{parentId},</if>
             <if test="dirPath != null">DIR_PATH = #{dirPath},</if>
+            <if test="isEncrypt != null">IS_ENCRYPT = #{isEncrypt},</if>
+            <if test="encryptLevel != null">ENCRYPT_LEVEL = #{encryptLevel},</if>
             <if test="createBy != null">CREATE_BY = #{createBy},</if>
             <if test="createTime != null">CREATE_TIME = #{createTime},</if>
             <if test="updateBy != null">UPDATE_BY = #{updateBy},</if>

+ 3 - 0
doc-system/src/main/java/com/doc/system/service/impl/SysUserServiceImpl.java

@@ -17,6 +17,7 @@ import com.doc.system.domain.SysUserPost;
 import com.doc.system.domain.SysUserRole;
 import com.doc.system.mapper.*;
 import com.doc.system.service.ISysConfigService;
+import com.doc.system.service.ISysUserExpandService;
 import com.doc.system.service.ISysUserService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,6 +65,8 @@ public class SysUserServiceImpl implements ISysUserService {
 
     @Resource
     private RedisCache redisCache;
+    @Resource
+    private ISysUserExpandService expandService;
 
     /**
      * 根据条件分页查询用户列表