教育训练处考试制证系统后端
heheng
2025-02-20 d8aecbc76a43af6dfedf50f481d2b0838841782f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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")
    @ApiOperation(value = "查询非煤工种类别列表")
    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));
    }
}