OPC
懒羊羊
2023-12-13 21fde820e495c08cfa0ba277685468baa5bf9118
提交 | 用户 | 时间
71e81e 1 package cn.stylefeng.guns.modular.kb.materialRegistration.controller;
2
3 import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
4 import cn.stylefeng.guns.modular.kb.utils.IPUtil;
5 import cn.stylefeng.guns.modular.sc.kanbanConf.model.params.KanbanConfParam;
6 import cn.stylefeng.guns.modular.sc.kanbanConf.service.KanbanConfService;
7 import cn.stylefeng.roses.core.base.controller.BaseController;
8 import cn.stylefeng.roses.kernel.model.response.ResponseData;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Controller;
11 import org.springframework.web.bind.annotation.RequestMapping;
12 import org.springframework.web.bind.annotation.ResponseBody;
13
14 import javax.servlet.http.HttpServletRequest;
15
16 /**
17  * 物料登记看板控制器1
18  *
19  * @author cl
20  * @Date 2022-10-27 15:50:56
21  */
22 @Controller
23 @RequestMapping("/materialRegistration")
24 public class MaterialRegistrationController extends BaseController {
25
26     private String PREFIX = "modular/kb/materialRegistration";
27     @Autowired
28     private KanbanConfService kanbanConfService;
29     /**
30      * 跳转到主页面
31      *
32      * @author cl
33      * @Date 2022-10-27
34      */
35     @RequestMapping("")
36     public String index() {
37         return PREFIX + "/materialRegistration.html";
38     }
39
40     /**
41      * 新增看板配置页面
42      *
43      * @author cl
44      * @Date 2022-10-31
45      */
46     @RequestMapping("/add")
47     public String add() {
48         return PREFIX + "/kanbanConf_add.html";
49     }
50
51     /**
52      * 编辑页面
53      *
54      * @author cl
55      * @Date 2022-10-31
56      */
57     @RequestMapping("/edit")
58     public String edit() {
59         return PREFIX + "/kanbanConf_edit.html";
60     }
61
62     @RequestMapping("/orderEdit")
63     public String orderEdit() {
64         return PREFIX + "/kanbanConf_orderEdit.html";
65     }
66
67     /**
68      * 新增接口
69      *
70      * @author cl
71      * @Date 2022-10-31
72      */
73     @RequestMapping("/addKanBanConfItem")
74     @ResponseBody
75     public ResponseData addItem(KanbanConfParam kanbanConfParam, HttpServletRequest request) {
76         String realIp = IPUtil.getRealIp(request);
77         kanbanConfParam.setIpAddress(realIp);
78
79         this.kanbanConfService.add(kanbanConfParam);
80         return ResponseData.success();
81     }
82
83     /**
84      * 编辑接口
85      *
86      * @author cl
87      * @Date 2022-10-31
88      */
89     @RequestMapping("/editKanBanConfItem")
90     @ResponseBody
91     public ResponseData editItem(KanbanConfParam kanbanConfParam) {
92         this.kanbanConfService.update(kanbanConfParam);
93         return ResponseData.success();
94     }
95
96     /**
97      * 查询列表
98      *
99      * @author cl
100      * @Date 2022-10-31
101      */
102     @ResponseBody
103     @RequestMapping("/qryKBConflist")
104     public LayuiPageInfo list(KanbanConfParam kanbanConfParam, HttpServletRequest request) {
105         String realIp = IPUtil.getRealIp(request);
106         kanbanConfParam.setIpAddress(realIp);
107
108         return this.kanbanConfService.findPageBySpec(kanbanConfParam);
109     }
110 }