From 456d71b59125b19b08a190d5679b0791d4239f80 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期四, 07 三月 2024 15:23:04 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ycl-server/src/main/java/com/ycl/platform/controller/TCheckPublishController.java | 98 ++++++++ ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TCheckPublish.java | 166 +++++++++++++++ ycl-server/src/main/java/com/ycl/platform/service/ITCheckPublishService.java | 62 +++++ ycl-server/src/main/resources/mapper/zgyw/TCheckPublishMapper.xml | 109 +++++++++ ycl-server/src/main/java/com/ycl/platform/service/impl/TCheckPublishServiceImpl.java | 113 ++++++++++ ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java | 10 ycl-server/src/main/java/com/ycl/platform/mapper/TCheckPublishMapper.java | 62 +++++ 7 files changed, 618 insertions(+), 2 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..76751b6 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TCheckPublish.java @@ -0,0 +1,166 @@ +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 examineRange; + + /** 鑰冩牳棰戠巼 1/2 鏈堝害鑰冩牳/瀛e害鑰冩牳 */ + @Excel(name = "鑰冩牳棰戠巼 1/2 鏈堝害鑰冩牳/瀛e害鑰冩牳") + private Long frequency; + + /** 鑰冩牳鐘舵�� 0/1 鍚敤 / 鍋滅敤 */ + @Excel(name = "鑰冩牳鐘舵�� 0/1 鍚敤 / 鍋滅敤") + private Long state; + + private Long createUser; + @Excel(name = "鍒涘缓浜�") + private String createUserName; + @Excel(name = "淇敼浜�") + private String updateUserName; + + 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 getExamineRange() { + return examineRange; + } + + public void setExamineRange(Long examineRange) { + this.examineRange = examineRange; + } + + public String getCreateUserName() { + return createUserName; + } + + public void setCreateUserName(String createUserName) { + this.createUserName = createUserName; + } + + public String getUpdateUserName() { + return updateUserName; + } + + public void setUpdateUserName(String updateUserName) { + this.updateUserName = updateUserName; + } + + 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 + + ", examineRange=" + examineRange + + ", frequency=" + frequency + + ", state=" + state + + ", createUser=" + createUser + + ", createUserName='" + createUserName + '\'' + + ", updateUserName='" + updateUserName + '\'' + + ", 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/CheckTemplateServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java index c08db94..37398d2 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java @@ -1,5 +1,6 @@ package com.ycl.platform.service.impl; +import com.ycl.platform.base.BaseSelect; import com.ycl.platform.domain.entity.CheckTemplate; import com.ycl.platform.domain.entity.YwUnit; import com.ycl.platform.mapper.CheckTemplateMapper; @@ -144,9 +145,14 @@ @Override public Result all() { List<CheckTemplate> entities = baseMapper.selectList(null); - List<CheckTemplateVO> vos = entities.stream() + List<BaseSelect> vos = entities.stream() .map( - entity -> CheckTemplateVO.getVoByEntity(entity, null) + entity -> { + BaseSelect baseSelect = new BaseSelect(); + baseSelect.setId(entity.getId()); + baseSelect.setValue(entity.getTemplateName()); + return baseSelect; + } ) .collect(Collectors.toList()); return Result.ok().data(vos); 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..edea606 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/TCheckPublishServiceImpl.java @@ -0,0 +1,113 @@ +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 com.ycl.system.entity.SysUser; +import com.ycl.system.mapper.SysUserMapper; +import com.ycl.system.model.LoginUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Service; +import utils.DateUtils; + +import java.util.Date; +import java.util.List; + +/** + * 鑰冩牳鍙戝竷Service涓氬姟灞傚鐞� + * + * @author ruoyi + * @date 2024-03-07 + */ +@Service +public class TCheckPublishServiceImpl implements ITCheckPublishService +{ + @Autowired + private TCheckPublishMapper tCheckPublishMapper; + @Autowired + private SysUserMapper userMapper; + /** + * 鏌ヨ鑰冩牳鍙戝竷 + * + * @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) + { + Date nowDate = DateUtils.getNowDate(); + tCheckPublish.setCreateTime(nowDate); + tCheckPublish.setUpdateTime(nowDate); + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + tCheckPublish.setCreateUser(user.getUserId()); + tCheckPublish.setCreateUserName(user.getUsername()); + tCheckPublish.setUpdateUser(user.getUserId()); + tCheckPublish.setUpdateUserName(user.getUsername()); + return tCheckPublishMapper.insertTCheckPublish(tCheckPublish); + } + + /** + * 淇敼鑰冩牳鍙戝竷 + * + * @param tCheckPublish 鑰冩牳鍙戝竷 + * @return 缁撴灉 + */ + @Override + public int updateTCheckPublish(TCheckPublish tCheckPublish) + { + tCheckPublish.setUpdateTime(DateUtils.getNowDate()); + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + tCheckPublish.setUpdateUser(user.getUserId()); + tCheckPublish.setUpdateUserName(user.getUsername()); + 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..c068482 --- /dev/null +++ b/ycl-server/src/main/resources/mapper/zgyw/TCheckPublishMapper.xml @@ -0,0 +1,109 @@ +<?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="examineRange" column="examine_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="createUserName" column="create_user_name" /> + <result property="updateTime" column="update_time" /> + <result property="updateUser" column="update_user" /> + <result property="updateUserName" column="update_user_name" /> + <result property="description" column="description" /> + </resultMap> + + <sql id="selectTCheckPublishVo"> + select id , examine_name, template_id , examine_range , frequency , state , create_time , create_user , update_time , update_user , description,create_user_name,update_user_name 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="examineRange != null "> and examine_range = #{examineRange}</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="examineRange != null">examine_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="createUserName != null and createUserName!= ''">create_user_name,</if> + <if test="updateTime != null">update_time,</if> + <if test="updateUser != null">update_user,</if> + <if test="updateUserName != null and updateUserName!= ''">update_user_name,</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="examineRange != null">#{examineRange},</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="createUserName != null and createUserName!= ''">#{createUserName},</if> + <if test="updateTime != null">#{updateTime},</if> + <if test="updateUser != null">#{updateUser},</if> + <if test="updateUserName != null and updateUserName!= ''">#{updateUserName},</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="examineRange != null">examine_range = #{examineRange},</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="createUserName != null and createUserName!= ''">create_user_name = #{createUserName},</if> + <if test="updateTime != null">update_time = #{updateTime},</if> + <if test="updateUser != null">update_user = #{updateUser},</if> + <if test="updateUserName != null and updateUserName!= ''">update_user_name = #{updateUserName},</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