春风项目四线(合箱线、总装线)
jiang
2024-01-30 d82e4465e5e3c9e9f93a8ce7ce3b8c0f73fdf991
提交 | 用户 | 时间
fd2207 1 package com.jcdm.main.bs.processes.controller;
2
3 import java.util.List;
4 import javax.servlet.http.HttpServletResponse;
5
6 import com.jcdm.main.bs.processes.domain.BsProcessesInfo;
7 import com.jcdm.main.bs.processes.service.IBsProcessesInfoService;
8 import org.springframework.security.access.prepost.PreAuthorize;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.web.bind.annotation.GetMapping;
11 import org.springframework.web.bind.annotation.PostMapping;
12 import org.springframework.web.bind.annotation.PutMapping;
13 import org.springframework.web.bind.annotation.DeleteMapping;
14 import org.springframework.web.bind.annotation.PathVariable;
15 import org.springframework.web.bind.annotation.RequestBody;
16 import org.springframework.web.bind.annotation.RequestMapping;
17 import org.springframework.web.bind.annotation.RestController;
18 import com.jcdm.common.annotation.Log;
19 import com.jcdm.common.core.controller.BaseController;
20 import com.jcdm.common.core.domain.AjaxResult;
21 import com.jcdm.common.enums.BusinessType;
22 import com.jcdm.common.utils.poi.ExcelUtil;
23 import com.jcdm.common.core.page.TableDataInfo;
24
25 /**
26  * 工序信息Controller
27  * 
28  * @author ruimin
29  * @date 2023-12-09
30  */
31 @RestController
32 @RequestMapping("/bs/processes")
33 public class BsProcessesInfoController extends BaseController
34 {
35     @Autowired
36     private IBsProcessesInfoService bsProcessesInfoService;
37
38     /**
39      * 查询工序信息列表
40      */
41     @PreAuthorize("@ss.hasPermi('bs:processes:list')")
42     @GetMapping("/list")
43     public TableDataInfo list(BsProcessesInfo bsProcessesInfo)
44     {
45         startPage();
46         List<BsProcessesInfo> list = bsProcessesInfoService.selectBsProcessesInfoList(bsProcessesInfo);
47         return getDataTable(list);
48     }
49
50     /**
51      * 导出工序信息列表
52      */
53     @PreAuthorize("@ss.hasPermi('bs:processes:export')")
54     @Log(title = "工序信息", businessType = BusinessType.EXPORT)
55     @PostMapping("/export")
56     public void export(HttpServletResponse response, BsProcessesInfo bsProcessesInfo)
57     {
58         List<BsProcessesInfo> list = bsProcessesInfoService.selectBsProcessesInfoList(bsProcessesInfo);
59         ExcelUtil<BsProcessesInfo> util = new ExcelUtil<BsProcessesInfo>(BsProcessesInfo.class);
60         util.exportExcel(response, list, "工序信息数据");
61     }
62
63     /**
64      * 获取工序信息详细信息
65      */
66     @PreAuthorize("@ss.hasPermi('bs:processes:query')")
67     @GetMapping(value = "/{id}")
68     public AjaxResult getInfo(@PathVariable("id") Long id)
69     {
70         return success(bsProcessesInfoService.selectBsProcessesInfoById(id));
71     }
72
73     /**
74      * 新增工序信息
75      */
76     @PreAuthorize("@ss.hasPermi('bs:processes:add')")
77     @Log(title = "工序信息", businessType = BusinessType.INSERT)
78     @PostMapping
79     public AjaxResult add(@RequestBody BsProcessesInfo bsProcessesInfo)
80     {
81         return toAjax(bsProcessesInfoService.insertBsProcessesInfo(bsProcessesInfo));
82     }
83
84     /**
85      * 修改工序信息
86      */
87     @PreAuthorize("@ss.hasPermi('bs:processes:edit')")
88     @Log(title = "工序信息", businessType = BusinessType.UPDATE)
89     @PutMapping
90     public AjaxResult edit(@RequestBody BsProcessesInfo bsProcessesInfo)
91     {
92         return toAjax(bsProcessesInfoService.updateBsProcessesInfo(bsProcessesInfo));
93     }
94
95     /**
96      * 删除工序信息
97      */
98     @PreAuthorize("@ss.hasPermi('bs:processes:remove')")
99     @Log(title = "工序信息", businessType = BusinessType.DELETE)
100     @DeleteMapping("/{ids}")
101     public AjaxResult remove(@PathVariable Long[] ids)
102     {
103         return toAjax(bsProcessesInfoService.deleteBsProcessesInfoByIds(ids));
104     }
105 }