yantian yue
2023-10-17 487b2f2a353b89ab46cd9b784226b600b7b915b8
提交 | 用户 | 时间
1ac2bc 1 package cn.stylefeng.guns.modular.zsx.pm.workOrder.controller;
2
3 import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
4 import cn.stylefeng.guns.modular.zsx.pm.workOrder.entity.WorkOrder;
5 import cn.stylefeng.guns.modular.zsx.pm.workOrder.model.params.WorkOrderParam;
6 import cn.stylefeng.guns.modular.zsx.pm.workOrder.service.WorkOrderService;
7 import cn.stylefeng.roses.core.base.controller.BaseController;
8 import cn.stylefeng.roses.kernel.model.response.ResponseData;
9 import cn.stylefeng.roses.core.mutidatasource.annotion.DataSource;
10 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Controller;
12 import org.springframework.web.bind.annotation.RequestMapping;
13 import org.springframework.web.bind.annotation.ResponseBody;
14
15
16
17 /**
18  * 生产工单控制器
19  *
20  * @author ruimin
21  * @Date 2023-08-26 15:47:25
22  */
23 @Controller
24 @RequestMapping("/workOrder")
25 public class WorkOrderController extends BaseController {
26
27     private String PREFIX = "/modular/pm/workOrder";
28
29     @Autowired
30     private WorkOrderService workOrderService;
31
32     /**
33      * 跳转到主页面
34      *
35      * @author ruimin
36      * @Date 2023-08-26
37      */
38     @RequestMapping("")
39     public String index() {
40         return PREFIX + "/workOrder.html";
41     }
42
43     /**
44      * 新增页面
45      *
46      * @author ruimin
47      * @Date 2023-08-26
48      */
49     @RequestMapping("/add")
50     public String add() {
51         return PREFIX + "/workOrder_add.html";
52     }
53
54     /**
55      * 编辑页面
56      *
57      * @author ruimin
58      * @Date 2023-08-26
59      */
60     @RequestMapping("/edit")
61     public String edit() {
62         return PREFIX + "/workOrder_edit.html";
63     }
64
65     /**
66      * 新增接口
67      *
68      * @author ruimin
69      * @Date 2023-08-26
70      */
71     @RequestMapping("/addItem")
72     @ResponseBody
73     @DataSource(name = "self")
74     public ResponseData addItem(WorkOrderParam workOrderParam) {
75         workOrderParam.setWorkOrderCode(getOrderCode());
76         this.workOrderService.add(workOrderParam);
77         return ResponseData.success();
78     }
79
80     @DataSource(name = "self")
81     public String getOrderCode() {
82         String orderCode = this.workOrderService.getOrderCode();
83         return orderCode;
84     }
85
86     /**
87      * 编辑接口
88      *
89      * @author ruimin
90      * @Date 2023-08-26
91      */
92     @RequestMapping("/editItem")
93     @ResponseBody
94     @DataSource(name = "self")
95     public ResponseData editItem(WorkOrderParam workOrderParam) {
96         this.workOrderService.update(workOrderParam);
97         return ResponseData.success();
98     }
99
100     /**
258083 101      * 编辑接口
102      *
103      * @author ruimin
104      * @Date 2023-08-26
105      */
106     @RequestMapping("/editOrderState")
107     @ResponseBody
108     @DataSource(name = "self")
109     public ResponseData editOrderState(WorkOrderParam workOrderParam) {
110         this.workOrderService.update(workOrderParam);
111         return ResponseData.success();
112     }
113
114
115     /**
1ac2bc 116      * 删除接口
117      *
118      * @author ruimin
119      * @Date 2023-08-26
120      */
121     @RequestMapping("/delete")
122     @ResponseBody
123     @DataSource(name = "self")
124     public ResponseData delete(WorkOrderParam workOrderParam) {
125         this.workOrderService.delete(workOrderParam);
126         return ResponseData.success();
127     }
128
129     /**
130      * 查看详情接口
131      *
132      * @author ruimin
133      * @Date 2023-08-26
134      */
135     @RequestMapping("/detail")
136     @ResponseBody
137     @DataSource(name = "self")
138     public ResponseData detail(WorkOrderParam workOrderParam) {
139         WorkOrder detail = this.workOrderService.getById(workOrderParam.getId());
140         return ResponseData.success(detail);
141     }
142
143     /**
144      * 查询列表
145      *
146      * @author ruimin
147      * @Date 2023-08-26
148      */
149     @ResponseBody
150     @RequestMapping("/list")
151     @DataSource(name = "self")
152     public LayuiPageInfo list(WorkOrderParam workOrderParam) {
153         return this.workOrderService.findPageBySpec(workOrderParam);
154     }
155
156 }
157
158