admin
2024-04-24 363457b34e0e4f26ffe51aa80ecb227bf7873308
提交 | 用户 | 时间
363457 1 package com.jcdm.main.om.productionOrde.controller;
A 2
3 import java.util.List;
4 import javax.servlet.http.HttpServletResponse;
5 import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
6 import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService;
7 import org.springframework.security.access.prepost.PreAuthorize;
8 import org.springframework.beans.factory.annotation.Autowired;
9 import org.springframework.web.bind.annotation.GetMapping;
10 import org.springframework.web.bind.annotation.PostMapping;
11 import org.springframework.web.bind.annotation.PutMapping;
12 import org.springframework.web.bind.annotation.DeleteMapping;
13 import org.springframework.web.bind.annotation.PathVariable;
14 import org.springframework.web.bind.annotation.RequestBody;
15 import org.springframework.web.bind.annotation.RequestMapping;
16 import org.springframework.web.bind.annotation.RestController;
17 import com.jcdm.common.annotation.Log;
18 import com.jcdm.common.core.controller.BaseController;
19 import com.jcdm.common.core.domain.AjaxResult;
20 import com.jcdm.common.enums.BusinessType;
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-11
29  */
30 @RestController
31 @RequestMapping("/om/productionOrde")
32 public class OmProductionOrdeInfoController extends BaseController
33 {
34     @Autowired
35     private IOmProductionOrdeInfoService omProductionOrdeInfoService;
36
37     /**
38      * 查询生产工单列表
39      */
40     @PreAuthorize("@ss.hasPermi('om:productionOrde:list')")
41     @GetMapping("/list")
42     public TableDataInfo list(OmProductionOrdeInfo omProductionOrdeInfo)
43     {
44         startPage();
45         List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.selectOmProductionOrdeInfoList(omProductionOrdeInfo);
46         return getDataTable(list);
47     }
48
49     /**
50      * 导出生产工单列表
51      */
52     @PreAuthorize("@ss.hasPermi('om:productionOrde:export')")
53     @Log(title = "生产工单", businessType = BusinessType.EXPORT)
54     @PostMapping("/export")
55     public void export(HttpServletResponse response, OmProductionOrdeInfo omProductionOrdeInfo)
56     {
57         List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.selectOmProductionOrdeInfoList(omProductionOrdeInfo);
58         ExcelUtil<OmProductionOrdeInfo> util = new ExcelUtil<OmProductionOrdeInfo>(OmProductionOrdeInfo.class);
59         util.exportExcel(response, list, "生产工单数据");
60     }
61
62     /**
63      * 获取生产工单详细信息
64      */
65     @PreAuthorize("@ss.hasPermi('om:productionOrde:query')")
66     @GetMapping(value = "/{id}")
67     public AjaxResult getInfo(@PathVariable("id") Long id)
68     {
69         return success(omProductionOrdeInfoService.selectOmProductionOrdeInfoById(id));
70     }
71
72     /**
73      * 新增生产工单
74      */
75     @PreAuthorize("@ss.hasPermi('om:productionOrde:add')")
76     @Log(title = "生产工单", businessType = BusinessType.INSERT)
77     @PostMapping
78     public AjaxResult add(@RequestBody OmProductionOrdeInfo omProductionOrdeInfo)
79     {
80         return toAjax(omProductionOrdeInfoService.insertOmProductionOrdeInfo(omProductionOrdeInfo));
81     }
82
83     /**
84      * 修改生产工单
85      */
86     @PreAuthorize("@ss.hasPermi('om:productionOrde:edit')")
87     @Log(title = "生产工单", businessType = BusinessType.UPDATE)
88     @PutMapping
89     public AjaxResult edit(@RequestBody OmProductionOrdeInfo omProductionOrdeInfo)
90     {
91         return toAjax(omProductionOrdeInfoService.updateOmProductionOrdeInfo(omProductionOrdeInfo));
92     }
93
94     /**
95      * 删除生产工单
96      */
97     @PreAuthorize("@ss.hasPermi('om:productionOrde:remove')")
98     @Log(title = "生产工单", businessType = BusinessType.DELETE)
99     @DeleteMapping("/{ids}")
100     public AjaxResult remove(@PathVariable Long[] ids)
101     {
102         return toAjax(omProductionOrdeInfoService.deleteOmProductionOrdeInfoByIds(ids));
103     }
104
105     /**
106      * table列上移下移
107      */
108     @Log(title = "生产工单", businessType = BusinessType.DELETE)
109     @GetMapping("/upDownMove")
110     public AjaxResult upDownMove(OmProductionOrdeInfo omProductionOrdeInfo)
111     {
112         return omProductionOrdeInfoService.upDownMove(omProductionOrdeInfo);
113     }
114 }