package com.gkhy.exam.pay.controller;
|
|
import com.gkhy.exam.pay.entity.NonCoalCategory;
|
import com.gkhy.exam.pay.service.NonCoalCategoryService;
|
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
|
/**
|
* 非煤工种类别Controller
|
*
|
* @author hh
|
* @date 2025-01-16
|
*/
|
@RestController
|
@Api(tags = "非煤工种类别管理")
|
@RequestMapping("/pay/nonCoalCategory")
|
public class NonCoalCategoryController extends BaseController {
|
@Autowired
|
private NonCoalCategoryService nonCoalCategoryService;
|
|
/**
|
* 查询非煤工种类别列表
|
*/
|
@GetMapping("/list")
|
public TableDataInfo list(NonCoalCategory nonCoalCategory) {
|
startPage();
|
List<NonCoalCategory> list = nonCoalCategoryService.selectNonCoalCategoryList(nonCoalCategory);
|
return getDataTable(list);
|
}
|
|
// /**
|
// * 导出非煤工种类别列表
|
// */
|
// @PreAuthorize("@ss.hasPermi('exam:category:export')")
|
// @PostMapping("/export")
|
// public void export(HttpServletResponse response, NonCoalCategory nonCoalCategory) {
|
// List<NonCoalCategory> list = nonCoalCategoryService.selectNonCoalCategoryList(nonCoalCategory);
|
// ExcelUtil<NonCoalCategory> util = new ExcelUtil<NonCoalCategory>(NonCoalCategory.class);
|
// util.exportExcel(response, list, "非煤工种类别数据");
|
// }
|
|
/**
|
* 获取非煤工种类别详细信息
|
*/
|
|
@GetMapping(value = "/{id}")
|
@ApiOperation(value = "获取非煤工种类别详细信息", httpMethod = "GET")
|
@ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "id", required = true)
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
return success(nonCoalCategoryService.selectNonCoalCategoryById(id));
|
}
|
|
/**
|
* 新增非煤工种类别
|
*/
|
|
@PostMapping("/add")
|
@ApiOperation(value = "新增非煤工种类别")
|
public AjaxResult add(@Validated @RequestBody NonCoalCategory nonCoalCategory) {
|
return toAjax(nonCoalCategoryService.insertNonCoalCategory(nonCoalCategory));
|
}
|
|
/**
|
* 修改非煤工种类别
|
*/
|
|
@PostMapping("/edit")
|
@ApiOperation(value = "修改非煤工种类别")
|
public AjaxResult edit(@Validated @RequestBody NonCoalCategory nonCoalCategory) {
|
return toAjax(nonCoalCategoryService.updateNonCoalCategory(nonCoalCategory));
|
}
|
|
/**
|
* 删除非煤工种类别
|
*/
|
@DeleteMapping("/{ids}")
|
@ApiOperation(value = "删除非煤工种类别")
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
return toAjax(nonCoalCategoryService.deleteNonCoalCategoryByIds(ids));
|
}
|
}
|