懒羊羊
2023-08-30 71e81ed1d12e4d69f53c8ad9e066650ad4186293
提交 | 用户 | 时间
71e81e 1 package cn.stylefeng.guns.modular.om.productionOrderBatchInfo.controller;
2
3 import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
4 import cn.stylefeng.guns.modular.om.productionOrderBatchInfo.entity.ProductionOrderBatchInfo;
5 import cn.stylefeng.guns.modular.om.productionOrderBatchInfo.model.params.ProductionOrderBatchInfoParam;
6 import cn.stylefeng.guns.modular.om.productionOrderBatchInfo.service.ProductionOrderBatchInfoService;
7 import cn.stylefeng.roses.core.base.controller.BaseController;
8 import cn.stylefeng.roses.kernel.model.response.ResponseData;
9 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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 import java.util.List;
16
17
18 /**
19  * 工单批次上料信息控制器
20  *
21  * @author ruimin
22  * @Date 2023-02-24 10:47:39
23  */
24 @Controller
25 @RequestMapping("/productionOrderBatchInfo")
26 public class ProductionOrderBatchInfoController extends BaseController {
27
28     private String PREFIX = "modular/om/productionOrderBatchInfo";
29
30     @Autowired
31     private ProductionOrderBatchInfoService productionOrderBatchInfoService;
32
33     /**
34      * 跳转到主页面
35      *
36      * @author ruimin
37      * @Date 2023-02-24
38      */
39     @RequestMapping("")
40     public String index() {
41         return PREFIX + "/productionOrderBatchInfo.html";
42     }
43
44     /**
45      * 新增页面
46      *
47      * @author ruimin
48      * @Date 2023-02-24
49      */
50     @RequestMapping("/add")
51     public String add() {
52         return PREFIX + "/productionOrderBatchInfo_add.html";
53     }
54
55     /**
56      * 编辑页面
57      *
58      * @author ruimin
59      * @Date 2023-02-24
60      */
61     @RequestMapping("/edit")
62     public String edit() {
63         return PREFIX + "/productionOrderBatchInfo_edit.html";
64     }
65
66     /**
67      * 新增接口
68      *
69      * @author ruimin
70      * @Date 2023-02-24
71      */
72     @RequestMapping("/addItem")
73     @ResponseBody
74     public ResponseData addItem(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
75         this.productionOrderBatchInfoService.add(productionOrderBatchInfoParam);
76         return ResponseData.success();
77     }
78
79     /**
80      * 编辑接口
81      *
82      * @author ruimin
83      * @Date 2023-02-24
84      */
85     @RequestMapping("/editItem")
86     @ResponseBody
87     public ResponseData editItem(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
88         this.productionOrderBatchInfoService.update(productionOrderBatchInfoParam);
89         return ResponseData.success();
90     }
91
92     /**
93      * 删除接口
94      *
95      * @author ruimin
96      * @Date 2023-02-24
97      */
98     @RequestMapping("/delete")
99     @ResponseBody
100     public ResponseData delete(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
101         this.productionOrderBatchInfoService.delete(productionOrderBatchInfoParam);
102         return ResponseData.success();
103     }
104
105     /**
106      * 查看详情接口
107      *
108      * @author ruimin
109      * @Date 2023-02-24
110      */
111     @RequestMapping("/detail")
112     @ResponseBody
113     public ResponseData detail(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
114         ProductionOrderBatchInfo detail = this.productionOrderBatchInfoService.getById(productionOrderBatchInfoParam.getId());
115         return ResponseData.success(detail);
116     }
117
118     /**
119      * 查询列表
120      *
121      * @author ruimin
122      * @Date 2023-02-24
123      */
124     @ResponseBody
125     @RequestMapping("/list")
126     public LayuiPageInfo list(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
127         return this.productionOrderBatchInfoService.findPageBySpec(productionOrderBatchInfoParam);
128     }
129
130     @ResponseBody
131     @RequestMapping("/boardList")
132     public ResponseData boardList(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
133         List<ProductionOrderBatchInfo> list = productionOrderBatchInfoService.list(new QueryWrapper<ProductionOrderBatchInfo>()
134                 .eq("work_order_no", productionOrderBatchInfoParam.getWorkOrderNo())
135                 .eq("loading_code", productionOrderBatchInfoParam.getLoadingCode())
136         );
137         return ResponseData.success(0,null,list);
138     }
139
140     @ResponseBody
141     @RequestMapping("/barCodeCheck")
142     public ResponseData barCodeCheck(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
143         int i = productionOrderBatchInfoService.barCodeCheck(productionOrderBatchInfoParam);
144         return ResponseData.success(i);
145     }
146
147     @ResponseBody
148     @RequestMapping("/updateState")
149     public ResponseData updateState(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
150         this.productionOrderBatchInfoService.updateState(productionOrderBatchInfoParam);
151         return ResponseData.success();
152     }
153
154 }
155
156