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