From 93087be053dca7ea0ebe8f5bbd28e26098d87ddc Mon Sep 17 00:00:00 2001 From: hshansha Date: Sat, 5 Jul 2025 11:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=80=83=E6=A0=B8=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/KhKhrwResultController.java | 104 ++++++ .../com/ruoyi/kaohe/domain/KhKhrwResult.java | 118 +++++++ .../kaohe/mapper/KhKhrwResultMapper.java | 61 ++++ .../kaohe/service/IKhKhrwResultService.java | 61 ++++ .../service/impl/KhKhrwResultServiceImpl.java | 96 ++++++ .../mapper/kaohe/KhKhrwResultMapper.xml | 96 ++++++ ruoyi-ui/src/api/kaohe/kh_result.js | 44 +++ ruoyi-ui/src/views/kaohe/kh_result/index.vue | 297 ++++++++++++++++++ 8 files changed, 877 insertions(+) create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhKhrwResultController.java create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhKhrwResult.java create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/mapper/KhKhrwResultMapper.java create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/IKhKhrwResultService.java create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/impl/KhKhrwResultServiceImpl.java create mode 100644 ruoyi-kaohe/src/main/resources/mapper/kaohe/KhKhrwResultMapper.xml create mode 100644 ruoyi-ui/src/api/kaohe/kh_result.js create mode 100644 ruoyi-ui/src/views/kaohe/kh_result/index.vue diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhKhrwResultController.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhKhrwResultController.java new file mode 100644 index 0000000..bb733fe --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhKhrwResultController.java @@ -0,0 +1,104 @@ +package com.ruoyi.kaohe.controller; + +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.kaohe.domain.KhKhrwResult; +import com.ruoyi.kaohe.service.IKhKhrwResultService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 考核结果Controller + * + * @author hs + * @date 2025-07-05 + */ +@RestController +@RequestMapping("/kaohe/kh_result") +public class KhKhrwResultController extends BaseController +{ + @Autowired + private IKhKhrwResultService khKhrwResultService; + + /** + * 查询考核结果列表 + */ + @PreAuthorize("@ss.hasPermi('kaohe:kh_result:list')") + @GetMapping("/list") + public TableDataInfo list(KhKhrwResult khKhrwResult) + { + startPage(); + List list = khKhrwResultService.selectKhKhrwResultList(khKhrwResult); + return getDataTable(list); + } + + /** + * 导出考核结果列表 + */ + @PreAuthorize("@ss.hasPermi('kaohe:kh_result:export')") + @Log(title = "考核结果", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, KhKhrwResult khKhrwResult) + { + List list = khKhrwResultService.selectKhKhrwResultList(khKhrwResult); + ExcelUtil util = new ExcelUtil(KhKhrwResult.class); + util.exportExcel(response, list, "考核结果数据"); + } + + /** + * 获取考核结果详细信息 + */ + @PreAuthorize("@ss.hasPermi('kaohe:kh_result:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(khKhrwResultService.selectKhKhrwResultById(id)); + } + + /** + * 新增考核结果 + */ + @PreAuthorize("@ss.hasPermi('kaohe:kh_result:add')") + @Log(title = "考核结果", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody KhKhrwResult khKhrwResult) + { + return toAjax(khKhrwResultService.insertKhKhrwResult(khKhrwResult)); + } + + /** + * 修改考核结果 + */ + @PreAuthorize("@ss.hasPermi('kaohe:kh_result:edit')") + @Log(title = "考核结果", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody KhKhrwResult khKhrwResult) + { + return toAjax(khKhrwResultService.updateKhKhrwResult(khKhrwResult)); + } + + /** + * 删除考核结果 + */ + @PreAuthorize("@ss.hasPermi('kaohe:kh_result:remove')") + @Log(title = "考核结果", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(khKhrwResultService.deleteKhKhrwResultByIds(ids)); + } +} diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhKhrwResult.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhKhrwResult.java new file mode 100644 index 0000000..ae57b4d --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhKhrwResult.java @@ -0,0 +1,118 @@ +package com.ruoyi.kaohe.domain; + +import java.math.BigDecimal; +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; + +/** + * 考核结果对象 kh_khrw_result + * + * @author hs + * @date 2025-07-05 + */ +public class KhKhrwResult extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 考核任务id */ + @Excel(name = "考核任务id") + private Long khrwId; + + /** 考核任务名称 */ + @Excel(name = "考核任务名称") + private String khrwName; + + /** 表头 */ + @Excel(name = "表头") + private String tableHeader; + + /** 表数据 */ + @Excel(name = "表数据") + private String tableData; + + /** 得分 */ + @Excel(name = "得分") + private BigDecimal endScore; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setKhrwId(Long khrwId) + { + this.khrwId = khrwId; + } + + public Long getKhrwId() + { + return khrwId; + } + + public void setKhrwName(String khrwName) + { + this.khrwName = khrwName; + } + + public String getKhrwName() + { + return khrwName; + } + + public void setTableHeader(String tableHeader) + { + this.tableHeader = tableHeader; + } + + public String getTableHeader() + { + return tableHeader; + } + + public void setTableData(String tableData) + { + this.tableData = tableData; + } + + public String getTableData() + { + return tableData; + } + + public void setEndScore(BigDecimal endScore) + { + this.endScore = endScore; + } + + public BigDecimal getEndScore() + { + return endScore; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("khrwId", getKhrwId()) + .append("khrwName", getKhrwName()) + .append("tableHeader", getTableHeader()) + .append("tableData", getTableData()) + .append("endScore", getEndScore()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/mapper/KhKhrwResultMapper.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/mapper/KhKhrwResultMapper.java new file mode 100644 index 0000000..1962966 --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/mapper/KhKhrwResultMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.kaohe.mapper; + +import java.util.List; +import com.ruoyi.kaohe.domain.KhKhrwResult; + +/** + * 考核结果Mapper接口 + * + * @author hs + * @date 2025-07-05 + */ +public interface KhKhrwResultMapper +{ + /** + * 查询考核结果 + * + * @param id 考核结果主键 + * @return 考核结果 + */ + public KhKhrwResult selectKhKhrwResultById(Long id); + + /** + * 查询考核结果列表 + * + * @param khKhrwResult 考核结果 + * @return 考核结果集合 + */ + public List selectKhKhrwResultList(KhKhrwResult khKhrwResult); + + /** + * 新增考核结果 + * + * @param khKhrwResult 考核结果 + * @return 结果 + */ + public int insertKhKhrwResult(KhKhrwResult khKhrwResult); + + /** + * 修改考核结果 + * + * @param khKhrwResult 考核结果 + * @return 结果 + */ + public int updateKhKhrwResult(KhKhrwResult khKhrwResult); + + /** + * 删除考核结果 + * + * @param id 考核结果主键 + * @return 结果 + */ + public int deleteKhKhrwResultById(Long id); + + /** + * 批量删除考核结果 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteKhKhrwResultByIds(Long[] ids); +} diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/IKhKhrwResultService.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/IKhKhrwResultService.java new file mode 100644 index 0000000..fbefebe --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/IKhKhrwResultService.java @@ -0,0 +1,61 @@ +package com.ruoyi.kaohe.service; + +import java.util.List; +import com.ruoyi.kaohe.domain.KhKhrwResult; + +/** + * 考核结果Service接口 + * + * @author hs + * @date 2025-07-05 + */ +public interface IKhKhrwResultService +{ + /** + * 查询考核结果 + * + * @param id 考核结果主键 + * @return 考核结果 + */ + public KhKhrwResult selectKhKhrwResultById(Long id); + + /** + * 查询考核结果列表 + * + * @param khKhrwResult 考核结果 + * @return 考核结果集合 + */ + public List selectKhKhrwResultList(KhKhrwResult khKhrwResult); + + /** + * 新增考核结果 + * + * @param khKhrwResult 考核结果 + * @return 结果 + */ + public int insertKhKhrwResult(KhKhrwResult khKhrwResult); + + /** + * 修改考核结果 + * + * @param khKhrwResult 考核结果 + * @return 结果 + */ + public int updateKhKhrwResult(KhKhrwResult khKhrwResult); + + /** + * 批量删除考核结果 + * + * @param ids 需要删除的考核结果主键集合 + * @return 结果 + */ + public int deleteKhKhrwResultByIds(Long[] ids); + + /** + * 删除考核结果信息 + * + * @param id 考核结果主键 + * @return 结果 + */ + public int deleteKhKhrwResultById(Long id); +} diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/impl/KhKhrwResultServiceImpl.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/impl/KhKhrwResultServiceImpl.java new file mode 100644 index 0000000..898aa2e --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/impl/KhKhrwResultServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.kaohe.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.kaohe.mapper.KhKhrwResultMapper; +import com.ruoyi.kaohe.domain.KhKhrwResult; +import com.ruoyi.kaohe.service.IKhKhrwResultService; + +/** + * 考核结果Service业务层处理 + * + * @author hs + * @date 2025-07-05 + */ +@Service +public class KhKhrwResultServiceImpl implements IKhKhrwResultService +{ + @Autowired + private KhKhrwResultMapper khKhrwResultMapper; + + /** + * 查询考核结果 + * + * @param id 考核结果主键 + * @return 考核结果 + */ + @Override + public KhKhrwResult selectKhKhrwResultById(Long id) + { + return khKhrwResultMapper.selectKhKhrwResultById(id); + } + + /** + * 查询考核结果列表 + * + * @param khKhrwResult 考核结果 + * @return 考核结果 + */ + @Override + public List selectKhKhrwResultList(KhKhrwResult khKhrwResult) + { + return khKhrwResultMapper.selectKhKhrwResultList(khKhrwResult); + } + + /** + * 新增考核结果 + * + * @param khKhrwResult 考核结果 + * @return 结果 + */ + @Override + public int insertKhKhrwResult(KhKhrwResult khKhrwResult) + { + khKhrwResult.setCreateTime(DateUtils.getNowDate()); + return khKhrwResultMapper.insertKhKhrwResult(khKhrwResult); + } + + /** + * 修改考核结果 + * + * @param khKhrwResult 考核结果 + * @return 结果 + */ + @Override + public int updateKhKhrwResult(KhKhrwResult khKhrwResult) + { + khKhrwResult.setUpdateTime(DateUtils.getNowDate()); + return khKhrwResultMapper.updateKhKhrwResult(khKhrwResult); + } + + /** + * 批量删除考核结果 + * + * @param ids 需要删除的考核结果主键 + * @return 结果 + */ + @Override + public int deleteKhKhrwResultByIds(Long[] ids) + { + return khKhrwResultMapper.deleteKhKhrwResultByIds(ids); + } + + /** + * 删除考核结果信息 + * + * @param id 考核结果主键 + * @return 结果 + */ + @Override + public int deleteKhKhrwResultById(Long id) + { + return khKhrwResultMapper.deleteKhKhrwResultById(id); + } +} diff --git a/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhKhrwResultMapper.xml b/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhKhrwResultMapper.xml new file mode 100644 index 0000000..887021b --- /dev/null +++ b/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhKhrwResultMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + select id, khrw_id, khrw_name, table_header, table_data, end_score, create_by, create_time, update_by, update_time, remark from kh_khrw_result + + + + + + + + insert into kh_khrw_result + + khrw_id, + khrw_name, + table_header, + table_data, + end_score, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{khrwId}, + #{khrwName}, + #{tableHeader}, + #{tableData}, + #{endScore}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update kh_khrw_result + + khrw_id = #{khrwId}, + khrw_name = #{khrwName}, + table_header = #{tableHeader}, + table_data = #{tableData}, + end_score = #{endScore}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from kh_khrw_result where id = #{id} + + + + delete from kh_khrw_result where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/kaohe/kh_result.js b/ruoyi-ui/src/api/kaohe/kh_result.js new file mode 100644 index 0000000..a2827d2 --- /dev/null +++ b/ruoyi-ui/src/api/kaohe/kh_result.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询考核结果列表 +export function listKh_result(query) { + return request({ + url: '/kaohe/kh_result/list', + method: 'get', + params: query + }) +} + +// 查询考核结果详细 +export function getKh_result(id) { + return request({ + url: '/kaohe/kh_result/' + id, + method: 'get' + }) +} + +// 新增考核结果 +export function addKh_result(data) { + return request({ + url: '/kaohe/kh_result', + method: 'post', + data: data + }) +} + +// 修改考核结果 +export function updateKh_result(data) { + return request({ + url: '/kaohe/kh_result', + method: 'put', + data: data + }) +} + +// 删除考核结果 +export function delKh_result(id) { + return request({ + url: '/kaohe/kh_result/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/kaohe/kh_result/index.vue b/ruoyi-ui/src/views/kaohe/kh_result/index.vue new file mode 100644 index 0000000..a0b0600 --- /dev/null +++ b/ruoyi-ui/src/views/kaohe/kh_result/index.vue @@ -0,0 +1,297 @@ + + +