提交 | 用户 | 时间
|
9f7aa7
|
1 |
package com.billion.main.om.controller; |
吴 |
2 |
|
|
3 |
import com.billion.common.annotation.Log; |
|
4 |
import com.billion.common.core.controller.BaseController; |
|
5 |
import com.billion.common.core.domain.AjaxResult; |
|
6 |
import com.billion.common.core.domain.R; |
|
7 |
import com.billion.common.core.page.TableDataInfo; |
|
8 |
import com.billion.common.enums.BusinessType; |
|
9 |
import com.billion.common.utils.poi.ExcelUtil; |
|
10 |
import com.billion.main.om.domain.OmProductionOrderInfo; |
|
11 |
import com.billion.main.om.service.IOmProductionOrderInfoService; |
|
12 |
import org.springframework.beans.factory.annotation.Autowired; |
|
13 |
import org.springframework.security.access.prepost.PreAuthorize; |
|
14 |
import org.springframework.web.bind.annotation.*; |
|
15 |
|
|
16 |
import javax.servlet.http.HttpServletResponse; |
|
17 |
import java.util.List; |
|
18 |
import java.util.stream.Collectors; |
|
19 |
|
|
20 |
/** |
|
21 |
* 生产工单Controller |
|
22 |
* |
|
23 |
* @author Billion |
|
24 |
* @date 2024-11-20 |
|
25 |
*/ |
|
26 |
@RestController |
|
27 |
@RequestMapping("/main/info") |
|
28 |
public class OmProductionOrderInfoController extends BaseController |
|
29 |
{ |
|
30 |
@Autowired |
|
31 |
private IOmProductionOrderInfoService OmProductionOrderInfoService; |
|
32 |
|
|
33 |
/** |
|
34 |
* 查询生产工单列表 |
|
35 |
*/ |
|
36 |
@PreAuthorize("@ss.hasPermi('main:info:list')") |
|
37 |
@GetMapping("/list") |
|
38 |
public TableDataInfo list(OmProductionOrderInfo OmProductionOrderInfo) |
|
39 |
{ |
|
40 |
startPage(); |
|
41 |
List<OmProductionOrderInfo> list = OmProductionOrderInfoService.selectOmProductionOrderInfoList(OmProductionOrderInfo); |
|
42 |
return getDataTable(list); |
|
43 |
} |
|
44 |
|
|
45 |
@GetMapping("/getOrderList") |
|
46 |
public R getOrderList(){ |
|
47 |
List<String> collect = OmProductionOrderInfoService.list().stream().map(OmProductionOrderInfo::getWorkOrderNo).collect(Collectors.toList()); |
|
48 |
return R.ok(collect); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* 导出生产工单列表 |
|
53 |
*/ |
|
54 |
@PreAuthorize("@ss.hasPermi('main:info:export')") |
|
55 |
@Log(title = "生产工单", businessType = BusinessType.EXPORT) |
|
56 |
@PostMapping("/export") |
|
57 |
public void export(HttpServletResponse response, OmProductionOrderInfo OmProductionOrderInfo) |
|
58 |
{ |
|
59 |
List<OmProductionOrderInfo> list = OmProductionOrderInfoService.selectOmProductionOrderInfoList(OmProductionOrderInfo); |
|
60 |
ExcelUtil<OmProductionOrderInfo> util = new ExcelUtil<OmProductionOrderInfo>(OmProductionOrderInfo.class); |
|
61 |
util.exportExcel(response, list, "生产工单数据"); |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* 获取生产工单详细信息 |
|
66 |
*/ |
|
67 |
@PreAuthorize("@ss.hasPermi('main:info:query')") |
|
68 |
@GetMapping(value = "/{id}") |
|
69 |
public AjaxResult getInfo(@PathVariable("id") Long id) |
|
70 |
{ |
|
71 |
return success(OmProductionOrderInfoService.selectOmProductionOrderInfoById(id)); |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* 新增生产工单 |
|
76 |
*/ |
|
77 |
@PreAuthorize("@ss.hasPermi('main:info:add')") |
|
78 |
@Log(title = "生产工单", businessType = BusinessType.INSERT) |
|
79 |
@PostMapping |
|
80 |
public void add(@RequestBody OmProductionOrderInfo OmProductionOrderInfo) |
|
81 |
{ |
|
82 |
OmProductionOrderInfoService.insertOmProductionOrderInfo(OmProductionOrderInfo); |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* 修改生产工单 |
|
87 |
*/ |
|
88 |
@PreAuthorize("@ss.hasPermi('main:info:edit')") |
|
89 |
@Log(title = "生产工单", businessType = BusinessType.UPDATE) |
|
90 |
@PutMapping |
|
91 |
public AjaxResult edit(@RequestBody OmProductionOrderInfo OmProductionOrderInfo) |
|
92 |
{ |
|
93 |
return toAjax(OmProductionOrderInfoService.updateOmProductionOrderInfo(OmProductionOrderInfo)); |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* 删除生产工单 |
|
98 |
*/ |
|
99 |
@PreAuthorize("@ss.hasPermi('main:info:remove')") |
|
100 |
@Log(title = "生产工单", businessType = BusinessType.DELETE) |
|
101 |
@DeleteMapping("/{ids}") |
|
102 |
public AjaxResult remove(@PathVariable Long[] ids) |
|
103 |
{ |
|
104 |
return toAjax(OmProductionOrderInfoService.deleteOmProductionOrderInfoByIds(ids)); |
|
105 |
} |
|
106 |
} |