package com.gkhy.system.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.gkhy.common.annotation.Log; import com.gkhy.common.core.controller.BaseController; import com.gkhy.common.core.domain.AjaxResult; import com.gkhy.common.enums.BusinessType; import com.gkhy.system.domain.Evaluation; import com.gkhy.system.service.IEvaluationService; import com.gkhy.common.utils.poi.ExcelUtil; import com.gkhy.common.core.page.TableDataInfo; /** * 考评管理Controller * * @author expert * @date 2024-11-13 */ @RestController @RequestMapping("/system/evaluation") public class EvaluationController extends BaseController { @Autowired private IEvaluationService evaluationService; /** * 查询考评管理列表 */ @PreAuthorize("@ss.hasPermi('system:evaluation:list')") @GetMapping("/list") public TableDataInfo list(Evaluation evaluation) { startPage(); List list = evaluationService.selectEvaluationList(evaluation); return getDataTable(list); } /** * 导出考评管理列表 */ @PreAuthorize("@ss.hasPermi('system:evaluation:export')") @Log(title = "考评管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, Evaluation evaluation) { List list = evaluationService.selectEvaluationList(evaluation); ExcelUtil util = new ExcelUtil(Evaluation.class); util.exportExcel(response, list, "考评管理数据"); } /** * 获取考评管理详细信息 */ @PreAuthorize("@ss.hasPermi('system:evaluation:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(evaluationService.selectEvaluationById(id)); } /** * 新增考评管理 */ @PreAuthorize("@ss.hasPermi('system:evaluation:add')") @Log(title = "考评管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Evaluation evaluation) { return toAjax(evaluationService.insertEvaluation(evaluation)); } /** * 修改考评管理 */ @PreAuthorize("@ss.hasPermi('system:evaluation:edit')") @Log(title = "考评管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody Evaluation evaluation) { return toAjax(evaluationService.updateEvaluation(evaluation)); } /** * 删除考评管理 */ @PreAuthorize("@ss.hasPermi('system:evaluation:remove')") @Log(title = "考评管理", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(evaluationService.deleteEvaluationByIds(ids)); } }