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