懒羊羊
2023-10-17 5d91e0a52879bf16511817b3cd20496f07717ab1
提交 | 用户 | 时间
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     /**
92cffc 66      * 产品列表页面
67      *
68      * @author ruimin
69      * @Date 2023-08-26
70      */
71     @RequestMapping("/productListing")
72     public String productListing() {
73         return PREFIX + "/bulletBox/productListing.html";
74     }
75
76     /**
1ac2bc 77      * 新增接口
78      *
79      * @author ruimin
80      * @Date 2023-08-26
81      */
82     @RequestMapping("/addItem")
83     @ResponseBody
84     @DataSource(name = "self")
85     public ResponseData addItem(WorkOrderParam workOrderParam) {
86         workOrderParam.setWorkOrderCode(getOrderCode());
87         this.workOrderService.add(workOrderParam);
88         return ResponseData.success();
89     }
90
91     @DataSource(name = "self")
92     public String getOrderCode() {
93         String orderCode = this.workOrderService.getOrderCode();
94         return orderCode;
95     }
96
97     /**
98      * 编辑接口
99      *
100      * @author ruimin
101      * @Date 2023-08-26
102      */
103     @RequestMapping("/editItem")
104     @ResponseBody
105     @DataSource(name = "self")
106     public ResponseData editItem(WorkOrderParam workOrderParam) {
107         this.workOrderService.update(workOrderParam);
108         return ResponseData.success();
109     }
110
111     /**
258083 112      * 编辑接口
113      *
114      * @author ruimin
115      * @Date 2023-08-26
116      */
117     @RequestMapping("/editOrderState")
118     @ResponseBody
119     @DataSource(name = "self")
120     public ResponseData editOrderState(WorkOrderParam workOrderParam) {
121         this.workOrderService.update(workOrderParam);
122         return ResponseData.success();
123     }
124
125
126     /**
1ac2bc 127      * 删除接口
128      *
129      * @author ruimin
130      * @Date 2023-08-26
131      */
132     @RequestMapping("/delete")
133     @ResponseBody
134     @DataSource(name = "self")
135     public ResponseData delete(WorkOrderParam workOrderParam) {
136         this.workOrderService.delete(workOrderParam);
137         return ResponseData.success();
138     }
139
140     /**
141      * 查看详情接口
142      *
143      * @author ruimin
144      * @Date 2023-08-26
145      */
146     @RequestMapping("/detail")
147     @ResponseBody
148     @DataSource(name = "self")
149     public ResponseData detail(WorkOrderParam workOrderParam) {
150         WorkOrder detail = this.workOrderService.getById(workOrderParam.getId());
151         return ResponseData.success(detail);
152     }
153
154     /**
155      * 查询列表
156      *
157      * @author ruimin
158      * @Date 2023-08-26
159      */
160     @ResponseBody
161     @RequestMapping("/list")
162     @DataSource(name = "self")
163     public LayuiPageInfo list(WorkOrderParam workOrderParam) {
164         return this.workOrderService.findPageBySpec(workOrderParam);
165     }
166
167 }
168
169