zhanghl
2025-05-08 abc451e52a9ded8a18238d6903539fb310c1b256
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
package com.aps.core.controller.basicData;
 
import com.aps.common.core.utils.poi.ExcelUtil;
import com.aps.common.core.web.controller.BaseController;
import com.aps.common.core.web.domain.AjaxResult;
import com.aps.common.core.web.page.TableDataInfo;
import com.aps.common.log.annotation.Log;
import com.aps.common.log.enums.BusinessType;
import com.aps.common.security.annotation.RequiresPermissions;
import com.aps.core.domain.ApsWorkEvent;
import com.aps.core.service.IApsWorkEventService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 事件管理Controller
 * 
 * @author hjy
 * @date 2025-04-21
 */
@RestController
@RequestMapping("/event")
public class ApsWorkEventController extends BaseController
{
    @Autowired
    private IApsWorkEventService apsWorkEventService;
 
    /**
     * 查询事件管理列表
     */
    @RequiresPermissions("basicData:event:list")
    @GetMapping("/list")
    public TableDataInfo list(ApsWorkEvent apsWorkEvent)
    {
        startPage();
        List<ApsWorkEvent> list = apsWorkEventService.selectApsWorkEventList(apsWorkEvent);
        return getDataTable(list);
    }
 
    /**
     * 导出事件管理列表
     */
    @RequiresPermissions("basicData:event:export")
    @Log(title = "事件管理", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsWorkEvent apsWorkEvent)
    {
        List<ApsWorkEvent> list = apsWorkEventService.selectApsWorkEventList(apsWorkEvent);
        ExcelUtil<ApsWorkEvent> util = new ExcelUtil<ApsWorkEvent>(ApsWorkEvent.class);
        util.exportExcel(response, list, "事件管理数据");
    }
 
    /**
     * 获取事件管理详细信息
     */
    @RequiresPermissions("basicData:event:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(apsWorkEventService.selectApsWorkEventById(id));
    }
 
    /**
     * 新增事件管理
     */
    @RequiresPermissions("basicData:event:add")
    @Log(title = "事件管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ApsWorkEvent apsWorkEvent)
    {
        return toAjax(apsWorkEventService.insertApsWorkEvent(apsWorkEvent));
    }
 
    /**
     * 修改事件管理
     */
    @RequiresPermissions("basicData:event:edit")
    @Log(title = "事件管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ApsWorkEvent apsWorkEvent)
    {
        return toAjax(apsWorkEventService.updateApsWorkEvent(apsWorkEvent));
    }
 
    /**
     * 删除事件管理
     */
    @RequiresPermissions("basicData:event:remove")
    @Log(title = "事件管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(apsWorkEventService.deleteApsWorkEventByIds(ids));
    }
}