sfd
2025-05-19 930780a650df99ccf1e6e48ee3a2242a1af22746
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package com.aps.core.controller.mainPlan;
 
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.core.domain.ApsPlanCycle;
import com.aps.core.domain.ApsPlanManagement;
import com.aps.core.service.IApsPlanManagementService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 计划管理Controller
 * 
 * @author sfd
 * @date 2025-05-13
 */
 
@Tag(name = "计划管理", description = "计划管理接口")
@RestController
@RequestMapping("/apsPlanManagement")
public class ApsPlanManagementController extends BaseController
{
    @Autowired
    private IApsPlanManagementService apsPlanManagementService;
 
    /**
     * 查询计划管理列表
     */
    @Operation(summary = "查询计划管理列表", description = "分页查询")
//    @RequiresPermissions("aps:management:list")
    @GetMapping("/list")
    public TableDataInfo list(ApsPlanManagement apsPlanManagement)
    {
        startPage();
        List<ApsPlanManagement> list = apsPlanManagementService.selectApsPlanManagementList(apsPlanManagement);
        return getDataTable(list);
    }
 
    /**
     * 导出计划管理列表
     */
    @Operation(summary = "导出计划管理列表", description = "导出")
//    @RequiresPermissions("aps:management:export")
    @Log(title = "导出计划管理列表", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsPlanManagement apsPlanManagement)
    {
        List<ApsPlanManagement> list = apsPlanManagementService.selectApsPlanManagementList(apsPlanManagement);
        ExcelUtil<ApsPlanManagement> util = new ExcelUtil<ApsPlanManagement>(ApsPlanManagement.class);
        util.exportExcel(response, list, "计划管理数据");
    }
 
    /**
     * 获取计划管理详细信息
     */
    @Operation(summary = "获取计划管理详细信息", description = "根据id获取")
//    @RequiresPermissions("aps:management:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(apsPlanManagementService.selectApsPlanManagementById(id));
    }
 
    /**
     * 新增计划管理
     */
    @Operation(summary = "新增计划管理", description = "单个新增")
//    @RequiresPermissions("aps:management:add")
    @Log(title = "新增计划管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ApsPlanManagement apsPlanManagement)
    {
        apsPlanManagementService.insertApsPlanManagement(apsPlanManagement);
        return toAjax(true);
    }
 
    /**
     * 修改计划周期管理
     */
    @Operation(summary = "修改计划周期管理", description = "修改计划周期管理")
//    @RequiresPermissions("aps:planCycle:edit")
    @Log(title = "修改计划周期管理", businessType = BusinessType.UPDATE)
    @PutMapping("cycle")
    public AjaxResult edit(@RequestBody ApsPlanCycle apsPlanCycle)
    {
        apsPlanManagementService.updateApsPlanCycle(apsPlanCycle);
        return toAjax(true);
    }
 
    /**
     * 修改计划管理
     */
    @Operation(summary = "修改计划管理", description = "单个修改")
//    @RequiresPermissions("aps:management:edit")
    @Log(title = "修改计划管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ApsPlanManagement apsPlanManagement)
    {
        apsPlanManagementService.updateApsPlanManagement(apsPlanManagement);
        return toAjax(true);
    }
 
    /**
     * 删除计划管理
     */
    @Operation(summary = "删除计划管理", description = "批量删除")
//    @RequiresPermissions("aps:management:remove")
    @Log(title = "删除计划管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        apsPlanManagementService.deleteApsPlanManagementByIds(ids);
        return toAjax(true);
    }
}