提交 | 用户 | 时间
|
4d458e
|
1 |
package com.billion.main.da.controller; |
A |
2 |
|
|
3 |
import com.billion.common.annotation.Log; |
|
4 |
import com.billion.common.core.controller.BaseController; |
|
5 |
import com.billion.common.core.domain.AjaxResult; |
|
6 |
import com.billion.common.core.page.TableDataInfo; |
bf5dcc
|
7 |
import com.billion.common.enums.BusinessType; |
H |
8 |
import com.billion.common.utils.DateUtils; |
|
9 |
import com.billion.common.utils.poi.ExcelUtil; |
|
10 |
import com.billion.main.da.domain.DaParamCollection; |
|
11 |
import com.billion.main.da.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; |
4d458e
|
18 |
|
A |
19 |
/** |
|
20 |
* 参数采集Controller |
|
21 |
* |
|
22 |
* @author Billion-Yi |
|
23 |
* @date 2024-11-20 |
|
24 |
*/ |
|
25 |
@RestController |
|
26 |
@RequestMapping("/da/paramCollection") |
|
27 |
public class DaParamCollectionController extends BaseController |
|
28 |
{ |
|
29 |
@Autowired |
|
30 |
private IDaParamCollectionService daParamCollectionService; |
|
31 |
|
|
32 |
/** |
|
33 |
* 查询参数采集列表 |
|
34 |
*/ |
|
35 |
@PreAuthorize("@ss.hasPermi('da:paramCollection:list')") |
|
36 |
@GetMapping("/list") |
|
37 |
public TableDataInfo list(DaParamCollection daParamCollection) |
|
38 |
{ |
|
39 |
startPage(); |
|
40 |
List<DaParamCollection> list = daParamCollectionService.selectDaParamCollectionList(daParamCollection); |
|
41 |
return getDataTable(list); |
|
42 |
} |
|
43 |
|
|
44 |
/** |
|
45 |
* 导出参数采集列表 |
|
46 |
*/ |
|
47 |
@PreAuthorize("@ss.hasPermi('da:paramCollection:export')") |
|
48 |
@Log(title = "参数采集", businessType = BusinessType.EXPORT) |
|
49 |
@PostMapping("/export") |
|
50 |
public void export(HttpServletResponse response, DaParamCollection daParamCollection) |
|
51 |
{ |
|
52 |
List<DaParamCollection> list = daParamCollectionService.selectDaParamCollectionList(daParamCollection); |
|
53 |
ExcelUtil<DaParamCollection> util = new ExcelUtil<DaParamCollection>(DaParamCollection.class); |
|
54 |
util.exportExcel(response, list, "参数采集数据"); |
|
55 |
} |
|
56 |
|
|
57 |
/** |
|
58 |
* 获取参数采集详细信息 |
|
59 |
*/ |
|
60 |
@PreAuthorize("@ss.hasPermi('da:paramCollection:query')") |
|
61 |
@GetMapping(value = "/{id}") |
|
62 |
public AjaxResult getInfo(@PathVariable("id") Long id) |
|
63 |
{ |
|
64 |
return success(daParamCollectionService.selectDaParamCollectionById(id)); |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* 新增参数采集 |
|
69 |
*/ |
|
70 |
@PreAuthorize("@ss.hasPermi('da:paramCollection:add')") |
|
71 |
@Log(title = "参数采集", businessType = BusinessType.INSERT) |
|
72 |
@PostMapping |
|
73 |
public AjaxResult add(@RequestBody DaParamCollection daParamCollection) |
|
74 |
{ |
bf5dcc
|
75 |
daParamCollection.setCreateBy(getUsername()); |
H |
76 |
daParamCollection.setCreateTime(DateUtils.getNowDate()); |
4d458e
|
77 |
return toAjax(daParamCollectionService.insertDaParamCollection(daParamCollection)); |
A |
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* 修改参数采集 |
|
82 |
*/ |
|
83 |
@PreAuthorize("@ss.hasPermi('da:paramCollection:edit')") |
|
84 |
@Log(title = "参数采集", businessType = BusinessType.UPDATE) |
|
85 |
@PutMapping |
|
86 |
public AjaxResult edit(@RequestBody DaParamCollection daParamCollection) |
|
87 |
{ |
bf5dcc
|
88 |
daParamCollection.setUpdateBy(getUsername()); |
H |
89 |
daParamCollection.setUpdateTime(DateUtils.getNowDate()); |
4d458e
|
90 |
return toAjax(daParamCollectionService.updateDaParamCollection(daParamCollection)); |
A |
91 |
} |
|
92 |
|
|
93 |
/** |
|
94 |
* 删除参数采集 |
|
95 |
*/ |
|
96 |
@PreAuthorize("@ss.hasPermi('da:paramCollection:remove')") |
|
97 |
@Log(title = "参数采集", businessType = BusinessType.DELETE) |
|
98 |
@DeleteMapping("/{ids}") |
|
99 |
public AjaxResult remove(@PathVariable Long[] ids) |
|
100 |
{ |
|
101 |
return toAjax(daParamCollectionService.deleteDaParamCollectionByIds(ids)); |
|
102 |
} |
|
103 |
} |