提交 | 用户 | 时间
|
e973ff
|
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.BsLineInfo; |
|
20 |
import com.billion.main.bs.service.IBsLineInfoService; |
|
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-22 |
|
29 |
*/ |
|
30 |
@RestController |
|
31 |
@RequestMapping("/bs/lineInfo") |
|
32 |
public class BsLineInfoController extends BaseController |
|
33 |
{ |
|
34 |
@Autowired |
|
35 |
private IBsLineInfoService bsLineInfoService; |
|
36 |
|
|
37 |
/** |
f6290c
|
38 |
* 产线下拉框列表 |
A |
39 |
*/ |
|
40 |
@GetMapping("/getLineOptions") |
|
41 |
public AjaxResult getLineOptions() |
|
42 |
{ |
|
43 |
return AjaxResult.success(bsLineInfoService.list()); |
|
44 |
} |
|
45 |
|
|
46 |
/** |
e973ff
|
47 |
* 查询产线信息列表 |
A |
48 |
*/ |
|
49 |
@PreAuthorize("@ss.hasPermi('bs:lineInfo:list')") |
|
50 |
@GetMapping("/list") |
|
51 |
public TableDataInfo list(BsLineInfo bsLineInfo) |
|
52 |
{ |
|
53 |
startPage(); |
|
54 |
List<BsLineInfo> list = bsLineInfoService.selectBsLineInfoList(bsLineInfo); |
|
55 |
return getDataTable(list); |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* 导出产线信息列表 |
|
60 |
*/ |
|
61 |
@PreAuthorize("@ss.hasPermi('bs:lineInfo:export')") |
|
62 |
@Log(title = "产线信息", businessType = BusinessType.EXPORT) |
|
63 |
@PostMapping("/export") |
|
64 |
public void export(HttpServletResponse response, BsLineInfo bsLineInfo) |
|
65 |
{ |
|
66 |
List<BsLineInfo> list = bsLineInfoService.selectBsLineInfoList(bsLineInfo); |
|
67 |
ExcelUtil<BsLineInfo> util = new ExcelUtil<BsLineInfo>(BsLineInfo.class); |
|
68 |
util.exportExcel(response, list, "产线信息数据"); |
|
69 |
} |
|
70 |
|
|
71 |
/** |
|
72 |
* 获取产线信息详细信息 |
|
73 |
*/ |
|
74 |
@PreAuthorize("@ss.hasPermi('bs:lineInfo:query')") |
|
75 |
@GetMapping(value = "/{id}") |
|
76 |
public AjaxResult getInfo(@PathVariable("id") Long id) |
|
77 |
{ |
|
78 |
return success(bsLineInfoService.selectBsLineInfoById(id)); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* 新增产线信息 |
|
83 |
*/ |
|
84 |
@PreAuthorize("@ss.hasPermi('bs:lineInfo:add')") |
|
85 |
@Log(title = "产线信息", businessType = BusinessType.INSERT) |
|
86 |
@PostMapping |
|
87 |
public AjaxResult add(@RequestBody BsLineInfo bsLineInfo) |
|
88 |
{ |
|
89 |
return toAjax(bsLineInfoService.insertBsLineInfo(bsLineInfo)); |
|
90 |
} |
|
91 |
|
|
92 |
/** |
|
93 |
* 修改产线信息 |
|
94 |
*/ |
|
95 |
@PreAuthorize("@ss.hasPermi('bs:lineInfo:edit')") |
|
96 |
@Log(title = "产线信息", businessType = BusinessType.UPDATE) |
|
97 |
@PutMapping |
|
98 |
public AjaxResult edit(@RequestBody BsLineInfo bsLineInfo) |
|
99 |
{ |
|
100 |
return toAjax(bsLineInfoService.updateBsLineInfo(bsLineInfo)); |
|
101 |
} |
|
102 |
|
|
103 |
/** |
|
104 |
* 删除产线信息 |
|
105 |
*/ |
|
106 |
@PreAuthorize("@ss.hasPermi('bs:lineInfo:remove')") |
|
107 |
@Log(title = "产线信息", businessType = BusinessType.DELETE) |
|
108 |
@DeleteMapping("/{ids}") |
|
109 |
public AjaxResult remove(@PathVariable Long[] ids) |
|
110 |
{ |
|
111 |
return toAjax(bsLineInfoService.deleteBsLineInfoByIds(ids)); |
|
112 |
} |
|
113 |
} |