春风项目四线(合箱线、总装线)
wujian
2024-04-28 9bc5106810d7c0e6f27e904b584c9bbfb3725a19
提交 | 用户 | 时间
fd2207 1 package com.jcdm.main.bs.technologyRoute.controller;
2
3 import java.util.List;
4 import javax.servlet.http.HttpServletResponse;
5
6 import com.jcdm.main.bs.technologyRoute.domain.BsTechnologyRouteInfo;
7 import com.jcdm.main.bs.technologyRoute.service.IBsTechnologyRouteInfoService;
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/technologyRoute")
33 public class BsTechnologyRouteInfoController extends BaseController
34 {
35     @Autowired
36     private IBsTechnologyRouteInfoService bsTechnologyRouteInfoService;
37
38     /**
39      * 查询工艺流程列表
40      */
41     @PreAuthorize("@ss.hasPermi('bs:technologyRoute:list')")
42     @GetMapping("/list")
43     public TableDataInfo list(BsTechnologyRouteInfo bsTechnologyRouteInfo)
44     {
45         startPage();
46         List<BsTechnologyRouteInfo> list = bsTechnologyRouteInfoService.selectBsTechnologyRouteInfoList(bsTechnologyRouteInfo);
47         return getDataTable(list);
48     }
49
50     /**
51      * 导出工艺流程列表
52      */
53     @PreAuthorize("@ss.hasPermi('bs:technologyRoute:export')")
54     @Log(title = "工艺流程", businessType = BusinessType.EXPORT)
55     @PostMapping("/export")
56     public void export(HttpServletResponse response, BsTechnologyRouteInfo bsTechnologyRouteInfo)
57     {
58         List<BsTechnologyRouteInfo> list = bsTechnologyRouteInfoService.selectBsTechnologyRouteInfoList(bsTechnologyRouteInfo);
59         ExcelUtil<BsTechnologyRouteInfo> util = new ExcelUtil<BsTechnologyRouteInfo>(BsTechnologyRouteInfo.class);
60         util.exportExcel(response, list, "工艺流程数据");
61     }
62
63     /**
64      * 获取工艺流程详细信息
65      */
66     @PreAuthorize("@ss.hasPermi('bs:technologyRoute:query')")
67     @GetMapping(value = "/{id}")
68     public AjaxResult getInfo(@PathVariable("id") Long id)
69     {
70         return success(bsTechnologyRouteInfoService.selectBsTechnologyRouteInfoById(id));
71     }
72
73     /**
74      * 新增工艺流程
75      */
76     @PreAuthorize("@ss.hasPermi('bs:technologyRoute:add')")
77     @Log(title = "工艺流程", businessType = BusinessType.INSERT)
78     @PostMapping
79     public AjaxResult add(@RequestBody BsTechnologyRouteInfo bsTechnologyRouteInfo)
80     {
81         return toAjax(bsTechnologyRouteInfoService.insertBsTechnologyRouteInfo(bsTechnologyRouteInfo));
82     }
83
84     /**
85      * 修改工艺流程
86      */
87     @PreAuthorize("@ss.hasPermi('bs:technologyRoute:edit')")
88     @Log(title = "工艺流程", businessType = BusinessType.UPDATE)
89     @PutMapping
90     public AjaxResult edit(@RequestBody BsTechnologyRouteInfo bsTechnologyRouteInfo)
91     {
92         return toAjax(bsTechnologyRouteInfoService.updateBsTechnologyRouteInfo(bsTechnologyRouteInfo));
93     }
94
95     /**
96      * 修改工艺流程以及子工艺
97      */
98     @PreAuthorize("@ss.hasPermi('bs:technologyRouteAndChild:edit')")
99     @Log(title = "工艺流程And子信息", businessType = BusinessType.UPDATE)
100     @PutMapping("/technologyRouteAndChild")
101     public AjaxResult technologyRouteAndChild(@RequestBody BsTechnologyRouteInfo bsTechnologyRouteInfo)
102     {
103         return toAjax(bsTechnologyRouteInfoService.updateBsTechnologyRouteAndChildInfo(bsTechnologyRouteInfo));
104     }
105
106     /**
107      * 删除工艺流程
108      */
109     @PreAuthorize("@ss.hasPermi('bs:technologyRoute:remove')")
110     @Log(title = "工艺流程", businessType = BusinessType.DELETE)
111     @DeleteMapping("/{ids}")
112     public AjaxResult remove(@PathVariable Long[] ids)
113     {
114         return toAjax(bsTechnologyRouteInfoService.deleteBsTechnologyRouteInfoByIds(ids));
115     }
116 }