春风项目四线(合箱线、总装线)
懒羊羊
2024-01-15 f119894e61a56d584c140b40baa6a4420dc8e8d6
提交 | 用户 | 时间
fd2207 1 package com.jcdm.main.rm.repairRecord.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.rm.repairRecord.domain.RmRepairRecord;
20 import com.jcdm.main.rm.repairRecord.service.IRmRepairRecordService;
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 2023-12-22
29  */
30 @RestController
31 @RequestMapping("/rm/repairRecord")
32 public class RmRepairRecordController extends BaseController
33 {
34     @Autowired
35     private IRmRepairRecordService rmRepairRecordService;
36
37     /**
38      * 查询返修记录列表
39      */
40     @PreAuthorize("@ss.hasPermi('rm:repairRecord:list')")
41     @GetMapping("/list")
42     public TableDataInfo list(RmRepairRecord rmRepairRecord)
43     {
44         startPage();
45         List<RmRepairRecord> list = rmRepairRecordService.selectRmRepairRecordList(rmRepairRecord);
46         return getDataTable(list);
47     }
48
49     /**
50      * 导出返修记录列表
51      */
52     @PreAuthorize("@ss.hasPermi('rm:repairRecord:export')")
53     @Log(title = "返修记录", businessType = BusinessType.EXPORT)
54     @PostMapping("/export")
55     public void export(HttpServletResponse response, RmRepairRecord rmRepairRecord)
56     {
57         List<RmRepairRecord> list = rmRepairRecordService.selectRmRepairRecordList(rmRepairRecord);
58         ExcelUtil<RmRepairRecord> util = new ExcelUtil<RmRepairRecord>(RmRepairRecord.class);
59         util.exportExcel(response, list, "返修记录数据");
60     }
61
62     /**
63      * 获取返修记录详细信息
64      */
65     @PreAuthorize("@ss.hasPermi('rm:repairRecord:query')")
66     @GetMapping(value = "/{id}")
67     public AjaxResult getInfo(@PathVariable("id") Long id)
68     {
69         return success(rmRepairRecordService.selectRmRepairRecordById(id));
70     }
71
72     /**
73      * 新增返修记录
74      */
75     @PreAuthorize("@ss.hasPermi('rm:repairRecord:add')")
76     @Log(title = "返修记录", businessType = BusinessType.INSERT)
77     @PostMapping
78     public AjaxResult add(@RequestBody RmRepairRecord rmRepairRecord)
79     {
80         return toAjax(rmRepairRecordService.insertRmRepairRecord(rmRepairRecord));
81     }
82
83     /**
84      * 修改返修记录
85      */
86     @PreAuthorize("@ss.hasPermi('rm:repairRecord:edit')")
87     @Log(title = "返修记录", businessType = BusinessType.UPDATE)
88     @PutMapping
89     public AjaxResult edit(@RequestBody RmRepairRecord rmRepairRecord)
90     {
91         return toAjax(rmRepairRecordService.updateRmRepairRecord(rmRepairRecord));
92     }
93
94     /**
95      * 删除返修记录
96      */
97     @PreAuthorize("@ss.hasPermi('rm:repairRecord:remove')")
98     @Log(title = "返修记录", businessType = BusinessType.DELETE)
99     @DeleteMapping("/{ids}")
100     public AjaxResult remove(@PathVariable Long[] ids)
101     {
102         return toAjax(rmRepairRecordService.deleteRmRepairRecordByIds(ids));
103     }
104 }