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