提交 | 用户 | 时间
|
fb3b3e
|
1 |
package com.billion.main.bs.controller; |
吴 |
2 |
|
|
3 |
import java.util.List; |
|
4 |
import javax.servlet.http.HttpServletResponse; |
|
5 |
|
|
6 |
import com.billion.common.utils.poi.ExcelUtil; |
|
7 |
import com.billion.main.bs.domain.BsFormulaChildInfo; |
|
8 |
import com.billion.main.bs.service.IBsFormulaChildInfoService; |
|
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.billion.common.annotation.Log; |
|
20 |
import com.billion.common.core.controller.BaseController; |
|
21 |
import com.billion.common.core.domain.AjaxResult; |
|
22 |
import com.billion.common.enums.BusinessType; |
|
23 |
import com.billion.common.core.page.TableDataInfo; |
|
24 |
|
|
25 |
/** |
|
26 |
* 配方配置子信息Controller |
|
27 |
* |
|
28 |
* @author Billion |
|
29 |
* @date 2024-11-26 |
|
30 |
*/ |
|
31 |
@RestController |
|
32 |
@RequestMapping("/formulaChildInfo") |
|
33 |
public class BsFormulaChildInfoController extends BaseController |
|
34 |
{ |
|
35 |
@Autowired |
|
36 |
private IBsFormulaChildInfoService bsFormulaChildInfoService; |
|
37 |
|
|
38 |
/** |
|
39 |
* 查询配方配置子信息列表 |
|
40 |
*/ |
|
41 |
@PreAuthorize("@ss.hasPermi('main:info:list')") |
|
42 |
@GetMapping("/list") |
|
43 |
public TableDataInfo list(BsFormulaChildInfo bsFormulaChildInfo) |
|
44 |
{ |
|
45 |
startPage(); |
|
46 |
List<BsFormulaChildInfo> list = bsFormulaChildInfoService.selectBsFormulaChildInfoList(bsFormulaChildInfo); |
|
47 |
return getDataTable(list); |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* 导出配方配置子信息列表 |
|
52 |
*/ |
|
53 |
@PreAuthorize("@ss.hasPermi('main:info:export')") |
|
54 |
@Log(title = "配方配置子信息", businessType = BusinessType.EXPORT) |
|
55 |
@PostMapping("/export") |
|
56 |
public void export(HttpServletResponse response, BsFormulaChildInfo bsFormulaChildInfo) |
|
57 |
{ |
|
58 |
List<BsFormulaChildInfo> list = bsFormulaChildInfoService.selectBsFormulaChildInfoList(bsFormulaChildInfo); |
|
59 |
ExcelUtil<BsFormulaChildInfo> util = new ExcelUtil<BsFormulaChildInfo>(BsFormulaChildInfo.class); |
|
60 |
util.exportExcel(response, list, "配方配置子信息数据"); |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* 获取配方配置子信息详细信息 |
|
65 |
*/ |
|
66 |
@PreAuthorize("@ss.hasPermi('main:info:query')") |
|
67 |
@GetMapping(value = "/{id}") |
|
68 |
public AjaxResult getInfo(@PathVariable("id") Long id) |
|
69 |
{ |
|
70 |
return success(bsFormulaChildInfoService.selectBsFormulaChildInfoById(id)); |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* 新增配方配置子信息 |
|
75 |
*/ |
|
76 |
@PreAuthorize("@ss.hasPermi('main:info:add')") |
|
77 |
@Log(title = "配方配置子信息", businessType = BusinessType.INSERT) |
|
78 |
@PostMapping |
|
79 |
public AjaxResult add(@RequestBody BsFormulaChildInfo bsFormulaChildInfo) |
|
80 |
{ |
|
81 |
return toAjax(bsFormulaChildInfoService.insertBsFormulaChildInfo(bsFormulaChildInfo)); |
|
82 |
} |
|
83 |
|
|
84 |
/** |
|
85 |
* 修改配方配置子信息 |
|
86 |
*/ |
|
87 |
@PreAuthorize("@ss.hasPermi('main:info:edit')") |
|
88 |
@Log(title = "配方配置子信息", businessType = BusinessType.UPDATE) |
|
89 |
@PutMapping |
|
90 |
public AjaxResult edit(@RequestBody BsFormulaChildInfo bsFormulaChildInfo) |
|
91 |
{ |
|
92 |
return toAjax(bsFormulaChildInfoService.updateBsFormulaChildInfo(bsFormulaChildInfo)); |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* 删除配方配置子信息 |
|
97 |
*/ |
|
98 |
@PreAuthorize("@ss.hasPermi('main:info:remove')") |
|
99 |
@Log(title = "配方配置子信息", businessType = BusinessType.DELETE) |
|
100 |
@DeleteMapping("/{ids}") |
|
101 |
public AjaxResult remove(@PathVariable Long[] ids) |
|
102 |
{ |
|
103 |
return toAjax(bsFormulaChildInfoService.deleteBsFormulaChildInfoByIds(ids)); |
|
104 |
} |
|
105 |
} |