春风项目四线(合箱线、总装线)
wujian
2024-04-28 9bc5106810d7c0e6f27e904b584c9bbfb3725a19
提交 | 用户 | 时间
fd2207 1 package com.jcdm.main.rm.repairData.controller;
2
3 import java.util.List;
4 import javax.servlet.http.HttpServletResponse;
8aafc5 5
fd2207 6 import org.springframework.security.access.prepost.PreAuthorize;
7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.web.bind.annotation.GetMapping;
9 import org.springframework.web.bind.annotation.PostMapping;
10 import org.springframework.web.bind.annotation.PutMapping;
11 import org.springframework.web.bind.annotation.DeleteMapping;
12 import org.springframework.web.bind.annotation.PathVariable;
13 import org.springframework.web.bind.annotation.RequestBody;
14 import org.springframework.web.bind.annotation.RequestMapping;
15 import org.springframework.web.bind.annotation.RestController;
16 import com.jcdm.common.annotation.Log;
17 import com.jcdm.common.core.controller.BaseController;
18 import com.jcdm.common.core.domain.AjaxResult;
19 import com.jcdm.common.enums.BusinessType;
20 import com.jcdm.main.rm.repairData.domain.RmRepairData;
21 import com.jcdm.main.rm.repairData.service.IRmRepairDataService;
22 import com.jcdm.common.utils.poi.ExcelUtil;
23 import com.jcdm.common.core.page.TableDataInfo;
24
25 /**
26  * 返修数据Controller
27  * 
28  * @author Yi
29  * @date 2023-12-22
30  */
31 @RestController
32 @RequestMapping("/rm/repairData")
33 public class RmRepairDataController extends BaseController
34 {
35     @Autowired
36     private IRmRepairDataService rmRepairDataService;
37
38     /**
39      * 查询返修数据列表
40      */
41     @PreAuthorize("@ss.hasPermi('rm:repairData:list')")
42     @GetMapping("/list")
43     public TableDataInfo list(RmRepairData rmRepairData)
44     {
45         startPage();
46         List<RmRepairData> list = rmRepairDataService.selectRmRepairDataList(rmRepairData);
47         return getDataTable(list);
48     }
49
50     /**
51      * 导出返修数据列表
52      */
53     @PreAuthorize("@ss.hasPermi('rm:repairData:export')")
54     @Log(title = "返修数据", businessType = BusinessType.EXPORT)
55     @PostMapping("/export")
56     public void export(HttpServletResponse response, RmRepairData rmRepairData)
57     {
58         List<RmRepairData> list = rmRepairDataService.selectRmRepairDataList(rmRepairData);
59         ExcelUtil<RmRepairData> util = new ExcelUtil<RmRepairData>(RmRepairData.class);
60         util.exportExcel(response, list, "返修数据数据");
61     }
62
63     /**
64      * 获取返修数据详细信息
65      */
66     @PreAuthorize("@ss.hasPermi('rm:repairData:query')")
67     @GetMapping(value = "/{id}")
68     public AjaxResult getInfo(@PathVariable("id") Long id)
69     {
70         return success(rmRepairDataService.selectRmRepairDataById(id));
71     }
72
73     /**
74      * 新增返修数据
75      */
76     @PreAuthorize("@ss.hasPermi('rm:repairData:add')")
77     @Log(title = "返修数据", businessType = BusinessType.INSERT)
78     @PostMapping
79     public AjaxResult add(@RequestBody RmRepairData rmRepairData)
80     {
81         return toAjax(rmRepairDataService.insertRmRepairData(rmRepairData));
82     }
83
84     /**
85      * 修改返修数据
86      */
87     @PreAuthorize("@ss.hasPermi('rm:repairData:edit')")
88     @Log(title = "返修数据", businessType = BusinessType.UPDATE)
89     @PutMapping
90     public AjaxResult edit(@RequestBody RmRepairData rmRepairData)
91     {
92         return toAjax(rmRepairDataService.updateRmRepairData(rmRepairData));
93     }
94
95     /**
96      * 删除返修数据
97      */
98     @PreAuthorize("@ss.hasPermi('rm:repairData:remove')")
99     @Log(title = "返修数据", businessType = BusinessType.DELETE)
100     @DeleteMapping("/{ids}")
101     public AjaxResult remove(@PathVariable Long[] ids)
102     {
103         return toAjax(rmRepairDataService.deleteRmRepairDataByIds(ids));
104     }
105 }