懒羊羊
2024-01-25 d3409e53d656dff668c12a335bcb6f367ca63fdb
提交 | 用户 | 时间
94f7fb 1 package com.jcdm.main.da.paramCollection.controller;
YY 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;
d3409e 7 import com.jcdm.common.enums.BusinessType;
8 import com.jcdm.common.utils.DateUtils;
9 import com.jcdm.common.utils.poi.ExcelUtil;
10 import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
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;
94f7fb 18
YY 19 /**
20  * 设备产品过程参数采集Controller
21  * 
22  * @author yyt
23  * @date 2023-12-13
24  */
25 @RestController
26 @RequestMapping("/main/paramCollection")
27 public class DaParamCollectionController extends BaseController
28 {
29     @Autowired
30     private IDaParamCollectionService daParamCollectionService;
31
32     /**
33      * 查询设备产品过程参数采集列表
34      */
35     @PreAuthorize("@ss.hasPermi('main: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('main: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('main: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('main:paramCollection:add')")
71     @Log(title = "设备产品过程参数采集", businessType = BusinessType.INSERT)
72     @PostMapping
73     public AjaxResult add(@RequestBody DaParamCollection daParamCollection)
74     {
75         daParamCollection.setCreateBy(getUsername());
76         daParamCollection.setCreateTime(DateUtils.getNowDate());
77         return toAjax(daParamCollectionService.insertDaParamCollection(daParamCollection));
78     }
79
80     /**
81      * 修改设备产品过程参数采集
82      */
83     @PreAuthorize("@ss.hasPermi('main:paramCollection:edit')")
84     @Log(title = "设备产品过程参数采集", businessType = BusinessType.UPDATE)
85     @PutMapping
86     public AjaxResult edit(@RequestBody DaParamCollection daParamCollection)
87     {
88         daParamCollection.setUpdateBy(getUsername());
89         daParamCollection.setUpdateTime(DateUtils.getNowDate());
90         return toAjax(daParamCollectionService.updateDaParamCollection(daParamCollection));
91     }
92
93     /**
94      * 删除设备产品过程参数采集
95      */
96     @PreAuthorize("@ss.hasPermi('main: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 }