From b3f0d9a7db1bdb81c5615b5cb12daeeedfdfacd9 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 07 三月 2024 10:44:12 +0800 Subject: [PATCH] 考核发布 --- ycl-server/src/main/java/com/ycl/platform/controller/TCheckPublishController.java | 98 +++++++++ ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TCheckPublish.java | 148 ++++++++++++++ ycl-server/src/main/java/com/ycl/platform/service/ITCheckPublishService.java | 62 ++++++ ycl-server/src/main/resources/mapper/zgyw/TCheckPublishMapper.xml | 101 ++++++++++ ycl-server/src/main/java/com/ycl/platform/service/impl/TCheckPublishServiceImpl.java | 97 +++++++++ ycl-server/src/main/java/com/ycl/platform/mapper/TCheckPublishMapper.java | 62 ++++++ 6 files changed, 568 insertions(+), 0 deletions(-) diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TCheckPublish.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TCheckPublish.java new file mode 100644 index 0000000..eee3d32 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TCheckPublish.java @@ -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 鏈堝害鑰冩牳/瀛e害鑰冩牳 */ + @Excel(name = "鑰冩牳棰戠巼 1/2 鏈堝害鑰冩牳/瀛e害鑰冩牳") + 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 + '\'' + + '}'; + } +} diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/TCheckPublishController.java b/ycl-server/src/main/java/com/ycl/platform/controller/TCheckPublishController.java new file mode 100644 index 0000000..25af8b5 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/controller/TCheckPublishController.java @@ -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)); + } +} diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/TCheckPublishMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/TCheckPublishMapper.java new file mode 100644 index 0000000..3e3bac1 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/TCheckPublishMapper.java @@ -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); +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ITCheckPublishService.java b/ycl-server/src/main/java/com/ycl/platform/service/ITCheckPublishService.java new file mode 100644 index 0000000..f4b370f --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/ITCheckPublishService.java @@ -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); +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/TCheckPublishServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/TCheckPublishServiceImpl.java new file mode 100644 index 0000000..c2f7f89 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/TCheckPublishServiceImpl.java @@ -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); + } +} diff --git a/ycl-server/src/main/resources/mapper/zgyw/TCheckPublishMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/TCheckPublishMapper.xml new file mode 100644 index 0000000..58df6ae --- /dev/null +++ b/ycl-server/src/main/resources/mapper/zgyw/TCheckPublishMapper.xml @@ -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> \ No newline at end of file -- Gitblit v1.8.0