提交 | 用户 | 时间
|
fd2207
|
1 |
package com.jcdm.main.bs.productBomChild.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.productBomChild.domain.BsProductBomChildInfo; |
|
8 |
import com.jcdm.main.bs.productBomChild.service.IBsProductBomChildInfoService; |
|
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 |
* 基础BOM子信息Controller |
|
28 |
* |
|
29 |
* @author yyt |
|
30 |
* @date 2023-12-11 |
|
31 |
*/ |
|
32 |
@RestController |
|
33 |
@RequestMapping("/bs/ProductBomChild") |
|
34 |
public class BsProductBomChildInfoController extends BaseController |
|
35 |
{ |
|
36 |
@Autowired |
|
37 |
private IBsProductBomChildInfoService bsProductBomChildInfoService; |
|
38 |
|
|
39 |
/** |
|
40 |
* 查询基础BOM子信息列表 |
|
41 |
*/ |
|
42 |
@PreAuthorize("@ss.hasPermi('bs:ProductBomChild:list')") |
|
43 |
@GetMapping("/list") |
|
44 |
public TableDataInfo list(BsProductBomChildInfo bsProductBomChildInfo) |
|
45 |
{ |
|
46 |
startPage(); |
|
47 |
List<BsProductBomChildInfo> list = bsProductBomChildInfoService.selectBsProductBomChildInfoList(bsProductBomChildInfo); |
|
48 |
return getDataTable(list); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* 导出基础BOM子信息列表 |
|
53 |
*/ |
|
54 |
@PreAuthorize("@ss.hasPermi('bs:ProductBomChild:export')") |
|
55 |
@Log(title = "基础BOM子信息", businessType = BusinessType.EXPORT) |
|
56 |
@PostMapping("/export") |
|
57 |
public void export(HttpServletResponse response, BsProductBomChildInfo bsProductBomChildInfo) |
|
58 |
{ |
|
59 |
List<BsProductBomChildInfo> list = bsProductBomChildInfoService.selectBsProductBomChildInfoList(bsProductBomChildInfo); |
|
60 |
ExcelUtil<BsProductBomChildInfo> util = new ExcelUtil<BsProductBomChildInfo>(BsProductBomChildInfo.class); |
|
61 |
util.exportExcel(response, list, "基础BOM子信息数据"); |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* 获取基础BOM子信息详细信息 |
|
66 |
*/ |
|
67 |
@PreAuthorize("@ss.hasPermi('bs:ProductBomChild:query')") |
|
68 |
@GetMapping(value = "/{id}") |
|
69 |
public AjaxResult getInfo(@PathVariable("id") Long id) |
|
70 |
{ |
|
71 |
return success(bsProductBomChildInfoService.selectBsProductBomChildInfoById(id)); |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* 新增基础BOM子信息 |
|
76 |
*/ |
|
77 |
@PreAuthorize("@ss.hasPermi('bs:ProductBomChild:add')") |
|
78 |
@Log(title = "基础BOM子信息", businessType = BusinessType.INSERT) |
|
79 |
@PostMapping |
|
80 |
public AjaxResult add(@RequestBody BsProductBomChildInfo bsProductBomChildInfo) |
|
81 |
{ |
|
82 |
bsProductBomChildInfo.setCreateBy(getUsername()); |
|
83 |
bsProductBomChildInfo.setCreateTime(DateUtils.getNowDate()); |
|
84 |
return toAjax(bsProductBomChildInfoService.insertBsProductBomChildInfo(bsProductBomChildInfo)); |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* 修改基础BOM子信息 |
|
89 |
*/ |
|
90 |
@PreAuthorize("@ss.hasPermi('bs:ProductBomChild:edit')") |
|
91 |
@Log(title = "基础BOM子信息", businessType = BusinessType.UPDATE) |
|
92 |
@PutMapping |
|
93 |
public AjaxResult edit(@RequestBody BsProductBomChildInfo bsProductBomChildInfo) |
|
94 |
{ |
|
95 |
bsProductBomChildInfo.setUpdateBy(getUsername()); |
|
96 |
bsProductBomChildInfo.setUpdateTime(DateUtils.getNowDate()); |
|
97 |
return toAjax(bsProductBomChildInfoService.updateBsProductBomChildInfo(bsProductBomChildInfo)); |
|
98 |
} |
|
99 |
|
|
100 |
/** |
|
101 |
* 删除基础BOM子信息 |
|
102 |
*/ |
|
103 |
@PreAuthorize("@ss.hasPermi('bs:ProductBomChild:remove')") |
|
104 |
@Log(title = "基础BOM子信息", businessType = BusinessType.DELETE) |
|
105 |
@DeleteMapping("/{ids}") |
|
106 |
public AjaxResult remove(@PathVariable Long[] ids) |
|
107 |
{ |
|
108 |
return toAjax(bsProductBomChildInfoService.deleteBsProductBomChildInfoByIds(ids)); |
|
109 |
} |
|
110 |
} |