懒羊羊
2024-01-13 5f3a2e98c54ce815f270d149872b2b3d0d008ff0
提交 | 用户 | 时间
b79f97 1 package com.jcdm.main.sc.stationConf.controller;
H 2
3 import java.util.List;
5f3a2e 4 import javax.servlet.http.HttpServletRequest;
b79f97 5 import javax.servlet.http.HttpServletResponse;
5f3a2e 6
7 import com.jcdm.main.util.IpInfoUtils;
b79f97 8 import org.springframework.security.access.prepost.PreAuthorize;
H 9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.web.bind.annotation.GetMapping;
11 import org.springframework.web.bind.annotation.PostMapping;
12 import org.springframework.web.bind.annotation.PutMapping;
13 import org.springframework.web.bind.annotation.DeleteMapping;
14 import org.springframework.web.bind.annotation.PathVariable;
15 import org.springframework.web.bind.annotation.RequestBody;
16 import org.springframework.web.bind.annotation.RequestMapping;
17 import org.springframework.web.bind.annotation.RestController;
18 import com.jcdm.common.annotation.Log;
19 import com.jcdm.common.core.controller.BaseController;
20 import com.jcdm.common.core.domain.AjaxResult;
21 import com.jcdm.common.enums.BusinessType;
22 import com.jcdm.main.sc.stationConf.domain.ScStationConf;
23 import com.jcdm.main.sc.stationConf.service.IScStationConfService;
24 import com.jcdm.common.utils.poi.ExcelUtil;
25 import com.jcdm.common.core.page.TableDataInfo;
26
27 /**
28  * 工位终端配置Controller
29  * 
30  * @author Yi
31  * @date 2024-01-06
32  */
33 @RestController
34 @RequestMapping("/sc/stationConf")
35 public class ScStationConfController extends BaseController
36 {
37     @Autowired
38     private IScStationConfService scStationConfService;
39
40     /**
41      * 查询工位终端配置列表
42      */
43     @PreAuthorize("@ss.hasPermi('sc:stationConf:list')")
44     @GetMapping("/list")
45     public TableDataInfo list(ScStationConf scStationConf)
46     {
47         startPage();
48         List<ScStationConf> list = scStationConfService.selectScStationConfList(scStationConf);
49         return getDataTable(list);
50     }
51
52     /**
53      * 导出工位终端配置列表
54      */
55     @PreAuthorize("@ss.hasPermi('sc:stationConf:export')")
56     @Log(title = "工位终端配置", businessType = BusinessType.EXPORT)
57     @PostMapping("/export")
58     public void export(HttpServletResponse response, ScStationConf scStationConf)
59     {
60         List<ScStationConf> list = scStationConfService.selectScStationConfList(scStationConf);
61         ExcelUtil<ScStationConf> util = new ExcelUtil<ScStationConf>(ScStationConf.class);
62         util.exportExcel(response, list, "工位终端配置数据");
63     }
64
65     /**
66      * 获取工位终端配置详细信息
67      */
68     @PreAuthorize("@ss.hasPermi('sc:stationConf:query')")
69     @GetMapping(value = "/{id}")
70     public AjaxResult getInfo(@PathVariable("id") Long id)
71     {
72         return success(scStationConfService.selectScStationConfById(id));
73     }
74
75     /**
76      * 新增工位终端配置
77      */
78     @PreAuthorize("@ss.hasPermi('sc:stationConf:add')")
79     @Log(title = "工位终端配置", businessType = BusinessType.INSERT)
80     @PostMapping
81     public AjaxResult add(@RequestBody ScStationConf scStationConf)
82     {
83         return toAjax(scStationConfService.insertScStationConf(scStationConf));
84     }
85
86     /**
87      * 修改工位终端配置
88      */
89     @PreAuthorize("@ss.hasPermi('sc:stationConf:edit')")
90     @Log(title = "工位终端配置", businessType = BusinessType.UPDATE)
91     @PutMapping
92     public AjaxResult edit(@RequestBody ScStationConf scStationConf)
93     {
94         return toAjax(scStationConfService.updateScStationConf(scStationConf));
95     }
96
97     /**
98      * 删除工位终端配置
99      */
100     @PreAuthorize("@ss.hasPermi('sc:stationConf:remove')")
101     @Log(title = "工位终端配置", businessType = BusinessType.DELETE)
102     @DeleteMapping("/{ids}")
103     public AjaxResult remove(@PathVariable Long[] ids)
104     {
105         return toAjax(scStationConfService.deleteScStationConfByIds(ids));
106     }
49ac5c 107
108     /**
109      * 获取工位终端配置详细信息
110      */
111     @GetMapping(value = "/getIpv4")
5f3a2e 112     public AjaxResult getIpv4(HttpServletRequest request)
49ac5c 113     {
5f3a2e 114
115         return success(IpInfoUtils.getIpAddr(request));
49ac5c 116     }
117
b79f97 118 }