ZQN
2024-06-20 3467fa64f4be6efc9b742913419e7c3a501c541b
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
93
94
95
96
97
98
99
100
package com.project.admin.controller.enforce;
 
import com.project.common.annotation.Log;
import com.project.common.annotation.RepeatSubmit;
import com.project.common.core.controller.BaseController;
import com.project.common.core.domain.AjaxResult;
import com.project.common.core.page.TableDataInfo;
import com.project.common.enums.BusinessType;
import com.project.common.utils.poi.ExcelUtil;
import com.project.enforce.domain.bo.editBo.EnforcePeerBo;
import com.project.enforce.domain.bo.queryBo.EnforcePeerQueryBo;
import com.project.enforce.domain.vo.EnforcePeerVo;
import com.project.enforce.service.IEnforcePeerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.Arrays;
import java.util.List;
 
/**
 * 执法单同行人Controller
 *
 * @author manton
 */
@Api(value = "执法队员控制器", tags = {"执法单队员管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/enforce/peer")
public class EnforcePeerController extends BaseController {
 
    private final IEnforcePeerService iEnforcePeerService;
 
 
    @ApiOperation("查询执法单队员列表")
    @GetMapping("/list")
    public TableDataInfo list(EnforcePeerQueryBo bo)
    {
        startPage();
        List<EnforcePeerVo> list = iEnforcePeerService.queryList(bo);
        return getDataTable(list);
    }
 
 
 
    @ApiOperation("导出执法单队员列表")
    //@PreAuthorize("@ss.hasPermi('enforce:peer:export')")
    @Log(title = "执法单同行人", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    @RepeatSubmit
    public AjaxResult export(EnforcePeerQueryBo bo)
    {
        List<EnforcePeerVo> list = iEnforcePeerService.queryList(bo);
        ExcelUtil<EnforcePeerVo> util = new ExcelUtil<EnforcePeerVo>(EnforcePeerVo.class);
        return util.exportExcel(list, "执法单同行人");
    }
 
 
    @ApiOperation("获取执法单队员详细信息")
    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable("id" ) Long id)
    {
        return AjaxResult.success(iEnforcePeerService.queryById(id));
    }
 
 
    @ApiOperation("新增执法单队员")
    //@PreAuthorize("@ss.hasPermi('enforce:peer:add')")
    @Log(title = "执法单队员", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @RepeatSubmit
    public AjaxResult add(@RequestBody EnforcePeerBo bo)
    {
        return toAjax(iEnforcePeerService.insertByBo(bo) ? 1 : 0);
    }
 
 
    @ApiOperation("修改执法单队员")
    //@PreAuthorize("@ss.hasPermi('enforce:peer:edit')")
    @Log(title = "执法单队员", businessType = BusinessType.UPDATE)
    @PostMapping("/upd")
    @RepeatSubmit
    public AjaxResult upd(@RequestBody EnforcePeerBo bo)
    {
        return toAjax(iEnforcePeerService.updateByBo(bo) ? 1 : 0);
    }
 
 
    @ApiOperation("删除执法单队员")
    //@PreAuthorize("@ss.hasPermi('enforce:peer:remove')")
    @Log(title = "执法单队员" , businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    @RepeatSubmit
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(iEnforcePeerService.deleteByIds(Arrays.asList(ids)) ? 1 : 0);
    }
}