lohir
2024-10-24 99cc61dad74f04a7616c3541f5e87762585abb93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.ycl.platform.controller;
 
import annotation.Log;
import com.ycl.platform.domain.entity.CheckRule;
import com.ycl.platform.domain.vo.CheckRuleVO;
import com.ycl.platform.service.ICheckRuleService;
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
import enumeration.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
/**
 * 考核规则Controller
 *
 * @author ruoyi
 * @date 2024-04-15
 */
@RestController
@RequestMapping("/check/rule")
public class CheckRuleController extends BaseController
{
    @Autowired
    private ICheckRuleService checkRuleService;
 
    /**
     * 查询考核规则列表
     */
    @PreAuthorize("@ss.hasPermi('check:rule:list')")
    @GetMapping("/list")
    public AjaxResult list(CheckRule checkRule)
    {
        CheckRuleVO checkRuleVO = checkRuleService.selectCheckRuleList(checkRule);
        return success(checkRuleVO);
    }
 
 
    /**
     * 获取考核规则详细信息
     */
    @PreAuthorize("@ss.hasPermi('check:rule:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(checkRuleService.selectCheckRuleById(id));
    }
 
 
    /**
     * 修改考核规则
     */
    @PreAuthorize("@ss.hasPermi('check:rule:edit')")
    @Log(title = "考核规则", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody CheckRule checkRule)
    {
        return toAjax(checkRuleService.updateCheckRule(checkRule));
    }
 
//    /**
//     * 导出考核规则列表
//     */
//    @PreAuthorize("@ss.hasPermi('check:rule:export')")
//    @Log(title = "考核规则", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, CheckRule checkRule)
//    {
//        List<CheckRule> list = checkRuleService.selectCheckRuleList(checkRule);
//        ExcelUtil<CheckRule> util = new ExcelUtil<CheckRule>(CheckRule.class);
//        util.exportExcel(response, list, "考核规则数据");
//    }
 
//    /**
//     * 新增考核规则
//     */
//    @PreAuthorize("@ss.hasPermi('check:rule:add')")
//    @Log(title = "考核规则", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody CheckRule checkRule)
//    {
//        return toAjax(checkRuleService.insertCheckRule(checkRule));
//    }
}