提交 | 用户 | 时间
|
e4c3b0
|
1 |
package com.jcdm.main.da.opcuaconfig.controller; |
Y |
2 |
|
054abe
|
3 |
import java.util.List; |
Y |
4 |
import javax.servlet.http.HttpServletResponse; |
|
5 |
|
|
6 |
import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; |
0b1422
|
7 |
import com.jcdm.main.da.opcuaconfig.domain.NodeEntity; |
054abe
|
8 |
import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService; |
Y |
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; |
e4c3b0
|
19 |
import com.jcdm.common.annotation.Log; |
Y |
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.common.utils.poi.ExcelUtil; |
054abe
|
24 |
import com.jcdm.common.core.page.TableDataInfo; |
e4c3b0
|
25 |
|
Y |
26 |
/** |
054abe
|
27 |
* 交互信号配置Controller |
e4c3b0
|
28 |
* |
Y |
29 |
* @author yyt |
28cd73
|
30 |
* @date 2024-01-23 |
e4c3b0
|
31 |
*/ |
Y |
32 |
@RestController |
|
33 |
@RequestMapping("/da/opcuaconfig") |
|
34 |
public class DaOpcuaConfigController extends BaseController |
|
35 |
{ |
|
36 |
@Autowired |
|
37 |
private IDaOpcuaConfigService daOpcuaConfigService; |
|
38 |
|
|
39 |
/** |
054abe
|
40 |
* 查询交互信号配置列表 |
e4c3b0
|
41 |
*/ |
Y |
42 |
@PreAuthorize("@ss.hasPermi('da:opcuaconfig:list')") |
|
43 |
@GetMapping("/list") |
|
44 |
public TableDataInfo list(DaOpcuaConfig daOpcuaConfig) |
|
45 |
{ |
|
46 |
startPage(); |
|
47 |
List<DaOpcuaConfig> list = daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig); |
|
48 |
return getDataTable(list); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
054abe
|
52 |
* 导出交互信号配置列表 |
e4c3b0
|
53 |
*/ |
Y |
54 |
@PreAuthorize("@ss.hasPermi('da:opcuaconfig:export')") |
054abe
|
55 |
@Log(title = "交互信号配置", businessType = BusinessType.EXPORT) |
e4c3b0
|
56 |
@PostMapping("/export") |
Y |
57 |
public void export(HttpServletResponse response, DaOpcuaConfig daOpcuaConfig) |
|
58 |
{ |
|
59 |
List<DaOpcuaConfig> list = daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig); |
|
60 |
ExcelUtil<DaOpcuaConfig> util = new ExcelUtil<DaOpcuaConfig>(DaOpcuaConfig.class); |
054abe
|
61 |
util.exportExcel(response, list, "交互信号配置数据"); |
e4c3b0
|
62 |
} |
Y |
63 |
|
|
64 |
/** |
054abe
|
65 |
* 获取交互信号配置详细信息 |
e4c3b0
|
66 |
*/ |
Y |
67 |
@PreAuthorize("@ss.hasPermi('da:opcuaconfig:query')") |
|
68 |
@GetMapping(value = "/{id}") |
|
69 |
public AjaxResult getInfo(@PathVariable("id") Long id) |
|
70 |
{ |
|
71 |
return success(daOpcuaConfigService.selectDaOpcuaConfigById(id)); |
|
72 |
} |
|
73 |
|
|
74 |
/** |
054abe
|
75 |
* 新增交互信号配置 |
e4c3b0
|
76 |
*/ |
Y |
77 |
@PreAuthorize("@ss.hasPermi('da:opcuaconfig:add')") |
054abe
|
78 |
@Log(title = "交互信号配置", businessType = BusinessType.INSERT) |
e4c3b0
|
79 |
@PostMapping |
Y |
80 |
public AjaxResult add(@RequestBody DaOpcuaConfig daOpcuaConfig) |
|
81 |
{ |
|
82 |
return toAjax(daOpcuaConfigService.insertDaOpcuaConfig(daOpcuaConfig)); |
|
83 |
} |
|
84 |
|
|
85 |
/** |
054abe
|
86 |
* 修改交互信号配置 |
e4c3b0
|
87 |
*/ |
Y |
88 |
@PreAuthorize("@ss.hasPermi('da:opcuaconfig:edit')") |
054abe
|
89 |
@Log(title = "交互信号配置", businessType = BusinessType.UPDATE) |
e4c3b0
|
90 |
@PutMapping |
Y |
91 |
public AjaxResult edit(@RequestBody DaOpcuaConfig daOpcuaConfig) |
|
92 |
{ |
|
93 |
return toAjax(daOpcuaConfigService.updateDaOpcuaConfig(daOpcuaConfig)); |
|
94 |
} |
|
95 |
|
|
96 |
/** |
054abe
|
97 |
* 删除交互信号配置 |
e4c3b0
|
98 |
*/ |
Y |
99 |
@PreAuthorize("@ss.hasPermi('da:opcuaconfig:remove')") |
054abe
|
100 |
@Log(title = "交互信号配置", businessType = BusinessType.DELETE) |
e4c3b0
|
101 |
@DeleteMapping("/{ids}") |
Y |
102 |
public AjaxResult remove(@PathVariable Long[] ids) |
|
103 |
{ |
|
104 |
return toAjax(daOpcuaConfigService.deleteDaOpcuaConfigByIds(ids)); |
|
105 |
} |
0b1422
|
106 |
|
Y |
107 |
/** |
|
108 |
* 获取交互信号配置详细信息 |
|
109 |
*/ |
|
110 |
@PreAuthorize("@ss.hasPermi('da:opcuaconfig:query')") |
|
111 |
@GetMapping(value = "/SNCode/{SNCode}/{locationCode}") |
|
112 |
public AjaxResult setSNCode(@PathVariable("SNCode") String SNCode,@PathVariable("locationCode") String locationCode) { |
3e03af
|
113 |
//NodeEntity node= NodeEntity.builder().index(2).identifier("CFL4CVT"+"."+locationCode+".SNCode").value(SNCode).type("string").build(); |
0b1422
|
114 |
Boolean out= null; |
Y |
115 |
try { |
3e03af
|
116 |
// out = ClientHandler.write(node); |
0b1422
|
117 |
} catch (Exception e) { |
Y |
118 |
throw new RuntimeException(e); |
|
119 |
} |
|
120 |
|
|
121 |
return toAjax(out); |
|
122 |
} |
e4c3b0
|
123 |
} |