cl
2024-01-16 cf6bff3922bbd0624b98834f6ea85c8e619e564f
提交 | 用户 | 时间
71e81e 1 package cn.stylefeng.guns.modular.bs.bomInfo.controller;
2
3 import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
4 import cn.stylefeng.guns.modular.bs.bomInfo.entity.BomInfo;
5 import cn.stylefeng.guns.modular.bs.bomInfo.model.params.BomInfoParam;
6 import cn.stylefeng.guns.modular.bs.bomInfo.model.result.BomInfoResult;
7 import cn.stylefeng.guns.modular.bs.bomInfo.service.BomInfoService;
8 import cn.stylefeng.roses.core.base.controller.BaseController;
9 import cn.stylefeng.roses.kernel.model.response.ResponseData;
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  * bom信息控制器
20  *
21  * @author 
22  * @Date 2022-10-24 20:09:55
23  */
24 @Controller
25 @RequestMapping("/bomInfo")
26 public class BomInfoController extends BaseController {
27
28     private String PREFIX = "modular/bs/bomInfo";
29
30     @Autowired
31     private BomInfoService bomInfoService;
32
33     /**
34      * 跳转到主页面
35      *
36      * @author 
37      * @Date 2022-10-24
38      */
39     @RequestMapping("")
40     public String index() {
41         return PREFIX + "/bomInfo.html";
42     }
43
44     /**
45      * 新增页面
46      *
47      * @author 
48      * @Date 2022-10-24
49      */
50     @RequestMapping("/add")
51     public String add() {
52         return PREFIX + "/bomInfo_add.html";
53     }
54
55     /**
56      * 编辑页面
57      *
58      * @author 
59      * @Date 2022-10-24
60      */
61     @RequestMapping("/edit")
62     public String edit() {
63         return PREFIX + "/bomInfo_edit.html";
64     }
65
66     /**
67      * 新增接口
68      *
69      * @author 
70      * @Date 2022-10-24
71      */
72     @RequestMapping("/addItem")
73     @ResponseBody
74     public ResponseData addItem(BomInfoParam bomInfoParam) {
75         this.bomInfoService.add(bomInfoParam);
76         return ResponseData.success();
77     }
78
79     /**
80      * 编辑接口
81      *
82      * @author 
83      * @Date 2022-10-24
84      */
85     @RequestMapping("/editItem")
86     @ResponseBody
87     public ResponseData editItem(BomInfoParam bomInfoParam) {
88         this.bomInfoService.update(bomInfoParam);
89         return ResponseData.success();
90     }
91
92     /**
93      * 删除接口
94      *
95      * @author 
96      * @Date 2022-10-24
97      */
98     @RequestMapping("/delete")
99     @ResponseBody
100     public ResponseData delete(BomInfoParam bomInfoParam) {
101         this.bomInfoService.delete(bomInfoParam);
102         return ResponseData.success();
103     }
104
105     /**
106      * 删除接口
107      *
108      * @author
109      * @Date 2022-10-24
110      */
111     @RequestMapping("/deleteAll")
112     @ResponseBody
113     public ResponseData deleteAll(List<BomInfoParam> list) {
114         for(int i=0;i<list.size();i++){
115             BomInfoParam bomInfoParam = list.get(i);
116             this.bomInfoService.delete(bomInfoParam);
117         }
118
119         return ResponseData.success();
120     }
121
122     /**
123      * 查看详情接口
124      *
125      * @author 
126      * @Date 2022-10-24
127      */
128     @RequestMapping("/detail")
129     @ResponseBody
130     public ResponseData detail(BomInfoParam bomInfoParam) {
131         BomInfo detail = this.bomInfoService.getById(bomInfoParam.getId());
132         return ResponseData.success(detail);
133     }
134
135     /**
136      * 查询列表
137      *
138      * @author 
139      * @Date 2022-10-24
140      */
141     @ResponseBody
142     @RequestMapping("/list")
143     public LayuiPageInfo list(BomInfoParam bomInfoParam) {
144         return this.bomInfoService.findPageBySpec(bomInfoParam);
145     }
146
147     @ResponseBody
148     @RequestMapping("/viewList")
149     public LayuiPageInfo viewList(BomInfoParam bomInfoParam) {
150         return this.bomInfoService.viewList(bomInfoParam);
151     }
152
153     @ResponseBody
154     @RequestMapping("/kbListTable")
155     public LayuiPageInfo kbListTable(BomInfoParam bomInfoParam) {
156         return this.bomInfoService.kbListTable(bomInfoParam);
157     }
158
159     @ResponseBody
160     @RequestMapping("/bomCheck")
161     public ResponseData bomCheck(BomInfoParam bomInfoParam) {
162         List<BomInfoResult> listBySpec = this.bomInfoService.findListBySpec(bomInfoParam);
163         return ResponseData.success(listBySpec.size());
164     }
165
166 }
167
168