-
懒羊羊
2024-03-27 054a699a156ca607e95f220b364136d42a19ab0f
提交 | 用户 | 时间
523903 1 package com.jcdm.main.em.inspectionPlanItemsProject.controller;
2
3 import java.util.List;
4 import javax.servlet.http.HttpServletResponse;
e20d73 5
6 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
7 import org.aspectj.weaver.loadtime.Aj;
523903 8 import org.springframework.security.access.prepost.PreAuthorize;
9 import org.springframework.beans.factory.annotation.Autowired;
e20d73 10 import org.springframework.web.bind.annotation.*;
523903 11 import com.jcdm.common.annotation.Log;
12 import com.jcdm.common.core.controller.BaseController;
13 import com.jcdm.common.core.domain.AjaxResult;
14 import com.jcdm.common.enums.BusinessType;
15 import com.jcdm.main.em.inspectionPlanItemsProject.domain.EmInspectionPlanItemsProject;
16 import com.jcdm.main.em.inspectionPlanItemsProject.service.IEmInspectionPlanItemsProjectService;
17 import com.jcdm.common.utils.poi.ExcelUtil;
18 import com.jcdm.common.core.page.TableDataInfo;
19
20 /**
21  * 点检任务-项目Controller
22  * 
23  * @author Yi
24  * @date 2024-03-23
25  */
26 @RestController
27 @RequestMapping("/em/inspectionPlanItemsProject")
28 public class EmInspectionPlanItemsProjectController extends BaseController
29 {
30     @Autowired
31     private IEmInspectionPlanItemsProjectService emInspectionPlanItemsProjectService;
32
e20d73 33     @RequestMapping("/findPlanItemsProjectByPlanId")
34     public AjaxResult list(@RequestParam String planId)
35     {
36         List<EmInspectionPlanItemsProject> planTaskIdList = emInspectionPlanItemsProjectService.list(new QueryWrapper<EmInspectionPlanItemsProject>().eq("plan_task_id", planId));
37         return AjaxResult.success(planTaskIdList);
38     }
39
523903 40     /**
41      * 查询点检任务-项目列表
42      */
43     @PreAuthorize("@ss.hasPermi('em:inspectionPlanItemsProject:list')")
44     @GetMapping("/list")
45     public TableDataInfo list(EmInspectionPlanItemsProject emInspectionPlanItemsProject)
46     {
47         startPage();
48         List<EmInspectionPlanItemsProject> list = emInspectionPlanItemsProjectService.selectEmInspectionPlanItemsProjectList(emInspectionPlanItemsProject);
49         return getDataTable(list);
50     }
51
52     /**
53      * 导出点检任务-项目列表
54      */
55     @PreAuthorize("@ss.hasPermi('em:inspectionPlanItemsProject:export')")
56     @Log(title = "点检任务-项目", businessType = BusinessType.EXPORT)
57     @PostMapping("/export")
58     public void export(HttpServletResponse response, EmInspectionPlanItemsProject emInspectionPlanItemsProject)
59     {
60         List<EmInspectionPlanItemsProject> list = emInspectionPlanItemsProjectService.selectEmInspectionPlanItemsProjectList(emInspectionPlanItemsProject);
61         ExcelUtil<EmInspectionPlanItemsProject> util = new ExcelUtil<EmInspectionPlanItemsProject>(EmInspectionPlanItemsProject.class);
62         util.exportExcel(response, list, "点检任务-项目数据");
63     }
64
65     /**
66      * 获取点检任务-项目详细信息
67      */
68     @PreAuthorize("@ss.hasPermi('em:inspectionPlanItemsProject:query')")
69     @GetMapping(value = "/{id}")
70     public AjaxResult getInfo(@PathVariable("id") Long id)
71     {
72         return success(emInspectionPlanItemsProjectService.selectEmInspectionPlanItemsProjectById(id));
73     }
74
75     /**
76      * 新增点检任务-项目
77      */
78     @PreAuthorize("@ss.hasPermi('em:inspectionPlanItemsProject:add')")
79     @Log(title = "点检任务-项目", businessType = BusinessType.INSERT)
80     @PostMapping
81     public AjaxResult add(@RequestBody EmInspectionPlanItemsProject emInspectionPlanItemsProject)
82     {
83         return toAjax(emInspectionPlanItemsProjectService.insertEmInspectionPlanItemsProject(emInspectionPlanItemsProject));
84     }
85
86     /**
87      * 修改点检任务-项目
88      */
89     @PreAuthorize("@ss.hasPermi('em:inspectionPlanItemsProject:edit')")
90     @Log(title = "点检任务-项目", businessType = BusinessType.UPDATE)
91     @PutMapping
92     public AjaxResult edit(@RequestBody EmInspectionPlanItemsProject emInspectionPlanItemsProject)
93     {
94         return toAjax(emInspectionPlanItemsProjectService.updateEmInspectionPlanItemsProject(emInspectionPlanItemsProject));
95     }
96
97     /**
98      * 删除点检任务-项目
99      */
100     @PreAuthorize("@ss.hasPermi('em:inspectionPlanItemsProject:remove')")
101     @Log(title = "点检任务-项目", businessType = BusinessType.DELETE)
102     @DeleteMapping("/{ids}")
103     public AjaxResult remove(@PathVariable Long[] ids)
104     {
105         return toAjax(emInspectionPlanItemsProjectService.deleteEmInspectionPlanItemsProjectByIds(ids));
106     }
107 }