OPC
懒羊羊
2023-12-13 21fde820e495c08cfa0ba277685468baa5bf9118
提交 | 用户 | 时间
71e81e 1 package cn.stylefeng.guns.modular.em.equipmentMaintainContentTask.controller;
2
3 import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
4 import cn.stylefeng.guns.modular.em.equipmentMaintainContentPlan.entity.EquipmentMaintainContentPlan;
5 import cn.stylefeng.guns.modular.em.equipmentMaintainContentPlan.model.params.EquipmentMaintainContentPlanParam;
6 import cn.stylefeng.guns.modular.em.equipmentMaintainContentTask.entity.EquipmentMaintainContentTask;
7 import cn.stylefeng.guns.modular.em.equipmentMaintainContentTask.model.params.EquipmentMaintainContentTaskParam;
8 import cn.stylefeng.guns.modular.em.equipmentMaintainContentTask.service.EquipmentMaintainContentTaskService;
9 import cn.stylefeng.guns.modular.em.equipmentMaintainTask.model.params.EquipmentMaintainTaskParam;
10 import cn.stylefeng.roses.core.base.controller.BaseController;
11 import cn.stylefeng.roses.kernel.model.response.ResponseData;
12 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Controller;
15 import org.springframework.web.bind.annotation.RequestMapping;
16 import org.springframework.web.bind.annotation.ResponseBody;
17
18 import java.util.List;
19
20
21 /**
22  * 保养任务内容控制器
23  *
24  * @author ruimin
25  * @Date 2023-02-21 15:49:33
26  */
27 @Controller
28 @RequestMapping("/equipmentMaintainContentTask")
29 public class EquipmentMaintainContentTaskController extends BaseController {
30
31     private String PREFIX = "modular/em/equipmentMaintainContentTask";
32
33     @Autowired
34     private EquipmentMaintainContentTaskService equipmentMaintainContentTaskService;
35
36     /**
37      * 跳转到主页面
38      *
39      * @author ruimin
40      * @Date 2023-02-21
41      */
42     @RequestMapping("")
43     public String index() {
44         return PREFIX + "/equipmentMaintainContentTask.html";
45     }
46
47     /**
48      * 新增页面
49      *
50      * @author ruimin
51      * @Date 2023-02-21
52      */
53     @RequestMapping("/add")
54     public String add() {
55         return PREFIX + "/equipmentMaintainContentTask_add.html";
56     }
57
58     /**
59      * 编辑页面
60      *
61      * @author ruimin
62      * @Date 2023-02-21
63      */
64     @RequestMapping("/edit")
65     public String edit() {
66         return PREFIX + "/equipmentMaintainContentTask_edit.html";
67     }
68
69     /**
70      * 新增接口
71      *
72      * @author ruimin
73      * @Date 2023-02-21
74      */
75     @RequestMapping("/addItem")
76     @ResponseBody
77     public ResponseData addItem(EquipmentMaintainContentTaskParam equipmentMaintainContentTaskParam) {
78         this.equipmentMaintainContentTaskService.add(equipmentMaintainContentTaskParam);
79         return ResponseData.success();
80     }
81
82     /**
83      * 编辑接口
84      *
85      * @author ruimin
86      * @Date 2023-02-21
87      */
88     @RequestMapping("/editItem")
89     @ResponseBody
90     public ResponseData editItem(EquipmentMaintainContentTaskParam equipmentMaintainContentTaskParam) {
91         this.equipmentMaintainContentTaskService.update(equipmentMaintainContentTaskParam);
92         return ResponseData.success();
93     }
94
95     /**
96      * 删除接口
97      *
98      * @author ruimin
99      * @Date 2023-02-21
100      */
101     @RequestMapping("/delete")
102     @ResponseBody
103     public ResponseData delete(EquipmentMaintainContentTaskParam equipmentMaintainContentTaskParam) {
104         this.equipmentMaintainContentTaskService.delete(equipmentMaintainContentTaskParam);
105         return ResponseData.success();
106     }
107
108     /**
109      * 查看详情接口
110      *
111      * @author ruimin
112      * @Date 2023-02-21
113      */
114     @RequestMapping("/detail")
115     @ResponseBody
116     public ResponseData detail(EquipmentMaintainContentTaskParam equipmentMaintainContentTaskParam) {
117         EquipmentMaintainContentTask detail = this.equipmentMaintainContentTaskService.getById(equipmentMaintainContentTaskParam.getId());
118         return ResponseData.success(detail);
119     }
120
121     @RequestMapping("/detailByMaintainPlanNo")
122     @ResponseBody
123     public List detailByMaintainPlanNo(EquipmentMaintainContentTaskParam param) {
124         EquipmentMaintainContentTask detail = this.equipmentMaintainContentTaskService.getById(param.getId());
125         List<EquipmentMaintainContentTask> planNo = equipmentMaintainContentTaskService.list(new QueryWrapper<EquipmentMaintainContentTask>().eq("task_no", param.getTaskNo()));
126         return planNo;
127     }
128
129     @RequestMapping("/editByState")
130     @ResponseBody
131     public ResponseData editByState(EquipmentMaintainContentTaskParam param) {
132         equipmentMaintainContentTaskService.update(param);
133         return ResponseData.success();
134     }
135
136     /**
137      * 查询列表
138      *
139      * @author ruimin
140      * @Date 2023-02-21
141      */
142     @ResponseBody
143     @RequestMapping("/list")
144     public LayuiPageInfo list(EquipmentMaintainContentTaskParam equipmentMaintainContentTaskParam) {
145         return this.equipmentMaintainContentTaskService.findPageBySpec(equipmentMaintainContentTaskParam);
146     }
147
148 }
149
150