|
|
package com.ruoyi.catdog.controller;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
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.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
import com.ruoyi.catdog.domain.Examination;
|
|
|
import com.ruoyi.catdog.service.IExaminationService;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
|
/**
|
|
|
* 考核Controller
|
|
|
*
|
|
|
* @author ruoyi
|
|
|
* @date 2025-03-02
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/catdog/examination")
|
|
|
public class ExaminationController extends BaseController
|
|
|
{
|
|
|
@Autowired
|
|
|
private IExaminationService examinationService;
|
|
|
|
|
|
/**
|
|
|
* 查询考核列表
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('catdog:examination:list')")
|
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(Examination examination)
|
|
|
{
|
|
|
startPage();
|
|
|
List<Examination> list = examinationService.selectExaminationList(examination);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导出考核列表
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('catdog:examination:export')")
|
|
|
@Log(title = "考核", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
public void export(HttpServletResponse response, Examination examination) throws IOException {
|
|
|
List<Examination> list = examinationService.selectExaminationList(examination);
|
|
|
ExcelUtil<Examination> util = new ExcelUtil<Examination>(Examination.class);
|
|
|
util.exportExcel(response, list, "考核数据");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取考核详细信息
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('catdog:examination:query')")
|
|
|
@GetMapping(value = "/{examinationId}")
|
|
|
public AjaxResult getInfo(@PathVariable("examinationId") Long examinationId)
|
|
|
{
|
|
|
// return success(examinationService.selectExaminationByExaminationId(examinationId));
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新增考核
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('catdog:examination:add')")
|
|
|
@Log(title = "考核", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody Examination examination)
|
|
|
{
|
|
|
return toAjax(examinationService.insertExamination(examination));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改考核
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('catdog:examination:edit')")
|
|
|
@Log(title = "考核", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody Examination examination)
|
|
|
{
|
|
|
return toAjax(examinationService.updateExamination(examination));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除考核
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('catdog:examination:remove')")
|
|
|
@Log(title = "考核", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{examinationIds}")
|
|
|
public AjaxResult remove(@PathVariable Long[] examinationIds)
|
|
|
{
|
|
|
return toAjax(examinationService.deleteExaminationByExaminationIds(examinationIds));
|
|
|
}
|
|
|
}
|