cxd 8 сар өмнө
parent
commit
68ac0168d3

+ 106 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gqy/DcDocumentController.java

@@ -0,0 +1,106 @@
+package com.ruoyi.web.controller.gqy;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+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.system.domain.DcDocument;
+import com.ruoyi.system.service.IDcDocumentService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Controller
+ * 
+ * @author ruoyi
+ * @date 2024-10-30
+ */
+@RestController
+@RequestMapping("/document")
+public class DcDocumentController extends BaseController
+{
+    @Autowired
+    private IDcDocumentService dcDocumentService;
+
+
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:document:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(DcDocument dcDocument)
+    {
+        startPage();
+        List<DcDocument> list = dcDocumentService.selectDcDocumentList(dcDocument);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:document:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DcDocument dcDocument)
+    {
+        List<DcDocument> list = dcDocumentService.selectDcDocumentList(dcDocument);
+        ExcelUtil<DcDocument> util = new ExcelUtil<DcDocument>(DcDocument.class);
+        util.exportExcel(response, list, "【请填写功能名称】数据");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:document:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(dcDocumentService.selectDcDocumentById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:document:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DcDocument dcDocument)
+    {
+        return toAjax(dcDocumentService.insertDcDocument(dcDocument));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:document:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DcDocument dcDocument)
+    {
+        return toAjax(dcDocumentService.updateDcDocument(dcDocument));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:document:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(dcDocumentService.deleteDcDocumentByIds(ids));
+    }
+}

+ 123 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/DcDocument.java

@@ -0,0 +1,123 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】对象 dc_document
+ * 
+ * @author ruoyi
+ * @date 2024-10-30
+ */
+public class DcDocument extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String title;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String data;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long userId;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long status;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long categoryId;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long isTemplate;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setTitle(String title) 
+    {
+        this.title = title;
+    }
+
+    public String getTitle() 
+    {
+        return title;
+    }
+    public void setData(String data) 
+    {
+        this.data = data;
+    }
+
+    public String getData() 
+    {
+        return data;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setStatus(Long status) 
+    {
+        this.status = status;
+    }
+
+    public Long getStatus() 
+    {
+        return status;
+    }
+    public void setCategoryId(Long categoryId) 
+    {
+        this.categoryId = categoryId;
+    }
+
+    public Long getCategoryId() 
+    {
+        return categoryId;
+    }
+    public void setIsTemplate(Long isTemplate) 
+    {
+        this.isTemplate = isTemplate;
+    }
+
+    public Long getIsTemplate() 
+    {
+        return isTemplate;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("title", getTitle())
+            .append("data", getData())
+            .append("userId", getUserId())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .append("status", getStatus())
+            .append("categoryId", getCategoryId())
+            .append("isTemplate", getIsTemplate())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/DcDocumentMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.DcDocument;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-10-30
+ */
+public interface DcDocumentMapper 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public DcDocument selectDcDocumentById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param dcDocument 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<DcDocument> selectDcDocumentList(DcDocument dcDocument);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param dcDocument 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertDcDocument(DcDocument dcDocument);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param dcDocument 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateDcDocument(DcDocument dcDocument);
+
+    /**
+     * 删除【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteDcDocumentById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDcDocumentByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IDcDocumentService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.DcDocument;
+
+/**
+ * 【请填写功能名称】Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-10-30
+ */
+public interface IDcDocumentService 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public DcDocument selectDcDocumentById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param dcDocument 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<DcDocument> selectDcDocumentList(DcDocument dcDocument);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param dcDocument 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertDcDocument(DcDocument dcDocument);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param dcDocument 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateDcDocument(DcDocument dcDocument);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的【请填写功能名称】主键集合
+     * @return 结果
+     */
+    public int deleteDcDocumentByIds(Long[] ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteDcDocumentById(Long id);
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DcDocumentServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.DcDocumentMapper;
+import com.ruoyi.system.domain.DcDocument;
+import com.ruoyi.system.service.IDcDocumentService;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-10-30
+ */
+@Service
+public class DcDocumentServiceImpl implements IDcDocumentService 
+{
+    @Autowired
+    private DcDocumentMapper dcDocumentMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public DcDocument selectDcDocumentById(Long id)
+    {
+        return dcDocumentMapper.selectDcDocumentById(id);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param dcDocument 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<DcDocument> selectDcDocumentList(DcDocument dcDocument)
+    {
+        return dcDocumentMapper.selectDcDocumentList(dcDocument);
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param dcDocument 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertDcDocument(DcDocument dcDocument)
+    {
+        dcDocument.setCreateTime(DateUtils.getNowDate());
+        return dcDocumentMapper.insertDcDocument(dcDocument);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param dcDocument 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateDcDocument(DcDocument dcDocument)
+    {
+        dcDocument.setUpdateTime(DateUtils.getNowDate());
+        return dcDocumentMapper.updateDcDocument(dcDocument);
+    }
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDcDocumentByIds(Long[] ids)
+    {
+        return dcDocumentMapper.deleteDcDocumentByIds(ids);
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDcDocumentById(Long id)
+    {
+        return dcDocumentMapper.deleteDcDocumentById(id);
+    }
+}

+ 91 - 0
ruoyi-system/src/main/resources/mapper/system/DcDocumentMapper.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.ruoyi.system.mapper.DcDocumentMapper">
+    
+    <resultMap type="DcDocument" id="DcDocumentResult">
+        <result property="id"    column="id"    />
+        <result property="title"    column="title"    />
+        <result property="data"    column="data"    />
+        <result property="userId"    column="user_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="status"    column="status"    />
+        <result property="categoryId"    column="category_id"    />
+        <result property="isTemplate"    column="is_template"    />
+    </resultMap>
+
+    <sql id="selectDcDocumentVo">
+        select id, title, data, user_id, create_time, update_time, status, category_id, is_template from dc_document
+    </sql>
+
+    <select id="selectDcDocumentList" parameterType="DcDocument" resultMap="DcDocumentResult">
+        <include refid="selectDcDocumentVo"/>
+        <where>  
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="data != null  and data != ''"> and data = #{data}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="categoryId != null "> and category_id = #{categoryId}</if>
+            <if test="isTemplate != null "> and is_template = #{isTemplate}</if>
+        </where>
+    </select>
+    
+    <select id="selectDcDocumentById" parameterType="Long" resultMap="DcDocumentResult">
+        <include refid="selectDcDocumentVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertDcDocument" parameterType="DcDocument">
+        insert into dc_document
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="title != null">title,</if>
+            <if test="data != null">data,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="status != null">status,</if>
+            <if test="categoryId != null">category_id,</if>
+            <if test="isTemplate != null">is_template,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="title != null">#{title},</if>
+            <if test="data != null">#{data},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="status != null">#{status},</if>
+            <if test="categoryId != null">#{categoryId},</if>
+            <if test="isTemplate != null">#{isTemplate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDcDocument" parameterType="DcDocument">
+        update dc_document
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="title != null">title = #{title},</if>
+            <if test="data != null">data = #{data},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="categoryId != null">category_id = #{categoryId},</if>
+            <if test="isTemplate != null">is_template = #{isTemplate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDcDocumentById" parameterType="Long">
+        delete from dc_document where id = #{id}
+    </delete>
+
+    <delete id="deleteDcDocumentByIds" parameterType="String">
+        delete from dc_document where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>