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