admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
提交 | 用户 | 时间
b5450a 1 package com.jcdm.main.em.inspectionPlanArchives.controller;
H 2
3 import java.util.List;
4 import javax.servlet.http.HttpServletResponse;
5 import org.springframework.security.access.prepost.PreAuthorize;
6 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.web.bind.annotation.GetMapping;
8 import org.springframework.web.bind.annotation.PostMapping;
9 import org.springframework.web.bind.annotation.PutMapping;
10 import org.springframework.web.bind.annotation.DeleteMapping;
11 import org.springframework.web.bind.annotation.PathVariable;
12 import org.springframework.web.bind.annotation.RequestBody;
13 import org.springframework.web.bind.annotation.RequestMapping;
14 import org.springframework.web.bind.annotation.RestController;
15 import com.jcdm.common.annotation.Log;
16 import com.jcdm.common.core.controller.BaseController;
17 import com.jcdm.common.core.domain.AjaxResult;
18 import com.jcdm.common.enums.BusinessType;
19 import com.jcdm.main.em.inspectionPlanArchives.domain.EmInspectionPlanArchives;
20 import com.jcdm.main.em.inspectionPlanArchives.service.IEmInspectionPlanArchivesService;
21 import com.jcdm.common.utils.poi.ExcelUtil;
22 import com.jcdm.common.core.page.TableDataInfo;
23
24 /**
25  * 点检保养计划设备清单Controller
26  * 
27  * @author Yi
28  * @date 2024-03-14
29  */
30 @RestController
31 @RequestMapping("/em/inspectionPlanArchives")
32 public class EmInspectionPlanArchivesController extends BaseController
33 {
34     @Autowired
35     private IEmInspectionPlanArchivesService emInspectionPlanArchivesService;
36
37     /**
38      * 查询点检保养计划设备清单列表
39      */
40     @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:list')")
41     @GetMapping("/list")
42     public TableDataInfo list(EmInspectionPlanArchives emInspectionPlanArchives)
43     {
44         startPage();
45         List<EmInspectionPlanArchives> list = emInspectionPlanArchivesService.selectEmInspectionPlanArchivesList(emInspectionPlanArchives);
46         return getDataTable(list);
47     }
48
49     /**
50      * 导出点检保养计划设备清单列表
51      */
52     @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:export')")
53     @Log(title = "点检保养计划设备清单", businessType = BusinessType.EXPORT)
54     @PostMapping("/export")
55     public void export(HttpServletResponse response, EmInspectionPlanArchives emInspectionPlanArchives)
56     {
57         List<EmInspectionPlanArchives> list = emInspectionPlanArchivesService.selectEmInspectionPlanArchivesList(emInspectionPlanArchives);
58         ExcelUtil<EmInspectionPlanArchives> util = new ExcelUtil<EmInspectionPlanArchives>(EmInspectionPlanArchives.class);
59         util.exportExcel(response, list, "点检保养计划设备清单数据");
60     }
61
62     /**
63      * 获取点检保养计划设备清单详细信息
64      */
65     @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:query')")
66     @GetMapping(value = "/{id}")
67     public AjaxResult getInfo(@PathVariable("id") Long id)
68     {
69         return success(emInspectionPlanArchivesService.selectEmInspectionPlanArchivesById(id));
70     }
71
72     /**
73      * 新增点检保养计划设备清单
74      */
75     @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:add')")
76     @Log(title = "点检保养计划设备清单", businessType = BusinessType.INSERT)
77     @PostMapping
78     public AjaxResult add(@RequestBody EmInspectionPlanArchives emInspectionPlanArchives)
79     {
80         return toAjax(emInspectionPlanArchivesService.insertEmInspectionPlanArchives(emInspectionPlanArchives));
81     }
82
83     /**
84      * 修改点检保养计划设备清单
85      */
86     @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:edit')")
87     @Log(title = "点检保养计划设备清单", businessType = BusinessType.UPDATE)
88     @PutMapping
89     public AjaxResult edit(@RequestBody EmInspectionPlanArchives emInspectionPlanArchives)
90     {
91         return toAjax(emInspectionPlanArchivesService.updateEmInspectionPlanArchives(emInspectionPlanArchives));
92     }
93
94     /**
95      * 删除点检保养计划设备清单
96      */
97     @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:remove')")
98     @Log(title = "点检保养计划设备清单", businessType = BusinessType.DELETE)
99     @DeleteMapping("/{ids}")
100     public AjaxResult remove(@PathVariable Long[] ids)
101     {
102         return toAjax(emInspectionPlanArchivesService.deleteEmInspectionPlanArchivesByIds(ids));
103     }
104 }