admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
提交 | 用户 | 时间
e57a89 1 package com.jcdm.main.da.passingStationCollection.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.domain.R;
7 import com.jcdm.common.core.page.TableDataInfo;
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;
19
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     /**
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     /**
75      * 导出产品过站采集列表
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     {
105         daPassingStationCollection.setCreateBy(getUsername());
106         daPassingStationCollection.setCreateTime(DateUtils.getNowDate());
107         return toAjax(daPassingStationCollectionService.insertDaPassingStationCollection(daPassingStationCollection));
108     }
109
06713a 110     @PostMapping("/jrmAddPassingStationCollection")
A 111     public AjaxResult jrmAddPassingStationCollection(@RequestBody DaPassingStationCollection daPassingStationCollection)
112     {
113         daPassingStationCollection.setCreateBy(getUsername());
114         daPassingStationCollection.setCreateTime(DateUtils.getNowDate());
115         return toAjax(daPassingStationCollectionService.jrmAddPassingStationCollection(daPassingStationCollection));
116     }
117
e57a89 118     /**
119      * 修改产品过站采集
120      */
121     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:edit')")
122     @Log(title = "产品过站采集", businessType = BusinessType.UPDATE)
123     @PutMapping
124     public AjaxResult edit(@RequestBody DaPassingStationCollection daPassingStationCollection)
125     {
126         daPassingStationCollection.setUpdateBy(getUsername());
127         daPassingStationCollection.setUpdateTime(DateUtils.getNowDate());
128         return toAjax(daPassingStationCollectionService.updateDaPassingStationCollection(daPassingStationCollection));
129     }
130
131     /**
132      * 删除产品过站采集
133      */
134     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:remove')")
135     @Log(title = "产品过站采集", businessType = BusinessType.DELETE)
136     @DeleteMapping("/{ids}")
137     public AjaxResult remove(@PathVariable Long[] ids)
138     {
139         return toAjax(daPassingStationCollectionService.deleteDaPassingStationCollectionByIds(ids));
140     }
141 }