| | |
| | | package com.ycl.platform.controller; |
| | | |
| | | import annotation.Log; |
| | | import com.ycl.platform.domain.entity.CheckResult; |
| | | import com.ycl.platform.service.ICheckResultService; |
| | | 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 com.ycl.platform.domain.form.ManualScoreForm; |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import com.ycl.platform.service.CheckResultService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.platform.domain.form.CheckResultForm; |
| | | import com.ycl.platform.domain.query.CheckResultQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考核结果Controller |
| | | * 考核结果 前端控制器 |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | * @author xp |
| | | * @since 2024-03-07 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "考核结果", tags = "考核结果管理") |
| | | @RestController |
| | | @RequestMapping("/check/result") |
| | | public class CheckResultController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ICheckResultService checkResultService; |
| | | @RequestMapping("/check-result") |
| | | public class CheckResultController { |
| | | |
| | | /** |
| | | * 查询考核结果列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:result:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(CheckResult checkResult) |
| | | { |
| | | startPage(); |
| | | List<CheckResult> list = checkResultService.selectCheckResultList(checkResult); |
| | | return getDataTable(list); |
| | | } |
| | | private final CheckResultService checkResultService; |
| | | |
| | | /** |
| | | * 导出考核结果列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:result:export')") |
| | | @Log(title = "考核结果", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, CheckResult checkResult) |
| | | { |
| | | List<CheckResult> list = checkResultService.selectCheckResultList(checkResult); |
| | | ExcelUtil<CheckResult> util = new ExcelUtil<CheckResult>(CheckResult.class); |
| | | util.exportExcel(response, list, "考核结果数据"); |
| | | } |
| | | |
| | | /** |
| | | * 获取考核结果详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:result:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(checkResultService.selectCheckResultById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增考核结果 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:result:add')") |
| | | @Log(title = "考核结果", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody CheckResult checkResult) |
| | | { |
| | | return toAjax(checkResultService.insertCheckResult(checkResult)); |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) CheckResultForm form) { |
| | | return checkResultService.add(form); |
| | | } |
| | | |
| | | /** |
| | | * 修改考核结果 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:result:edit')") |
| | | @Log(title = "考核结果", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody CheckResult checkResult) |
| | | { |
| | | return toAjax(checkResultService.updateCheckResult(checkResult)); |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) CheckResultForm form) { |
| | | return checkResultService.update(form); |
| | | } |
| | | |
| | | /** |
| | | * 删除考核结果 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:result:remove')") |
| | | @Log(title = "考核结果", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(checkResultService.deleteCheckResultByIds(ids)); |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return checkResultService.removeById(id); |
| | | } |
| | | |
| | | @PutMapping("/publish/{id}") |
| | | @ApiOperation(value = "ID发布", notes = "ID发布") |
| | | public Result publishById(@PathVariable("id") String id) { |
| | | return checkResultService.publishById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return checkResultService.remove(ids); |
| | | } |
| | | |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(@RequestBody CheckResultQuery query) { |
| | | return checkResultService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return checkResultService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return checkResultService.all(); |
| | | } |
| | | |
| | | @PostMapping("/manual-score") |
| | | @ApiOperation(value = "人工打分", notes = "人工打分") |
| | | public Result manualScore(@RequestBody ManualScoreForm form) { |
| | | return checkResultService.manualScore(form); |
| | | } |
| | | } |