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