提交 | 用户 | 时间
|
523903
|
1 |
package com.jcdm.main.em.inspectionPlanTask.controller; |
懒 |
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.inspectionPlanTask.domain.EmInspectionPlanTask; |
|
20 |
import com.jcdm.main.em.inspectionPlanTask.service.IEmInspectionPlanTaskService; |
|
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-23 |
|
29 |
*/ |
|
30 |
@RestController |
|
31 |
@RequestMapping("/em/inspectionPlanTask") |
|
32 |
public class EmInspectionPlanTaskController extends BaseController |
|
33 |
{ |
|
34 |
@Autowired |
|
35 |
private IEmInspectionPlanTaskService emInspectionPlanTaskService; |
|
36 |
|
|
37 |
/** |
e20d73
|
38 |
* 查询点检任务列表不分页 |
懒 |
39 |
*/ |
|
40 |
@PostMapping("/noPageList") |
|
41 |
public AjaxResult noPageList() |
|
42 |
{ |
|
43 |
List<EmInspectionPlanTask> list = emInspectionPlanTaskService.list(); |
|
44 |
return AjaxResult.success(list); |
|
45 |
} |
|
46 |
|
|
47 |
/** |
523903
|
48 |
* 查询点检任务列表 |
懒 |
49 |
*/ |
|
50 |
@PreAuthorize("@ss.hasPermi('em:inspectionPlanTask:list')") |
|
51 |
@GetMapping("/list") |
|
52 |
public TableDataInfo list(EmInspectionPlanTask emInspectionPlanTask) |
|
53 |
{ |
|
54 |
startPage(); |
|
55 |
List<EmInspectionPlanTask> list = emInspectionPlanTaskService.selectEmInspectionPlanTaskList(emInspectionPlanTask); |
|
56 |
return getDataTable(list); |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
60 |
* 导出点检任务列表 |
|
61 |
*/ |
|
62 |
@PreAuthorize("@ss.hasPermi('em:inspectionPlanTask:export')") |
|
63 |
@Log(title = "点检任务", businessType = BusinessType.EXPORT) |
|
64 |
@PostMapping("/export") |
|
65 |
public void export(HttpServletResponse response, EmInspectionPlanTask emInspectionPlanTask) |
|
66 |
{ |
|
67 |
List<EmInspectionPlanTask> list = emInspectionPlanTaskService.selectEmInspectionPlanTaskList(emInspectionPlanTask); |
|
68 |
ExcelUtil<EmInspectionPlanTask> util = new ExcelUtil<EmInspectionPlanTask>(EmInspectionPlanTask.class); |
|
69 |
util.exportExcel(response, list, "点检任务数据"); |
|
70 |
} |
|
71 |
|
|
72 |
/** |
|
73 |
* 获取点检任务详细信息 |
|
74 |
*/ |
|
75 |
@PreAuthorize("@ss.hasPermi('em:inspectionPlanTask:query')") |
|
76 |
@GetMapping(value = "/{id}") |
|
77 |
public AjaxResult getInfo(@PathVariable("id") Long id) |
|
78 |
{ |
|
79 |
return success(emInspectionPlanTaskService.selectEmInspectionPlanTaskById(id)); |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* 新增点检任务 |
|
84 |
*/ |
|
85 |
@PreAuthorize("@ss.hasPermi('em:inspectionPlanTask:add')") |
|
86 |
@Log(title = "点检任务", businessType = BusinessType.INSERT) |
|
87 |
@PostMapping |
|
88 |
public AjaxResult add(@RequestBody EmInspectionPlanTask emInspectionPlanTask) |
|
89 |
{ |
|
90 |
return toAjax(emInspectionPlanTaskService.insertEmInspectionPlanTask(emInspectionPlanTask)); |
|
91 |
} |
|
92 |
|
|
93 |
/** |
|
94 |
* 修改点检任务 |
|
95 |
*/ |
|
96 |
@PreAuthorize("@ss.hasPermi('em:inspectionPlanTask:edit')") |
|
97 |
@Log(title = "点检任务", businessType = BusinessType.UPDATE) |
|
98 |
@PutMapping |
|
99 |
public AjaxResult edit(@RequestBody EmInspectionPlanTask emInspectionPlanTask) |
|
100 |
{ |
|
101 |
return toAjax(emInspectionPlanTaskService.updateEmInspectionPlanTask(emInspectionPlanTask)); |
|
102 |
} |
|
103 |
|
|
104 |
/** |
|
105 |
* 删除点检任务 |
|
106 |
*/ |
|
107 |
@PreAuthorize("@ss.hasPermi('em:inspectionPlanTask:remove')") |
|
108 |
@Log(title = "点检任务", businessType = BusinessType.DELETE) |
|
109 |
@DeleteMapping("/{ids}") |
|
110 |
public AjaxResult remove(@PathVariable Long[] ids) |
|
111 |
{ |
|
112 |
return toAjax(emInspectionPlanTaskService.deleteEmInspectionPlanTaskByIds(ids)); |
|
113 |
} |
|
114 |
} |