懒羊羊
2023-10-17 5d91e0a52879bf16511817b3cd20496f07717ab1
提交 | 用户 | 时间
1ac2bc 1 package cn.stylefeng.guns.modular.zsx.bs.material.controller;
2
3 import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
4 import cn.stylefeng.guns.modular.zsx.bs.material.entity.MaterialInfo;
5 import cn.stylefeng.guns.modular.zsx.bs.material.model.params.MaterialInfoParam;
6 import cn.stylefeng.guns.modular.zsx.bs.material.service.MaterialInfoService;
7 import cn.stylefeng.roses.core.base.controller.BaseController;
8 import cn.stylefeng.roses.core.mutidatasource.annotion.DataSource;
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
16 /**
17  * 物料信息控制器
18  *
19  * @author ruimin
20  * @Date 2023-08-23 09:18:06
21  */
22 @Controller
23 @RequestMapping("/materialInfo")
24 public class MaterialInfoController extends BaseController {
25
26     private String PREFIX = "/modular/bs/materialInfo";
27
28     @Autowired
29     private MaterialInfoService materialInfoService;
30
31     /**
32      * 跳转到主页面
33      *
34      * @author ruimin
35      * @Date 2023-08-23
36      */
37     @RequestMapping("")
38     public String index() {
39         return PREFIX + "/materialInfo.html";
40     }
41
42     /**
43      * 新增页面
44      *
45      * @author ruimin
46      * @Date 2023-08-23
47      */
48     @RequestMapping("/add")
49     public String add() {
50         return PREFIX + "/materialInfo_add.html";
51     }
52
53     /**
54      * 编辑页面
55      *
56      * @author ruimin
57      * @Date 2023-08-23
58      */
59     @RequestMapping("/edit")
60     public String edit() {
61         return PREFIX + "/materialInfo_edit.html";
62     }
63
64     @RequestMapping("/materialInfoListOpen")
65     public String materialInfoListOpen() {
66         return PREFIX + "/materialInfoListOpen.html";
67     }
68
69     /**
70      * 新增接口
71      *
72      * @author ruimin
73      * @Date 2023-08-23
74      */
75     @RequestMapping("/addItem")
76     @ResponseBody
77     @DataSource(name = "self")
78     public ResponseData addItem(MaterialInfoParam materialInfoParam) {
79         this.materialInfoService.add(materialInfoParam);
80         return ResponseData.success();
81     }
82
83     /**
84      * 编辑接口
85      *
86      * @author ruimin
87      * @Date 2023-08-23
88      */
89     @RequestMapping("/editItem")
90     @ResponseBody
91     @DataSource(name = "self")
92     public ResponseData editItem(MaterialInfoParam materialInfoParam) {
93         this.materialInfoService.update(materialInfoParam);
94         return ResponseData.success();
95     }
96
97     /**
98      * 删除接口
99      *
100      * @author ruimin
101      * @Date 2023-08-23
102      */
103     @RequestMapping("/delete")
104     @ResponseBody
105     @DataSource(name = "self")
106     public ResponseData delete(MaterialInfoParam materialInfoParam) {
107         this.materialInfoService.delete(materialInfoParam);
108         return ResponseData.success();
109     }
110
111     /**
112      * 查看详情接口
113      *
114      * @author ruimin
115      * @Date 2023-08-23
116      */
117     @RequestMapping("/detail")
118     @ResponseBody
119     @DataSource(name = "self")
120     public ResponseData detail(MaterialInfoParam materialInfoParam) {
121         MaterialInfo detail = this.materialInfoService.getById(materialInfoParam.getId());
122         return ResponseData.success(detail);
123     }
124
125     /**
126      * 查询列表
127      *
128      * @author ruimin
129      * @Date 2023-08-23
130      */
131     @ResponseBody
132     @RequestMapping("/list")
133     @DataSource(name = "self")
134     public LayuiPageInfo list(MaterialInfoParam materialInfoParam) {
135         return this.materialInfoService.findPageBySpec(materialInfoParam);
136     }
137
138 }
139
140