| | |
| | | package com.ycl.platform.controller; |
| | | |
| | | import annotation.Log; |
| | | import com.ycl.exception.job.TaskException; |
| | | import com.ycl.platform.domain.entity.CheckTemplate; |
| | | import com.ycl.platform.domain.entity.CheckTemplateRule; |
| | | import com.ycl.platform.domain.query.CheckTemplateQuery; |
| | |
| | | import com.ycl.system.page.TableDataInfo; |
| | | import enumeration.BusinessType; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.quartz.SchedulerException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | @PreAuthorize("@ss.hasPermi('check:template:add')") |
| | | @Log(title = "新增考核模板", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody @Validated CheckTemplateQuery checkTemplateDTO) |
| | | { |
| | | public AjaxResult add(@RequestBody @Validated CheckTemplateQuery checkTemplateDTO) throws SchedulerException, TaskException { |
| | | |
| | | return toAjax(checkTemplateService.insertCheckTemplate(checkTemplateDTO)); |
| | | } |
| | |
| | | @PreAuthorize("@ss.hasPermi('check:template:copy')") |
| | | @Log(title = "复制考核模板", businessType = BusinessType.INSERT) |
| | | @PostMapping("/copy") |
| | | public AjaxResult copy(@RequestBody CheckTemplateQuery checkTemplateDTO) |
| | | { |
| | | public AjaxResult copy(@RequestBody CheckTemplateQuery checkTemplateDTO) throws SchedulerException, TaskException { |
| | | return toAjax(checkTemplateService.copyCheckTemplate(checkTemplateDTO)); |
| | | } |
| | | |
| | |
| | | @PreAuthorize("@ss.hasPermi('check:template:edit')") |
| | | @Log(title = "修改考核模板", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody CheckTemplateQuery checkTemplateDTO) |
| | | { |
| | | public AjaxResult edit(@RequestBody CheckTemplateQuery checkTemplateDTO) throws SchedulerException, TaskException { |
| | | return checkTemplateService.updateCheckTemplate(checkTemplateDTO); |
| | | } |
| | | |
| | |
| | | @PutMapping("/weight") |
| | | public AjaxResult editWeight(@RequestBody CheckTemplateRule checkTemplateRule) |
| | | { |
| | | |
| | | return toAjax(checkTemplateRuleService.updateCheckTemplateRule(checkTemplateRule)); |
| | | } |
| | | /** |
| | |
| | | @PreAuthorize("@ss.hasPermi('check:template:remove')") |
| | | @Log(title = "删除考核模板", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable String id) |
| | | { |
| | | public AjaxResult remove(@PathVariable String id) throws SchedulerException { |
| | | return toAjax(checkTemplateService.deleteCheckTemplateById(Integer.parseInt(id))); |
| | | } |
| | | |