提交 | 用户 | 时间
|
c9abcf
|
1 |
package com.billion.main.sc.controller; |
H |
2 |
|
|
3 |
import java.util.List; |
|
4 |
import javax.servlet.http.HttpServletResponse; |
|
5 |
import org.springframework.security.access.prepost.PreAuthorize; |
|
6 |
import org.springframework.beans.factory.annotation.Autowired; |
|
7 |
import org.springframework.web.bind.annotation.GetMapping; |
|
8 |
import org.springframework.web.bind.annotation.PostMapping; |
|
9 |
import org.springframework.web.bind.annotation.PutMapping; |
|
10 |
import org.springframework.web.bind.annotation.DeleteMapping; |
|
11 |
import org.springframework.web.bind.annotation.PathVariable; |
|
12 |
import org.springframework.web.bind.annotation.RequestBody; |
|
13 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
14 |
import org.springframework.web.bind.annotation.RestController; |
|
15 |
import com.billion.common.annotation.Log; |
|
16 |
import com.billion.common.core.controller.BaseController; |
|
17 |
import com.billion.common.core.domain.AjaxResult; |
|
18 |
import com.billion.common.enums.BusinessType; |
|
19 |
import com.billion.main.sc.domain.ScOpcConf; |
|
20 |
import com.billion.main.sc.service.IScOpcConfService; |
|
21 |
import com.billion.common.utils.poi.ExcelUtil; |
|
22 |
import com.billion.common.core.page.TableDataInfo; |
|
23 |
|
|
24 |
/** |
|
25 |
* OPC交互配置Controller |
|
26 |
* |
|
27 |
* @author HDY |
|
28 |
* @date 2024-11-20 |
|
29 |
*/ |
|
30 |
@RestController |
|
31 |
@RequestMapping("/sc/opcConf") |
|
32 |
public class ScOpcConfController extends BaseController |
|
33 |
{ |
|
34 |
@Autowired |
|
35 |
private IScOpcConfService scOpcConfService; |
|
36 |
|
|
37 |
/** |
|
38 |
* 查询OPC交互配置列表 |
|
39 |
*/ |
|
40 |
@PreAuthorize("@ss.hasPermi('sc:opcConf:list')") |
|
41 |
@GetMapping("/list") |
|
42 |
public TableDataInfo list(ScOpcConf scOpcConf) |
|
43 |
{ |
|
44 |
startPage(); |
|
45 |
List<ScOpcConf> list = scOpcConfService.selectScOpcConfList(scOpcConf); |
|
46 |
return getDataTable(list); |
|
47 |
} |
|
48 |
|
|
49 |
/** |
|
50 |
* 导出OPC交互配置列表 |
|
51 |
*/ |
|
52 |
@PreAuthorize("@ss.hasPermi('sc:opcConf:export')") |
|
53 |
@Log(title = "OPC交互配置", businessType = BusinessType.EXPORT) |
|
54 |
@PostMapping("/export") |
|
55 |
public void export(HttpServletResponse response, ScOpcConf scOpcConf) |
|
56 |
{ |
|
57 |
List<ScOpcConf> list = scOpcConfService.selectScOpcConfList(scOpcConf); |
|
58 |
ExcelUtil<ScOpcConf> util = new ExcelUtil<ScOpcConf>(ScOpcConf.class); |
|
59 |
util.exportExcel(response, list, "OPC交互配置数据"); |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* 获取OPC交互配置详细信息 |
|
64 |
*/ |
|
65 |
@PreAuthorize("@ss.hasPermi('sc:opcConf:query')") |
|
66 |
@GetMapping(value = "/{id}") |
|
67 |
public AjaxResult getInfo(@PathVariable("id") Long id) |
|
68 |
{ |
|
69 |
return success(scOpcConfService.selectScOpcConfById(id)); |
|
70 |
} |
|
71 |
|
|
72 |
/** |
|
73 |
* 新增OPC交互配置 |
|
74 |
*/ |
|
75 |
@PreAuthorize("@ss.hasPermi('sc:opcConf:add')") |
|
76 |
@Log(title = "OPC交互配置", businessType = BusinessType.INSERT) |
|
77 |
@PostMapping |
|
78 |
public AjaxResult add(@RequestBody ScOpcConf scOpcConf) |
|
79 |
{ |
|
80 |
return toAjax(scOpcConfService.insertScOpcConf(scOpcConf)); |
|
81 |
} |
|
82 |
|
|
83 |
/** |
|
84 |
* 修改OPC交互配置 |
|
85 |
*/ |
|
86 |
@PreAuthorize("@ss.hasPermi('sc:opcConf:edit')") |
|
87 |
@Log(title = "OPC交互配置", businessType = BusinessType.UPDATE) |
|
88 |
@PutMapping |
|
89 |
public AjaxResult edit(@RequestBody ScOpcConf scOpcConf) |
|
90 |
{ |
|
91 |
return toAjax(scOpcConfService.updateScOpcConf(scOpcConf)); |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* 删除OPC交互配置 |
|
96 |
*/ |
|
97 |
@PreAuthorize("@ss.hasPermi('sc:opcConf:remove')") |
|
98 |
@Log(title = "OPC交互配置", businessType = BusinessType.DELETE) |
|
99 |
@DeleteMapping("/{ids}") |
|
100 |
public AjaxResult remove(@PathVariable Long[] ids) |
|
101 |
{ |
|
102 |
return toAjax(scOpcConfService.deleteScOpcConfByIds(ids)); |
|
103 |
} |
|
104 |
} |