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