懒羊羊
2024-01-25 d3409e53d656dff668c12a335bcb6f367ca63fdb
提交 | 用户 | 时间
7c651d 1 package com.jcdm.main.da.passingStationCollection.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;
d3409e 6 import com.jcdm.common.core.domain.R;
7c651d 7 import com.jcdm.common.core.page.TableDataInfo;
d3409e 8 import com.jcdm.common.enums.BusinessType;
9 import com.jcdm.common.utils.DateUtils;
10 import com.jcdm.common.utils.poi.ExcelUtil;
11 import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
12 import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.security.access.prepost.PreAuthorize;
15 import org.springframework.web.bind.annotation.*;
16
17 import javax.servlet.http.HttpServletResponse;
18 import java.util.List;
7c651d 19
YY 20 /**
21  * 产品过站采集Controller
22  * 
23  * @author yyt
24  * @date 2023-12-12
25  */
26 @RestController
27 @RequestMapping("/da/passingStationCollection")
28 public class DaPassingStationCollectionController extends BaseController
29 {
30     @Autowired
31     private IDaPassingStationCollectionService daPassingStationCollectionService;
32
33     /**
34      * 查询产品过站采集列表
35      */
36     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')")
37     @GetMapping("/list")
38     public TableDataInfo list(DaPassingStationCollection daPassingStationCollection)
39     {
40         startPage();
41         List<DaPassingStationCollection> list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection);
42         return getDataTable(list);
43     }
44
45     /**
d3409e 46      * 查询产品过站采集列表
47      */
48     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')")
49     @GetMapping("/noPageList")
50     public TableDataInfo noPageList(DaPassingStationCollection daPassingStationCollection)
51     {
52         List<DaPassingStationCollection> list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection);
53         return getDataTable(list);
54     }
55
56 //    @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')")
57 //    @GetMapping("/getProduceNumToday")
58 //    public R getProduceNumToday(String fieldName)
59 //    {
60 //        Integer num = daPassingStationCollectionService.getProduceNumToday(fieldName);
61 //        return R.ok(num);
62 //    }
63
64     /**
65      * 查询产品过站采集列表
66      */
67     @GetMapping("/insertRepairRecordByIds")
68     public AjaxResult insertRepairRecordByIds(DaPassingStationCollection daPassingStationCollection)
69     {
70         daPassingStationCollectionService.insertRepairRecordByIds(daPassingStationCollection);
71         return AjaxResult.success();
72     }
73
74     /**
7c651d 75      * 导出产品过站采集列表
YY 76      */
77     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:export')")
78     @Log(title = "产品过站采集", businessType = BusinessType.EXPORT)
79     @PostMapping("/export")
80     public void export(HttpServletResponse response, DaPassingStationCollection daPassingStationCollection)
81     {
82         List<DaPassingStationCollection> list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection);
83         ExcelUtil<DaPassingStationCollection> util = new ExcelUtil<DaPassingStationCollection>(DaPassingStationCollection.class);
84         util.exportExcel(response, list, "产品过站采集数据");
85     }
86
87     /**
88      * 获取产品过站采集详细信息
89      */
90     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:query')")
91     @GetMapping(value = "/{id}")
92     public AjaxResult getInfo(@PathVariable("id") Long id)
93     {
94         return success(daPassingStationCollectionService.selectDaPassingStationCollectionById(id));
95     }
96
97     /**
98      * 新增产品过站采集
99      */
100     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:add')")
101     @Log(title = "产品过站采集", businessType = BusinessType.INSERT)
102     @PostMapping
103     public AjaxResult add(@RequestBody DaPassingStationCollection daPassingStationCollection)
104     {
94f7fb 105         daPassingStationCollection.setCreateBy(getUsername());
YY 106         daPassingStationCollection.setCreateTime(DateUtils.getNowDate());
7c651d 107         return toAjax(daPassingStationCollectionService.insertDaPassingStationCollection(daPassingStationCollection));
YY 108     }
109
110     /**
111      * 修改产品过站采集
112      */
113     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:edit')")
114     @Log(title = "产品过站采集", businessType = BusinessType.UPDATE)
115     @PutMapping
116     public AjaxResult edit(@RequestBody DaPassingStationCollection daPassingStationCollection)
117     {
94f7fb 118         daPassingStationCollection.setUpdateBy(getUsername());
YY 119         daPassingStationCollection.setUpdateTime(DateUtils.getNowDate());
7c651d 120         return toAjax(daPassingStationCollectionService.updateDaPassingStationCollection(daPassingStationCollection));
YY 121     }
122
123     /**
124      * 删除产品过站采集
125      */
126     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:remove')")
127     @Log(title = "产品过站采集", businessType = BusinessType.DELETE)
128     @DeleteMapping("/{ids}")
129     public AjaxResult remove(@PathVariable Long[] ids)
130     {
131         return toAjax(daPassingStationCollectionService.deleteDaPassingStationCollectionByIds(ids));
132     }
133 }