fuliqi
2024-03-07 b3f0d9a7db1bdb81c5615b5cb12daeeedfdfacd9
考核发布
6个文件已添加
568 ■■■■■ 已修改文件
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TCheckPublish.java 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/controller/TCheckPublishController.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/TCheckPublishMapper.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/ITCheckPublishService.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/TCheckPublishServiceImpl.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/TCheckPublishMapper.xml 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TCheckPublish.java
New file
@@ -0,0 +1,148 @@
package com.ycl.platform.domain.entity;
import annotation.Excel;
import com.ycl.system.entity.BaseEntity;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
/**
 * 考核发布对象 t_check_publish
 *
 * @author ruoyi
 * @date 2024-03-07
 */
public class TCheckPublish extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** 主键 */
    private Long id;
    /** 考核名 */
    @Excel(name = "考核名")
    private String examineName;
    /** 考核模板id */
    @Excel(name = "考核模板id")
    private Long templateId;
    /** 考核范围 1/2 分局/市局 */
    @Excel(name = "考核范围 1/2 分局/市局")
    private Long timeRange;
    /** 考核频率 1/2 月度考核/季度考核 */
    @Excel(name = "考核频率 1/2 月度考核/季度考核")
    private Long frequency;
    /** 考核状态 0/1 启用 / 停用 */
    @Excel(name = "考核状态 0/1 启用 / 停用")
    private Long state;
    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Long createUser;
    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Long updateUser;
    /** 描述 */
    @Excel(name = "描述")
    private String description;
    public String getExamineName() {
        return examineName;
    }
    public void setExamineName(String examineName) {
        this.examineName = examineName;
    }
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setTemplateId(Long templateId)
    {
        this.templateId = templateId;
    }
    public Long getTemplateId()
    {
        return templateId;
    }
    public Long getTimeRange() {
        return timeRange;
    }
    public void setTimeRange(Long timeRange) {
        this.timeRange = timeRange;
    }
    public void setFrequency(Long frequency)
    {
        this.frequency = frequency;
    }
    public Long getFrequency()
    {
        return frequency;
    }
    public void setState(Long state)
    {
        this.state = state;
    }
    public Long getState()
    {
        return state;
    }
    public void setCreateUser(Long createUser)
    {
        this.createUser = createUser;
    }
    public Long getCreateUser()
    {
        return createUser;
    }
    public void setUpdateUser(Long updateUser)
    {
        this.updateUser = updateUser;
    }
    public Long getUpdateUser()
    {
        return updateUser;
    }
    public void setDescription(String description)
    {
        this.description = description;
    }
    public String getDescription()
    {
        return description;
    }
    @Override
    public String toString() {
        return "TCheckPublish{" +
                "id=" + id +
                ", examineName='" + examineName + '\'' +
                ", templateId=" + templateId +
                ", timeRange=" + timeRange +
                ", frequency=" + frequency +
                ", state=" + state +
                ", createUser=" + createUser +
                ", updateUser=" + updateUser +
                ", description='" + description + '\'' +
                '}';
    }
}
ycl-server/src/main/java/com/ycl/platform/controller/TCheckPublishController.java
New file
@@ -0,0 +1,98 @@
package com.ycl.platform.controller;
import annotation.Log;
import com.ycl.platform.domain.entity.TCheckPublish;
import com.ycl.platform.service.ITCheckPublishService;
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
import com.ycl.system.page.TableDataInfo;
import com.ycl.utils.poi.ExcelUtil;
import enumeration.BusinessType;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * 考核发布Controller
 *
 * @author ruoyi
 * @date 2024-03-07
 */
@RestController
@RequestMapping("/system/publish")
public class TCheckPublishController extends BaseController
{
    @Autowired
    private ITCheckPublishService tCheckPublishService;
    /**
     * 查询考核发布列表
     */
    @PreAuthorize("@ss.hasPermi('system:publish:list')")
    @GetMapping("/list")
    public TableDataInfo list(TCheckPublish tCheckPublish)
    {
        startPage();
        List<TCheckPublish> list = tCheckPublishService.selectTCheckPublishList(tCheckPublish);
        return getDataTable(list);
    }
    /**
     * 导出考核发布列表
     */
    @PreAuthorize("@ss.hasPermi('system:publish:export')")
    @Log(title = "考核发布", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TCheckPublish tCheckPublish)
    {
        List<TCheckPublish> list = tCheckPublishService.selectTCheckPublishList(tCheckPublish);
        ExcelUtil<TCheckPublish> util = new ExcelUtil<TCheckPublish>(TCheckPublish.class);
        util.exportExcel(response, list, "考核发布数据");
    }
    /**
     * 获取考核发布详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:publish:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(tCheckPublishService.selectTCheckPublishById(id));
    }
    /**
     * 新增考核发布
     */
    @PreAuthorize("@ss.hasPermi('system:publish:add')")
    @Log(title = "考核发布", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TCheckPublish tCheckPublish)
    {
        return toAjax(tCheckPublishService.insertTCheckPublish(tCheckPublish));
    }
    /**
     * 修改考核发布
     */
    @PreAuthorize("@ss.hasPermi('system:publish:edit')")
    @Log(title = "考核发布", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TCheckPublish tCheckPublish)
    {
        return toAjax(tCheckPublishService.updateTCheckPublish(tCheckPublish));
    }
    /**
     * 删除考核发布
     */
    @PreAuthorize("@ss.hasPermi('system:publish:remove')")
    @Log(title = "考核发布", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tCheckPublishService.deleteTCheckPublishByIds(ids));
    }
}
ycl-server/src/main/java/com/ycl/platform/mapper/TCheckPublishMapper.java
New file
@@ -0,0 +1,62 @@
package com.ycl.platform.mapper;
import com.ycl.platform.domain.entity.TCheckPublish;
import java.util.List;
/**
 * 考核发布Mapper接口
 *
 * @author ruoyi
 * @date 2024-03-07
 */
public interface TCheckPublishMapper
{
    /**
     * 查询考核发布
     *
     * @param id 考核发布主键
     * @return 考核发布
     */
    public TCheckPublish selectTCheckPublishById(Long id);
    /**
     * 查询考核发布列表
     *
     * @param tCheckPublish 考核发布
     * @return 考核发布集合
     */
    public List<TCheckPublish> selectTCheckPublishList(TCheckPublish tCheckPublish);
    /**
     * 新增考核发布
     *
     * @param tCheckPublish 考核发布
     * @return 结果
     */
    public int insertTCheckPublish(TCheckPublish tCheckPublish);
    /**
     * 修改考核发布
     *
     * @param tCheckPublish 考核发布
     * @return 结果
     */
    public int updateTCheckPublish(TCheckPublish tCheckPublish);
    /**
     * 删除考核发布
     *
     * @param id 考核发布主键
     * @return 结果
     */
    public int deleteTCheckPublishById(Long id);
    /**
     * 批量删除考核发布
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTCheckPublishByIds(Long[] ids);
}
ycl-server/src/main/java/com/ycl/platform/service/ITCheckPublishService.java
New file
@@ -0,0 +1,62 @@
package com.ycl.platform.service;
import com.ycl.platform.domain.entity.TCheckPublish;
import java.util.List;
/**
 * 考核发布Service接口
 *
 * @author ruoyi
 * @date 2024-03-07
 */
public interface ITCheckPublishService
{
    /**
     * 查询考核发布
     *
     * @param id 考核发布主键
     * @return 考核发布
     */
    public TCheckPublish selectTCheckPublishById(Long id);
    /**
     * 查询考核发布列表
     *
     * @param tCheckPublish 考核发布
     * @return 考核发布集合
     */
    public List<TCheckPublish> selectTCheckPublishList(TCheckPublish tCheckPublish);
    /**
     * 新增考核发布
     *
     * @param tCheckPublish 考核发布
     * @return 结果
     */
    public int insertTCheckPublish(TCheckPublish tCheckPublish);
    /**
     * 修改考核发布
     *
     * @param tCheckPublish 考核发布
     * @return 结果
     */
    public int updateTCheckPublish(TCheckPublish tCheckPublish);
    /**
     * 批量删除考核发布
     *
     * @param ids 需要删除的考核发布主键集合
     * @return 结果
     */
    public int deleteTCheckPublishByIds(Long[] ids);
    /**
     * 删除考核发布信息
     *
     * @param id 考核发布主键
     * @return 结果
     */
    public int deleteTCheckPublishById(Long id);
}
ycl-server/src/main/java/com/ycl/platform/service/impl/TCheckPublishServiceImpl.java
New file
@@ -0,0 +1,97 @@
package com.ycl.platform.service.impl;
import com.ycl.platform.domain.entity.TCheckPublish;
import com.ycl.platform.mapper.TCheckPublishMapper;
import com.ycl.platform.service.ITCheckPublishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import utils.DateUtils;
import java.util.List;
/**
 * 考核发布Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-07
 */
@Service
public class TCheckPublishServiceImpl implements ITCheckPublishService
{
    @Autowired
    private TCheckPublishMapper tCheckPublishMapper;
    /**
     * 查询考核发布
     *
     * @param id 考核发布主键
     * @return 考核发布
     */
    @Override
    public TCheckPublish selectTCheckPublishById(Long id)
    {
        return tCheckPublishMapper.selectTCheckPublishById(id);
    }
    /**
     * 查询考核发布列表
     *
     * @param tCheckPublish 考核发布
     * @return 考核发布
     */
    @Override
    public List<TCheckPublish> selectTCheckPublishList(TCheckPublish tCheckPublish)
    {
        return tCheckPublishMapper.selectTCheckPublishList(tCheckPublish);
    }
    /**
     * 新增考核发布
     *
     * @param tCheckPublish 考核发布
     * @return 结果
     */
    @Override
    public int insertTCheckPublish(TCheckPublish tCheckPublish)
    {
        tCheckPublish.setCreateTime(DateUtils.getNowDate());
        return tCheckPublishMapper.insertTCheckPublish(tCheckPublish);
    }
    /**
     * 修改考核发布
     *
     * @param tCheckPublish 考核发布
     * @return 结果
     */
    @Override
    public int updateTCheckPublish(TCheckPublish tCheckPublish)
    {
        tCheckPublish.setUpdateTime(DateUtils.getNowDate());
        return tCheckPublishMapper.updateTCheckPublish(tCheckPublish);
    }
    /**
     * 批量删除考核发布
     *
     * @param ids 需要删除的考核发布主键
     * @return 结果
     */
    @Override
    public int deleteTCheckPublishByIds(Long[] ids)
    {
        return tCheckPublishMapper.deleteTCheckPublishByIds(ids);
    }
    /**
     * 删除考核发布信息
     *
     * @param id 考核发布主键
     * @return 结果
     */
    @Override
    public int deleteTCheckPublishById(Long id)
    {
        return tCheckPublishMapper.deleteTCheckPublishById(id);
    }
}
ycl-server/src/main/resources/mapper/zgyw/TCheckPublishMapper.xml
New file
@@ -0,0 +1,101 @@
<?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.ycl.platform.mapper.TCheckPublishMapper">
    <resultMap type="com.ycl.platform.domain.entity.TCheckPublish" id="TCheckPublishResult">
        <result property="id"    column="id"    />
        <result property="examineName"    column="examine_name"    />
        <result property="templateId"    column="template_id"    />
        <result property="timeRange"    column="time_range"    />
        <result property="frequency"    column="frequency"    />
        <result property="state"    column="state"    />
        <result property="createTime"    column="create_time"    />
        <result property="createUser"    column="create_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="description"    column="description"    />
    </resultMap>
    <sql id="selectTCheckPublishVo">
        select id , examine_name, template_id , time_range , frequency , state , create_time , create_user , update_time , update_user , description from t_check_publish
    </sql>
    <select id="selectTCheckPublishList" parameterType="com.ycl.platform.domain.entity.TCheckPublish" resultMap="TCheckPublishResult">
        <include refid="selectTCheckPublishVo"/>
        <where>
            <if test="templateId != null "> and template_id = #{templateId}</if>
            <if test="examineName != null  and examineName != '' "> and examine_name = #{examineName}</if>
            <if test="timeRange != null "> and time_range = #{timeRange}</if>
            <if test="frequency != null "> and frequency = #{frequency}</if>
            <if test="state != null "> and state = #{state}</if>
            <if test="createUser != null "> and create_user = #{createUser}</if>
            <if test="updateUser != null "> and update_user = #{updateUser}</if>
            <if test="description != null  and description != ''"> and description = #{description}</if>
        </where>
    </select>
    <select id="selectTCheckPublishById" parameterType="Long" resultMap="TCheckPublishResult">
        <include refid="selectTCheckPublishVo"/>
        where id = #{id}
    </select>
    <insert id="insertTCheckPublish" parameterType="com.ycl.platform.domain.entity.TCheckPublish">
        insert into t_check_publish
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="examineName != null and examineName != ''">examine_name,</if>
            <if test="templateId != null">template_id,</if>
            <if test="timeRange != null">time_range,</if>
            <if test="frequency != null">frequency,</if>
            <if test="state != null">state,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createUser != null">create_user,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="description != null">description,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="examineName != null and examineName != ''">#{examineName},</if>
            <if test="templateId != null">#{templateId},</if>
            <if test="timeRange != null">#{timeRange},</if>
            <if test="frequency != null">#{frequency},</if>
            <if test="state != null">#{state},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="description != null">#{description},</if>
         </trim>
    </insert>
    <update id="updateTCheckPublish" parameterType="com.ycl.platform.domain.entity.TCheckPublish">
        update t_check_publish
        <trim prefix="SET" suffixOverrides=",">
            <if test="examineName != null and examineName != ''">examine_name = #{examineName},</if>
            <if test="templateId != null">template_id = #{templateId},</if>
            <if test="timeRange != null">time_range = #{timeRange},</if>
            <if test="frequency != null">frequency = #{frequency},</if>
            <if test="state != null">state = #{state},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="description != null">description = #{description},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteTCheckPublishById" parameterType="Long">
        delete from t_check_publish where id = #{id}
    </delete>
    <delete id="deleteTCheckPublishByIds" parameterType="String">
        delete from t_check_publish where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>