ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplate.java
@@ -44,5 +44,7 @@ @TableField("status") private String status; @ApiModelProperty("单位id") @TableField("unit_id") private Integer unitId; } ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TExamineScore.java
New file @@ -0,0 +1,111 @@ 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; import java.math.BigDecimal; /** * 考核计分对象 t_examine_score * * @author ruoyi * @date 2024-03-13 */ public class TExamineScore extends BaseEntity { private static final long serialVersionUID = 1L; /** $column.columnComment */ private Long id; /** 分值 */ @Excel(name = "分值") private BigDecimal score; /** 单位id */ @Excel(name = "单位id") private Long unitId; /** 考核id */ @Excel(name = "考核id") private Long examineId; /** 操作类型 1/2 系统打分/人工打分 */ @Excel(name = "操作类型 1/2 系统打分/人工打分") private Long operateCategory; /** 积分类型 */ @Excel(name = "积分类型") private Long scoreCategory; public void setId(Long id) { this.id = id; } public Long getId() { return id; } public void setScore(BigDecimal score) { this.score = score; } public BigDecimal getScore() { return score; } public void setUnitId(Long unitId) { this.unitId = unitId; } public Long getUnitId() { return unitId; } public void setExamineId(Long examineId) { this.examineId = examineId; } public Long getExamineId() { return examineId; } public void setOperateCategory(Long operateCategory) { this.operateCategory = operateCategory; } public Long getOperateCategory() { return operateCategory; } public void setScoreCategory(Long scoreCategory) { this.scoreCategory = scoreCategory; } public Long getScoreCategory() { return scoreCategory; } @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("score", getScore()) .append("unitId", getUnitId()) .append("examineId", getExamineId()) .append("operateCategory", getOperateCategory()) .append("scoreCategory", getScoreCategory()) .append("createTime", getCreateTime()) .append("createBy", getCreateBy()) .toString(); } } ycl-pojo/src/main/java/com/ycl/platform/domain/entity/YwUnit.java
@@ -46,5 +46,4 @@ @TableField("remark") private String remark; } ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckTemplateVO.java
@@ -39,7 +39,8 @@ /** 规则列表 */ private List<RuleItemVO> ruleFormList; /** 单位名 */ private String unitName; public static CheckTemplateVO getVoByEntity(@NonNull CheckTemplate entity, CheckTemplateVO vo) { if(vo == null) { vo = new CheckTemplateVO(); ycl-pojo/src/main/java/com/ycl/platform/domain/vo/TExamineScoreVO.java
New file @@ -0,0 +1,130 @@ package com.ycl.platform.domain.vo; import annotation.Excel; import com.ycl.system.entity.BaseEntity; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import java.math.BigDecimal; /** * 考核计分对象 t_examine_score * * @author ruoyi * @date 2024-03-13 */ public class TExamineScoreVO extends BaseEntity { private static final long serialVersionUID = 1L; /** $column.columnComment */ private Long id; /** 分值 */ @Excel(name = "分值") private BigDecimal score; /** 单位id */ @Excel(name = "单位id") private Long unitId; /** 考核id */ @Excel(name = "考核id") private Long examineId; /** 操作类型 1/2 系统打分/人工打分 */ @Excel(name = "操作类型 1/2 系统打分/人工打分") private Long operateCategory; /** 积分类型 */ @Excel(name = "积分类型") private Long scoreCategory; private String unitName; private String examineName; public String getUnitName() { return unitName; } public void setUnitName(String unitName) { this.unitName = unitName; } 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 setScore(BigDecimal score) { this.score = score; } public BigDecimal getScore() { return score; } public void setUnitId(Long unitId) { this.unitId = unitId; } public Long getUnitId() { return unitId; } public void setExamineId(Long examineId) { this.examineId = examineId; } public Long getExamineId() { return examineId; } public void setOperateCategory(Long operateCategory) { this.operateCategory = operateCategory; } public Long getOperateCategory() { return operateCategory; } public void setScoreCategory(Long scoreCategory) { this.scoreCategory = scoreCategory; } public Long getScoreCategory() { return scoreCategory; } @Override public String toString() { return "TExamineScoreVO{" + "id=" + id + ", score=" + score + ", unitId=" + unitId + ", examineId=" + examineId + ", operateCategory=" + operateCategory + ", scoreCategory=" + scoreCategory + ", unitName='" + unitName + '\'' + ", examineName='" + examineName + '\'' + '}'; } } ycl-server/src/main/java/com/ycl/platform/controller/TCheckPublishController.java
@@ -4,10 +4,12 @@ import com.ycl.platform.domain.entity.TCheckPublish; import com.ycl.platform.service.ITCheckPublishService; import com.ycl.system.AjaxResult; import com.ycl.system.Result; import com.ycl.system.controller.BaseController; import com.ycl.system.page.TableDataInfo; import com.ycl.utils.poi.ExcelUtil; import enumeration.BusinessType; import io.swagger.annotations.ApiOperation; import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -95,4 +97,10 @@ { return toAjax(tCheckPublishService.deleteTCheckPublishByIds(ids)); } @GetMapping("/all") @ApiOperation(value = "下拉列表", notes = "下拉列表") public Result all() { return tCheckPublishService.all(); } } ycl-server/src/main/java/com/ycl/platform/controller/TExamineScoreController.java
New file @@ -0,0 +1,99 @@ package com.ycl.platform.controller; import annotation.Log; import com.ycl.platform.domain.entity.TExamineScore; import com.ycl.platform.domain.vo.TExamineScoreVO; import com.ycl.platform.service.ITExamineScoreService; 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-13 */ @RestController @RequestMapping("/platform/score") public class TExamineScoreController extends BaseController { @Autowired private ITExamineScoreService tExamineScoreService; /** * 查询考核计分列表 */ @PreAuthorize("@ss.hasPermi('platform:score:list')") @GetMapping("/list") public TableDataInfo list(TExamineScore tExamineScore) { startPage(); List<TExamineScoreVO> list = tExamineScoreService.selectTExamineScoreList(tExamineScore); return getDataTable(list); } /** * 导出考核计分列表 */ @PreAuthorize("@ss.hasPermi('platform:score:export')") @Log(title = "考核计分", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TExamineScore tExamineScore) { List<TExamineScoreVO> list = tExamineScoreService.selectTExamineScoreList(tExamineScore); ExcelUtil<TExamineScoreVO> util = new ExcelUtil<TExamineScoreVO>(TExamineScoreVO.class); util.exportExcel(response, list, "考核计分数据"); } /** * 获取考核计分详细信息 */ @PreAuthorize("@ss.hasPermi('platform:score:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(tExamineScoreService.selectTExamineScoreById(id)); } /** * 新增考核计分 */ @PreAuthorize("@ss.hasPermi('platform:score:add')") @Log(title = "考核计分", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TExamineScore tExamineScore) { return toAjax(tExamineScoreService.insertTExamineScore(tExamineScore)); } /** * 修改考核计分 */ @PreAuthorize("@ss.hasPermi('platform:score:edit')") @Log(title = "考核计分", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TExamineScore tExamineScore) { return toAjax(tExamineScoreService.updateTExamineScore(tExamineScore)); } /** * 删除考核计分 */ @PreAuthorize("@ss.hasPermi('platform:score:remove')") @Log(title = "考核计分", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tExamineScoreService.deleteTExamineScoreByIds(ids)); } } ycl-server/src/main/java/com/ycl/platform/mapper/TExamineScoreMapper.java
New file @@ -0,0 +1,63 @@ package com.ycl.platform.mapper; import com.ycl.platform.domain.entity.TExamineScore; import com.ycl.platform.domain.vo.TExamineScoreVO; import java.util.List; /** * 考核计分Mapper接口 * * @author ruoyi * @date 2024-03-13 */ public interface TExamineScoreMapper { /** * 查询考核计分 * * @param id 考核计分主键 * @return 考核计分 */ public TExamineScore selectTExamineScoreById(Long id); /** * 查询考核计分列表 * * @param tExamineScore 考核计分 * @return 考核计分集合 */ public List<TExamineScoreVO> selectTExamineScoreList(TExamineScore tExamineScore); /** * 新增考核计分 * * @param tExamineScore 考核计分 * @return 结果 */ public int insertTExamineScore(TExamineScore tExamineScore); /** * 修改考核计分 * * @param tExamineScore 考核计分 * @return 结果 */ public int updateTExamineScore(TExamineScore tExamineScore); /** * 删除考核计分 * * @param id 考核计分主键 * @return 结果 */ public int deleteTExamineScoreById(Long id); /** * 批量删除考核计分 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteTExamineScoreByIds(Long[] ids); } ycl-server/src/main/java/com/ycl/platform/service/ITCheckPublishService.java
@@ -1,6 +1,7 @@ package com.ycl.platform.service; import com.ycl.platform.domain.entity.TCheckPublish; import com.ycl.system.Result; import java.util.List; @@ -59,4 +60,7 @@ * @return 结果 */ public int deleteTCheckPublishById(Long id); Result all(); } ycl-server/src/main/java/com/ycl/platform/service/ITExamineScoreService.java
New file @@ -0,0 +1,63 @@ package com.ycl.platform.service; import com.ycl.platform.domain.entity.TExamineScore; import com.ycl.platform.domain.vo.TExamineScoreVO; import java.util.List; /** * 考核计分Service接口 * * @author ruoyi * @date 2024-03-13 */ public interface ITExamineScoreService { /** * 查询考核计分 * * @param id 考核计分主键 * @return 考核计分 */ public TExamineScore selectTExamineScoreById(Long id); /** * 查询考核计分列表 * * @param tExamineScore 考核计分 * @return 考核计分集合 */ public List<TExamineScoreVO> selectTExamineScoreList(TExamineScore tExamineScore); /** * 新增考核计分 * * @param tExamineScore 考核计分 * @return 结果 */ public int insertTExamineScore(TExamineScore tExamineScore); /** * 修改考核计分 * * @param tExamineScore 考核计分 * @return 结果 */ public int updateTExamineScore(TExamineScore tExamineScore); /** * 批量删除考核计分 * * @param ids 需要删除的考核计分主键集合 * @return 结果 */ public int deleteTExamineScoreByIds(Long[] ids); /** * 删除考核计分信息 * * @param id 考核计分主键 * @return 结果 */ public int deleteTExamineScoreById(Long id); } ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java
@@ -9,6 +9,7 @@ import com.ycl.platform.mapper.CheckTemplateMapper; import com.ycl.platform.mapper.CheckTemplateRuleMapper; import com.ycl.platform.service.CheckTemplateService; import com.ycl.platform.service.YwUnitService; import com.ycl.system.Result; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ycl.platform.domain.form.CheckTemplateForm; @@ -19,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.ycl.system.page.PageUtil; import com.ycl.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.beans.BeanUtils; @@ -44,7 +46,8 @@ private final CheckTemplateMapper checkTemplateMapper; private final CheckTemplateRuleMapper checkTemplateRuleMapper; @Autowired private YwUnitService unitService; /** * 添加 * @param form @@ -145,6 +148,7 @@ List<CheckTemplateVO> vos = page.getRecords().stream() .map( entity -> CheckTemplateVO.getVoByEntity(entity, null) .setUnitName(unitService.getById(entity.getUnitId()).getUnitName()) ) .collect(Collectors.toList()); return Result.ok().data(vos).total(page.getTotal()); ycl-server/src/main/java/com/ycl/platform/service/impl/TCheckPublishServiceImpl.java
@@ -1,8 +1,11 @@ package com.ycl.platform.service.impl; import com.ycl.platform.base.BaseSelect; import com.ycl.platform.domain.entity.TCheckPublish; import com.ycl.platform.mapper.TCheckPublishMapper; import com.ycl.platform.service.ITCheckPublishService; import com.ycl.system.Result; import com.ycl.system.entity.SysDept; import com.ycl.system.entity.SysUser; import com.ycl.system.mapper.SysUserMapper; import com.ycl.system.model.LoginUser; @@ -13,6 +16,7 @@ import java.util.Date; import java.util.List; import java.util.stream.Collectors; /** * 考核发布Service业务层处理 @@ -110,4 +114,18 @@ { return tCheckPublishMapper.deleteTCheckPublishById(id); } /** * 下拉列表 * */ @Override public Result all() { List<BaseSelect> vos = tCheckPublishMapper.selectTCheckPublishList(new TCheckPublish()).stream().map(checkPublish -> { BaseSelect baseSelect = new BaseSelect(); baseSelect.setId(Integer.parseInt(checkPublish.getId() + "")); baseSelect.setValue(checkPublish.getExamineName()); return baseSelect; } ).collect(Collectors.toList()); return Result.ok().data(vos); } } ycl-server/src/main/java/com/ycl/platform/service/impl/TExamineScoreServiceImpl.java
New file @@ -0,0 +1,99 @@ package com.ycl.platform.service.impl; import com.ycl.platform.domain.entity.TExamineScore; import com.ycl.platform.domain.vo.TExamineScoreVO; import com.ycl.platform.mapper.TExamineScoreMapper; import com.ycl.platform.service.ITExamineScoreService; 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-13 */ @Service public class TExamineScoreServiceImpl implements ITExamineScoreService { @Autowired private TExamineScoreMapper tExamineScoreMapper; /** * 查询考核计分 * * @param id 考核计分主键 * @return 考核计分 */ @Override public TExamineScore selectTExamineScoreById(Long id) { return tExamineScoreMapper.selectTExamineScoreById(id); } /** * 查询考核计分列表 * * @param tExamineScore 考核计分 * @return 考核计分 */ @Override public List<TExamineScoreVO> selectTExamineScoreList(TExamineScore tExamineScore) { return tExamineScoreMapper.selectTExamineScoreList(tExamineScore); } /** * 新增考核计分 * * @param tExamineScore 考核计分 * @return 结果 */ @Override public int insertTExamineScore(TExamineScore tExamineScore) { tExamineScore.setCreateTime(DateUtils.getNowDate()); return tExamineScoreMapper.insertTExamineScore(tExamineScore); } /** * 修改考核计分 * * @param tExamineScore 考核计分 * @return 结果 */ @Override public int updateTExamineScore(TExamineScore tExamineScore) { return tExamineScoreMapper.updateTExamineScore(tExamineScore); } /** * 批量删除考核计分 * * @param ids 需要删除的考核计分主键 * @return 结果 */ @Override public int deleteTExamineScoreByIds(Long[] ids) { return tExamineScoreMapper.deleteTExamineScoreByIds(ids); } /** * 删除考核计分信息 * * @param id 考核计分主键 * @return 结果 */ @Override public int deleteTExamineScoreById(Long id) { return tExamineScoreMapper.deleteTExamineScoreById(id); } } ycl-server/src/main/java/com/ycl/system/controller/SysDeptController.java
@@ -2,10 +2,12 @@ import annotation.Log; import com.ycl.system.AjaxResult; import com.ycl.system.Result; import com.ycl.system.entity.SysDept; import com.ycl.system.service.ISysDeptService; import constant.UserConstants; import enumeration.BusinessType; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -121,4 +123,9 @@ deptService.checkDeptDataScope(deptId); return toAjax(deptService.deleteDeptById(deptId)); } @GetMapping("/all") @ApiOperation(value = "下拉列表", notes = "下拉列表") public Result all() { return deptService.all(); } } ycl-server/src/main/java/com/ycl/system/service/ISysDeptService.java
@@ -1,5 +1,6 @@ package com.ycl.system.service; import com.ycl.system.Result; import com.ycl.system.domain.TreeSelect; import com.ycl.system.entity.SysDept; @@ -122,4 +123,9 @@ * @return 结果 */ public int deleteDeptById(Long deptId); /** * 列表 * @return */ Result all(); } ycl-server/src/main/java/com/ycl/system/service/impl/SysDeptServiceImpl.java
@@ -2,6 +2,8 @@ import annotation.DataScope; import com.ycl.exception.ServiceException; import com.ycl.platform.base.BaseSelect; import com.ycl.system.Result; import com.ycl.system.domain.TreeSelect; import com.ycl.system.entity.SysDept; import com.ycl.system.entity.SysRole; @@ -294,6 +296,18 @@ return deptMapper.deleteDeptById(deptId); } @Override public Result all() { List<BaseSelect> vos = deptMapper.selectDeptList(new SysDept()).stream().map(sysDept -> { BaseSelect baseSelect = new BaseSelect(); baseSelect.setId(Integer.parseInt(sysDept.getDeptId() + "")); baseSelect.setValue(sysDept.getDeptName()); return baseSelect; } ).collect(Collectors.toList()); return Result.ok().data(vos); } /** * 递归列表 */ ycl-server/src/main/resources/mapper/zgyw/TExamineScoreMapper.xml
New file @@ -0,0 +1,87 @@ <?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.TExamineScoreMapper"> <resultMap type="com.ycl.platform.domain.entity.TExamineScore" id="TExamineScoreResult"> <result property="id" column="id" /> <result property="score" column="score" /> <result property="unitId" column="unit_id" /> <result property="examineId" column="examine_id" /> <result property="operateCategory" column="operate_category" /> <result property="scoreCategory" column="score_category" /> <result property="createTime" column="create_time" /> <result property="createBy" column="create_by" /> </resultMap> <sql id="selectTExamineScoreVo"> select id, score, unit_id, examine_id, operate_category, score_category, create_time, create_by from t_examine_score </sql> <select id="selectTExamineScoreList" resultType="com.ycl.platform.domain.vo.TExamineScoreVO"> select tes.id, tes.score, tyu.unit_name, tcp.examine_name, tes.operate_category, tes.score_category,tes.create_time, tes.create_by from t_examine_score tes left join t_check_publish tcp on tes.examine_id = tcp.id left join t_yw_unit tyu on tes.unit_id = tyu.id <where> <if test="score != null "> and score = #{score}</if> <if test="unitId != null "> and unit_id = #{unitId}</if> <if test="examineId != null "> and examine_id = #{examineId}</if> <if test="operateCategory != null "> and operate_category = #{operateCategory}</if> <if test="scoreCategory != null "> and score_category = #{scoreCategory}</if> </where> </select> <select id="selectTExamineScoreById" parameterType="Long" resultMap="TExamineScoreResult"> <include refid="selectTExamineScoreVo"/> where id = #{id} </select> <insert id="insertTExamineScore" useGeneratedKeys="true" keyProperty="id"> insert into t_examine_score <trim prefix="(" suffix=")" suffixOverrides=","> <if test="score != null">score,</if> <if test="unitId != null">unit_id,</if> <if test="examineId != null">examine_id,</if> <if test="operateCategory != null">operate_category,</if> <if test="scoreCategory != null">score_category,</if> <if test="createTime != null">create_time,</if> <if test="createBy != null">create_by,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="score != null">#{score},</if> <if test="unitId != null">#{unitId},</if> <if test="examineId != null">#{examineId},</if> <if test="operateCategory != null">#{operateCategory},</if> <if test="scoreCategory != null">#{scoreCategory},</if> <if test="createTime != null">#{createTime},</if> <if test="createBy != null">#{createBy},</if> </trim> </insert> <update id="updateTExamineScore"> update t_examine_score <trim prefix="SET" suffixOverrides=","> <if test="score != null">score = #{score},</if> <if test="unitId != null">unit_id = #{unitId},</if> <if test="examineId != null">examine_id = #{examineId},</if> <if test="operateCategory != null">operate_category = #{operateCategory},</if> <if test="scoreCategory != null">score_category = #{scoreCategory},</if> <if test="createTime != null">create_time = #{createTime},</if> <if test="createBy != null">create_by = #{createBy},</if> </trim> where id = #{id} </update> <delete id="deleteTExamineScoreById" parameterType="Long"> delete from t_examine_score where id = #{id} </delete> <delete id="deleteTExamineScoreByIds" parameterType="String"> delete from t_examine_score where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper>