| | |
| | | |
| | | 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 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-04-01 |
| | | * @date 2024-04-15 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/check/rule") |
| | |
| | | /** |
| | | * 查询考核规则列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:rule:list')") |
| | | @PreAuthorize("@ss.hasPermi('check:rule:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(CheckRule checkRule) |
| | | public AjaxResult list(CheckRule checkRule) |
| | | { |
| | | startPage(); |
| | | List<CheckRule> list = checkRuleService.selectCheckRuleList(checkRule); |
| | | return getDataTable(list); |
| | | CheckRuleVO checkRuleVO = checkRuleService.selectCheckRuleList(checkRule); |
| | | return success(checkRuleVO); |
| | | } |
| | | |
| | | /** |
| | | * 导出考核规则列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system: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('system:rule:query')") |
| | | @PreAuthorize("@ss.hasPermi('check:rule:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(checkRuleService.selectCheckRuleById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增考核规则 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:rule:add')") |
| | | @Log(title = "考核规则", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody CheckRule checkRule) |
| | | { |
| | | return toAjax(checkRuleService.insertCheckRule(checkRule)); |
| | | } |
| | | |
| | | /** |
| | | * 修改考核规则 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:rule:edit')") |
| | | @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('system:rule:remove')") |
| | | @Log(title = "考核规则", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(checkRuleService.deleteCheckRuleByIds(ids)); |
| | | } |
| | | // /** |
| | | // * 导出考核规则列表 |
| | | // */ |
| | | // @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)); |
| | | // } |
| | | } |