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