春风项目四线(合箱线、总装线)
yyt
2024-05-06 bbc5784cc34d65e64d639d949e75b978fe07bdb3
提交 | 用户 | 时间
fd2207 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;
059083 6 import com.jcdm.common.core.domain.R;
fd2207 7 import com.jcdm.common.core.page.TableDataInfo;
059083 8 import com.jcdm.common.enums.BusinessType;
W 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 com.jcdm.main.da.passingStationCollection.service.impl.DaPassingStationCollectionServiceImpl;
14 import com.jcdm.main.da.passingStationCollection.vo.DaPassingStationVO;
15 import org.springframework.beans.factory.annotation.Autowired;
16 import org.springframework.security.access.prepost.PreAuthorize;
17 import org.springframework.web.bind.annotation.*;
18
19 import javax.annotation.Resource;
20 import javax.servlet.http.HttpServletResponse;
21 import java.util.List;
fd2207 22
23 /**
24  * 产品过站采集Controller
25  * 
26  * @author yyt
27  * @date 2023-12-12
28  */
29 @RestController
30 @RequestMapping("/da/passingStationCollection")
31 public class DaPassingStationCollectionController extends BaseController
32 {
33     @Autowired
34     private IDaPassingStationCollectionService daPassingStationCollectionService;
059083 35
W 36     @Resource
37     private DaPassingStationCollectionServiceImpl passingStationCollectionServiceImpl;
fd2207 38
39     /**
40      * 查询产品过站采集列表
41      */
42     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')")
43     @GetMapping("/list")
44     public TableDataInfo list(DaPassingStationCollection daPassingStationCollection)
45     {
46         startPage();
47         List<DaPassingStationCollection> list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection);
48         return getDataTable(list);
49     }
50
c6e069 51     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')")
W 52     @GetMapping("/getTopProcess")
53     public TableDataInfo getTopProcess()
54     {
55         DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection();
56         List<DaPassingStationVO> list = daPassingStationCollectionService.getTopProcess(daPassingStationCollection);
57         return getDataTable(list);
58     }
5fc587 59     /**
60      * 查询产品过站采集列表
61      */
62     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')")
63     @GetMapping("/noPageList")
64     public TableDataInfo noPageList(DaPassingStationCollection daPassingStationCollection)
65     {
66         List<DaPassingStationCollection> list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection);
67         return getDataTable(list);
68     }
69
9ebb88 70     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')")
W 71     @GetMapping("/getProduceNumToday")
72     public R getProduceNumToday(String fieldName)
73     {
74         Integer num = daPassingStationCollectionService.getProduceNumToday(fieldName);
75         return R.ok(num);
76     }
77
fd2207 78     /**
ff985a 79      * 查询产品过站采集列表
80      */
81     @GetMapping("/insertRepairRecordByIds")
82     public AjaxResult insertRepairRecordByIds(DaPassingStationCollection daPassingStationCollection)
83     {
84         daPassingStationCollectionService.insertRepairRecordByIds(daPassingStationCollection);
85         return AjaxResult.success();
86     }
87
88     /**
fd2207 89      * 导出产品过站采集列表
90      */
91     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:export')")
92     @Log(title = "产品过站采集", businessType = BusinessType.EXPORT)
93     @PostMapping("/export")
94     public void export(HttpServletResponse response, DaPassingStationCollection daPassingStationCollection)
95     {
96         List<DaPassingStationCollection> list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection);
97         ExcelUtil<DaPassingStationCollection> util = new ExcelUtil<DaPassingStationCollection>(DaPassingStationCollection.class);
98         util.exportExcel(response, list, "产品过站采集数据");
99     }
100
101     /**
102      * 获取产品过站采集详细信息
103      */
104     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:query')")
105     @GetMapping(value = "/{id}")
106     public AjaxResult getInfo(@PathVariable("id") Long id)
107     {
108         return success(daPassingStationCollectionService.selectDaPassingStationCollectionById(id));
109     }
110
111     /**
112      * 新增产品过站采集
113      */
114     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:add')")
115     @Log(title = "产品过站采集", businessType = BusinessType.INSERT)
116     @PostMapping
117     public AjaxResult add(@RequestBody DaPassingStationCollection daPassingStationCollection)
118     {
119         daPassingStationCollection.setCreateBy(getUsername());
120         daPassingStationCollection.setCreateTime(DateUtils.getNowDate());
121         return toAjax(daPassingStationCollectionService.insertDaPassingStationCollection(daPassingStationCollection));
122     }
123
124     /**
125      * 修改产品过站采集
126      */
127     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:edit')")
128     @Log(title = "产品过站采集", businessType = BusinessType.UPDATE)
129     @PutMapping
130     public AjaxResult edit(@RequestBody DaPassingStationCollection daPassingStationCollection)
131     {
132         daPassingStationCollection.setUpdateBy(getUsername());
133         daPassingStationCollection.setUpdateTime(DateUtils.getNowDate());
134         return toAjax(daPassingStationCollectionService.updateDaPassingStationCollection(daPassingStationCollection));
135     }
136
137     /**
138      * 删除产品过站采集
139      */
140     @PreAuthorize("@ss.hasPermi('da:passingStationCollection:remove')")
141     @Log(title = "产品过站采集", businessType = BusinessType.DELETE)
142     @DeleteMapping("/{ids}")
143     public AjaxResult remove(@PathVariable Long[] ids)
144     {
145         return toAjax(daPassingStationCollectionService.deleteDaPassingStationCollectionByIds(ids));
146     }
059083 147
W 148     //设置定时十秒一次
149 //    @Scheduled(cron = "0/10 * * * * ?")
150 //    @PostMapping("/send")
151 //    public String sendMessage(String message) throws Exception {
152 //        if (StringUtils.isEmpty(message)){
153 //            message = "TESTMESSAGE";
154 //        }
155 //        return passingStationCollectionServiceImpl.sendMessage(message);
156 //    }
fd2207 157 }