cl
2024-01-19 e0fac38b26845f25de479783e0c76cf12a5311e0
提交 | 用户 | 时间
71e81e 1 package cn.stylefeng.guns.modular.sc.scannerConfig.controller;
2
3 import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
4 import cn.stylefeng.guns.modular.bs.locationInfo.entity.LocationInfo;
5 import cn.stylefeng.guns.modular.bs.locationInfo.model.params.LocationInfoParam;
6 import cn.stylefeng.guns.modular.sc.scannerConfig.entity.ScannerConfig;
7 import cn.stylefeng.guns.modular.sc.scannerConfig.model.params.ScannerConfigParam;
8 import cn.stylefeng.guns.modular.sc.scannerConfig.service.ScannerConfigService;
9 import cn.stylefeng.roses.core.base.controller.BaseController;
10 import cn.stylefeng.roses.kernel.model.response.ResponseData;
11 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
12 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.stereotype.Controller;
14 import org.springframework.web.bind.annotation.RequestMapping;
15 import org.springframework.web.bind.annotation.ResponseBody;
16
17
18 /**
19  * 扫描枪配置表控制器
20  *
21  * @author zrm
22  * @Date 2023-07-11 14:13:27
23  */
24 @Controller
25 @RequestMapping("/scannerConfig")
26 public class ScannerConfigController extends BaseController {
27
28     private String PREFIX = "/modular/sc/scannerConfig";
29
30     @Autowired
31     private ScannerConfigService scannerConfigService;
32
33     /**
34      * 跳转到主页面
35      *
36      * @author zrm
37      * @Date 2023-07-11
38      */
39     @RequestMapping("")
40     public String index() {
41         return PREFIX + "/scannerConfig.html";
42     }
43
44     /**
45      * 新增页面
46      *
47      * @author zrm
48      * @Date 2023-07-11
49      */
50     @RequestMapping("/add")
51     public String add() {
52         return PREFIX + "/scannerConfig_add.html";
53     }
54
55     /**
56      * 编辑页面
57      *
58      * @author zrm
59      * @Date 2023-07-11
60      */
61     @RequestMapping("/edit")
62     public String edit() {
63         return PREFIX + "/scannerConfig_edit.html";
64     }
65
66     /**
67      * 新增接口
68      *
69      * @author zrm
70      * @Date 2023-07-11
71      */
72     @RequestMapping("/addItem")
73     @ResponseBody
74     public ResponseData addItem(ScannerConfigParam scannerConfigParam) {
75         this.scannerConfigService.add(scannerConfigParam);
76         return ResponseData.success();
77     }
78
79     @RequestMapping("/getOneByLocationCode")
80     @ResponseBody
81     public ResponseData getOneByLocationCode(ScannerConfigParam scannerConfigParam) {
82         ScannerConfig detail = this.scannerConfigService.getOne(new QueryWrapper<ScannerConfig>().eq("location_code",scannerConfigParam.getLocationCode()));
83         return ResponseData.success(detail);
84     }
85
86     /**
87      * 编辑接口
88      *
89      * @author zrm
90      * @Date 2023-07-11
91      */
92     @RequestMapping("/editItem")
93     @ResponseBody
94     public ResponseData editItem(ScannerConfigParam scannerConfigParam) {
95         this.scannerConfigService.update(scannerConfigParam);
96         return ResponseData.success();
97     }
98
99     /**
100      * 删除接口
101      *
102      * @author zrm
103      * @Date 2023-07-11
104      */
105     @RequestMapping("/delete")
106     @ResponseBody
107     public ResponseData delete(ScannerConfigParam scannerConfigParam) {
108         this.scannerConfigService.delete(scannerConfigParam);
109         return ResponseData.success();
110     }
111
112     /**
113      * 查看详情接口
114      *
115      * @author zrm
116      * @Date 2023-07-11
117      */
118     @RequestMapping("/detail")
119     @ResponseBody
120     public ResponseData detail(ScannerConfigParam scannerConfigParam) {
121         ScannerConfig detail = this.scannerConfigService.getById(scannerConfigParam.getId());
122         return ResponseData.success(detail);
123     }
124
125     /**
126      * 查询列表
127      *
128      * @author zrm
129      * @Date 2023-07-11
130      */
131     @ResponseBody
132     @RequestMapping("/list")
133     public LayuiPageInfo list(ScannerConfigParam scannerConfigParam) {
134         return this.scannerConfigService.findPageBySpec(scannerConfigParam);
135     }
136
137 }
138
139