春风项目四线(合箱线、总装线)
懒羊羊
2024-01-24 5fc5876a94dcbd5e9a9fb91f5e3c01211e9c2d96
提交 | 用户 | 时间
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     /**
5fc587 50      * 不分页查询返修记录列表
51      */
52     @GetMapping("/noPagelist")
53     public TableDataInfo noPagelist(RmRepairRecord rmRepairRecord)
54     {
55         List<RmRepairRecord> list = rmRepairRecordService.selectRmRepairRecordList(rmRepairRecord);
56         return getDataTable(list);
57     }
58
59     /**
fd2207 60      * 导出返修记录列表
61      */
62     @PreAuthorize("@ss.hasPermi('rm:repairRecord:export')")
63     @Log(title = "返修记录", businessType = BusinessType.EXPORT)
64     @PostMapping("/export")
65     public void export(HttpServletResponse response, RmRepairRecord rmRepairRecord)
66     {
67         List<RmRepairRecord> list = rmRepairRecordService.selectRmRepairRecordList(rmRepairRecord);
68         ExcelUtil<RmRepairRecord> util = new ExcelUtil<RmRepairRecord>(RmRepairRecord.class);
69         util.exportExcel(response, list, "返修记录数据");
70     }
71
72     /**
73      * 获取返修记录详细信息
74      */
75     @PreAuthorize("@ss.hasPermi('rm:repairRecord:query')")
76     @GetMapping(value = "/{id}")
77     public AjaxResult getInfo(@PathVariable("id") Long id)
78     {
79         return success(rmRepairRecordService.selectRmRepairRecordById(id));
80     }
81
82     /**
83      * 新增返修记录
84      */
85     @PreAuthorize("@ss.hasPermi('rm:repairRecord:add')")
86     @Log(title = "返修记录", businessType = BusinessType.INSERT)
87     @PostMapping
88     public AjaxResult add(@RequestBody RmRepairRecord rmRepairRecord)
89     {
90         return toAjax(rmRepairRecordService.insertRmRepairRecord(rmRepairRecord));
91     }
92
93     /**
94      * 修改返修记录
95      */
96     @PreAuthorize("@ss.hasPermi('rm:repairRecord:edit')")
97     @Log(title = "返修记录", businessType = BusinessType.UPDATE)
98     @PutMapping
99     public AjaxResult edit(@RequestBody RmRepairRecord rmRepairRecord)
100     {
101         return toAjax(rmRepairRecordService.updateRmRepairRecord(rmRepairRecord));
102     }
103
104     /**
105      * 删除返修记录
106      */
107     @PreAuthorize("@ss.hasPermi('rm:repairRecord:remove')")
108     @Log(title = "返修记录", businessType = BusinessType.DELETE)
109     @DeleteMapping("/{ids}")
110     public AjaxResult remove(@PathVariable Long[] ids)
111     {
112         return toAjax(rmRepairRecordService.deleteRmRepairRecordByIds(ids));
113     }
114 }