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