admin
2024-07-18 0aaabac24ac4ebc2fe3e54c56e95f250ea238d5b
提交 | 用户 | 时间
0aaaba 1 package com.jcdm.main.bs.formulaChildInfoTemp.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.jcdm.common.annotation.Log;
16 import com.jcdm.common.core.controller.BaseController;
17 import com.jcdm.common.core.domain.AjaxResult;
18 import com.jcdm.common.enums.BusinessType;
19 import com.jcdm.main.bs.formulaChildInfoTemp.domain.BsFormulaChildInfoTemp;
20 import com.jcdm.main.bs.formulaChildInfoTemp.service.IBsFormulaChildInfoTempService;
21 import com.jcdm.common.utils.poi.ExcelUtil;
22 import com.jcdm.common.core.page.TableDataInfo;
23
24 /**
25  * 配方配置子信息-备份Controller
26  * 
27  * @author Yi
28  * @date 2024-07-15
29  */
30 @RestController
31 @RequestMapping("/bs/formulaChildInfoTemp")
32 public class BsFormulaChildInfoTempController extends BaseController
33 {
34     @Autowired
35     private IBsFormulaChildInfoTempService bsFormulaChildInfoTempService;
36
37     /**
38      * 查询配方配置子信息-备份列表
39      */
40     @PreAuthorize("@ss.hasPermi('bs:formulaChildInfoTemp:list')")
41     @GetMapping("/list")
42     public TableDataInfo list(BsFormulaChildInfoTemp bsFormulaChildInfoTemp)
43     {
44         startPage();
45         List<BsFormulaChildInfoTemp> list = bsFormulaChildInfoTempService.selectBsFormulaChildInfoTempList(bsFormulaChildInfoTemp);
46         return getDataTable(list);
47     }
48
49     /**
50      * 导出配方配置子信息-备份列表
51      */
52     @PreAuthorize("@ss.hasPermi('bs:formulaChildInfoTemp:export')")
53     @Log(title = "配方配置子信息-备份", businessType = BusinessType.EXPORT)
54     @PostMapping("/export")
55     public void export(HttpServletResponse response, BsFormulaChildInfoTemp bsFormulaChildInfoTemp)
56     {
57         List<BsFormulaChildInfoTemp> list = bsFormulaChildInfoTempService.selectBsFormulaChildInfoTempList(bsFormulaChildInfoTemp);
58         ExcelUtil<BsFormulaChildInfoTemp> util = new ExcelUtil<BsFormulaChildInfoTemp>(BsFormulaChildInfoTemp.class);
59         util.exportExcel(response, list, "配方配置子信息-备份数据");
60     }
61
62     /**
63      * 获取配方配置子信息-备份详细信息
64      */
65     @PreAuthorize("@ss.hasPermi('bs:formulaChildInfoTemp:query')")
66     @GetMapping(value = "/{id}")
67     public AjaxResult getInfo(@PathVariable("id") Long id)
68     {
69         return success(bsFormulaChildInfoTempService.selectBsFormulaChildInfoTempById(id));
70     }
71
72     /**
73      * 新增配方配置子信息-备份
74      */
75     @PreAuthorize("@ss.hasPermi('bs:formulaChildInfoTemp:add')")
76     @Log(title = "配方配置子信息-备份", businessType = BusinessType.INSERT)
77     @PostMapping
78     public AjaxResult add(@RequestBody BsFormulaChildInfoTemp bsFormulaChildInfoTemp)
79     {
80         return toAjax(bsFormulaChildInfoTempService.insertBsFormulaChildInfoTemp(bsFormulaChildInfoTemp));
81     }
82
83     /**
84      * 修改配方配置子信息-备份
85      */
86     @PreAuthorize("@ss.hasPermi('bs:formulaChildInfoTemp:edit')")
87     @Log(title = "配方配置子信息-备份", businessType = BusinessType.UPDATE)
88     @PutMapping
89     public AjaxResult edit(@RequestBody BsFormulaChildInfoTemp bsFormulaChildInfoTemp)
90     {
91         return toAjax(bsFormulaChildInfoTempService.updateBsFormulaChildInfoTemp(bsFormulaChildInfoTemp));
92     }
93
94     /**
95      * 删除配方配置子信息-备份
96      */
97     @PreAuthorize("@ss.hasPermi('bs:formulaChildInfoTemp:remove')")
98     @Log(title = "配方配置子信息-备份", businessType = BusinessType.DELETE)
99     @DeleteMapping("/{ids}")
100     public AjaxResult remove(@PathVariable Long[] ids)
101     {
102         return toAjax(bsFormulaChildInfoTempService.deleteBsFormulaChildInfoTempByIds(ids));
103     }
104 }