-
懒羊羊
2024-03-23 e20d7373595960ad6be9bd6373a3c6f186e76e5c
提交 | 用户 | 时间
e57a89 1 package com.jcdm.main.da.paramCollection.controller;
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.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;
18
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     /**
b64ed2 81      * 基础参数增加
82      */
83     @PostMapping("/addBasicParameters")
84     public void addBasicParameters(@RequestBody DaParamCollection daParamCollection)
85     {
86         daParamCollectionService.addBasicParameters(daParamCollection);
87     }
88
89     /**
49c784 90      * 拧紧参数增加
91      */
92     @PostMapping("/addTighteningParameters")
93     public void addTighteningParameters(@RequestBody DaParamCollection daParamCollection)
94     {
95         daParamCollectionService.addTighteningParameters(daParamCollection);
96     }
97
98     /**
32483a 99      * 出战时间参数增加
100      */
101     @PostMapping("/saveCampaignTimeParameters")
102     public void saveCampaignTimeParameters(@RequestBody DaParamCollection daParamCollection)
103     {
104         daParamCollectionService.saveCampaignTimeParameters(daParamCollection);
105     }
106
107     /**
e57a89 108      * 修改设备产品过程参数采集
109      */
110     @PreAuthorize("@ss.hasPermi('main:paramCollection:edit')")
111     @Log(title = "设备产品过程参数采集", businessType = BusinessType.UPDATE)
112     @PutMapping
113     public AjaxResult edit(@RequestBody DaParamCollection daParamCollection)
114     {
115         daParamCollection.setUpdateBy(getUsername());
116         daParamCollection.setUpdateTime(DateUtils.getNowDate());
117         return toAjax(daParamCollectionService.updateDaParamCollection(daParamCollection));
118     }
119
120     /**
121      * 删除设备产品过程参数采集
122      */
123     @PreAuthorize("@ss.hasPermi('main:paramCollection:remove')")
124     @Log(title = "设备产品过程参数采集", businessType = BusinessType.DELETE)
125     @DeleteMapping("/{ids}")
126     public AjaxResult remove(@PathVariable Long[] ids)
127     {
128         return toAjax(daParamCollectionService.deleteDaParamCollectionByIds(ids));
129     }
49c784 130
e57a89 131 }