heheng
2024-11-26 c9d2e60f7d1a5cfe9e5b2da93af4d9edeecf5577
expert-admin/src/main/java/com/gkhy/web/controller/bussiness/EvaluationController.java
@@ -1,104 +1,78 @@
package com.gkhy.system.controller;
package com.gkhy.web.controller.bussiness;
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.common.core.page.TableDataInfo;
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;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * 考评管理Controller
 *
 *
 * @author expert
 * @date 2024-11-13
 */
@RestController
@Api(tags = "考评管理-考评管理前端控制器")
@RequestMapping("/system/evaluation")
public class EvaluationController extends BaseController
{
public class EvaluationController extends BaseController {
    @Autowired
    private IEvaluationService evaluationService;
    /**
     * 查询考评管理列表
     */
    @PreAuthorize("@ss.hasPermi('system:evaluation:list')")
    //@PreAuthorize("@ss.hasPermi('system:evaluation:list')")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10,最大50")
    })
    @ApiOperation(value = "考评管理列表")
    @GetMapping("/list")
    public TableDataInfo list(Evaluation evaluation)
    {
    public TableDataInfo list(Evaluation evaluation) {
        startPage();
        List<Evaluation> 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<Evaluation> list = evaluationService.selectEvaluationList(evaluation);
        ExcelUtil<Evaluation> util = new ExcelUtil<Evaluation>(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)
    {
    // @PreAuthorize("@ss.hasPermi('system:evaluation:add')")
    @PostMapping("/add")
    @ApiOperation(value = "新增考评管理")
    public AjaxResult add(@Validated @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)
    {
    //@PreAuthorize("@ss.hasPermi('system:evaluation:edit')")
    @PutMapping("/edit")
    @ApiOperation(value = "修改考评管理")
    public AjaxResult edit(@Validated @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)
    {
    //@PreAuthorize("@ss.hasPermi('system:evaluation:remove')")
    @DeleteMapping("/{ids}")
    @ApiOperation(value = "删除考评管理")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(evaluationService.deleteEvaluationByIds(ids));
    }
}