春风项目四线(合箱线、总装线)
wujian
2024-01-18 83923ea389a172c1cf3d9cd7a3628d3692e9feaf
提交 | 用户 | 时间
fd2207 1 package com.jcdm.main.bs.formulaChild.controller;
2
3 import com.jcdm.common.annotation.Log;
4 import com.jcdm.common.core.controller.BaseController;
5 import com.jcdm.common.core.domain.AjaxResult;
83923e 6 import com.jcdm.common.core.page.TableDataInfo;
fd2207 7 import com.jcdm.common.enums.BusinessType;
83923e 8 import com.jcdm.common.utils.poi.ExcelUtil;
W 9 import com.jcdm.main.bs.formulaChild.Query.ProductProcessQuery;
fd2207 10 import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo;
11 import com.jcdm.main.bs.formulaChild.service.IBsFormulaChildInfoService;
83923e 12 import com.jcdm.main.bs.formulaChild.service.impl.ProductProcessService;
W 13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.security.access.prepost.PreAuthorize;
15 import org.springframework.web.bind.annotation.*;
16
17 import javax.servlet.http.HttpServletResponse;
18 import java.util.List;
fd2207 19
20 /**
21  * 配方配置子信息Controller
22  * 
23  * @author ruimin
24  * @date 2023-12-26
25  */
26 @RestController
27 @RequestMapping("/bs/formulaChild")
28 public class BsFormulaChildInfoController extends BaseController
29 {
30     @Autowired
31     private IBsFormulaChildInfoService bsFormulaChildInfoService;
83923e 32
W 33     @Autowired
34     private ProductProcessService productProcessService;
fd2207 35
36     /**
37      * 查询配方配置子信息列表
38      */
39     @PreAuthorize("@ss.hasPermi('bs:formulaChild:list')")
40     @GetMapping("/list")
41     public TableDataInfo list(BsFormulaChildInfo bsFormulaChildInfo)
42     {
43         startPage();
44         List<BsFormulaChildInfo> list = bsFormulaChildInfoService.selectBsFormulaChildInfoList(bsFormulaChildInfo);
45         for (BsFormulaChildInfo formulaChildInfo : list) {
46             formulaChildInfo.setSort(formulaChildInfo.getStepSort());
47             formulaChildInfo.setAddress(formulaChildInfo.getTechRequirement());
1558d8 48             formulaChildInfo.setImg(formulaChildInfo.getPicture());
fd2207 49         }
50         return getDataTable(list);
51     }
52
53     /**
83923e 54      * 查询工艺流程
W 55      * @param productProcessQuery query
56      * @return list
57      */
58     @PostMapping("/getProductProcess")
59     public TableDataInfo getProductProcess(@RequestBody ProductProcessQuery productProcessQuery)
60     {
61         List<BsFormulaChildInfo> list = productProcessService.getProductProcess(productProcessQuery);
62         return getDataTable(list);
63     }
64
65     /**
fd2207 66      * 导出配方配置子信息列表
67      */
68     @PreAuthorize("@ss.hasPermi('bs:formulaChild:export')")
69     @Log(title = "配方配置子信息", businessType = BusinessType.EXPORT)
70     @PostMapping("/export")
71     public void export(HttpServletResponse response, BsFormulaChildInfo bsFormulaChildInfo)
72     {
73         List<BsFormulaChildInfo> list = bsFormulaChildInfoService.selectBsFormulaChildInfoList(bsFormulaChildInfo);
74         ExcelUtil<BsFormulaChildInfo> util = new ExcelUtil<BsFormulaChildInfo>(BsFormulaChildInfo.class);
75         util.exportExcel(response, list, "配方配置子信息数据");
76     }
77
78     /**
79      * 获取配方配置子信息详细信息
80      */
81     @PreAuthorize("@ss.hasPermi('bs:formulaChild:query')")
82     @GetMapping(value = "/{id}")
83     public AjaxResult getInfo(@PathVariable("id") Long id)
84     {
85         return success(bsFormulaChildInfoService.selectBsFormulaChildInfoById(id));
86     }
87
88     /**
89      * 新增配方配置子信息
90      */
91     @PreAuthorize("@ss.hasPermi('bs:formulaChild:add')")
92     @Log(title = "配方配置子信息", businessType = BusinessType.INSERT)
93     @PostMapping
94     public AjaxResult add(@RequestBody BsFormulaChildInfo bsFormulaChildInfo)
95     {
96         return toAjax(bsFormulaChildInfoService.insertBsFormulaChildInfo(bsFormulaChildInfo));
97     }
98
99     /**
100      * 修改配方配置子信息
101      */
102     @PreAuthorize("@ss.hasPermi('bs:formulaChild:edit')")
103     @Log(title = "配方配置子信息", businessType = BusinessType.UPDATE)
104     @PutMapping
105     public AjaxResult edit(@RequestBody BsFormulaChildInfo bsFormulaChildInfo)
106     {
107         return toAjax(bsFormulaChildInfoService.updateBsFormulaChildInfo(bsFormulaChildInfo));
108     }
109
110     /**
111      * 删除配方配置子信息
112      */
113     @PreAuthorize("@ss.hasPermi('bs:formulaChild:remove')")
114     @Log(title = "配方配置子信息", businessType = BusinessType.DELETE)
115     @DeleteMapping("/{ids}")
116     public AjaxResult remove(@PathVariable Long[] ids)
117     {
118         return toAjax(bsFormulaChildInfoService.deleteBsFormulaChildInfoByIds(ids));
119     }
120 }