MesController.java
4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
package com.huaheng.api.mes.controller;
import com.huaheng.api.mes.service.MesService;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Map;
@RestController
@RequestMapping("/API/WMS/v2")
public class MesController extends BaseController {
@Resource
private MesService mesService;
/**
* 查询库存
*/
@PostMapping("/searchInventory")
@ApiOperation("查询库存")
@ResponseBody
@ApiLogger(apiName = "查询库存", from="MES")
public AjaxResult searchInventory (@RequestBody Map<String, String> map) {
String area = map.get("area");
String materialCode = map.get("materialCode");
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
AjaxResult ajaxResult = mesService.searchInventory(materialCode,area);
return ajaxResult;
}
});
return ajaxResult;
}
/**
* 回传查询
*/
@PostMapping("/returnQuery")
//@ApiOperation("回传查询")
@ResponseBody
//@ApiLogger(apiName = "回传查询", from="ERP")
public AjaxResult returnQuery (@RequestBody Map<String, String> map) {
String referCode = map.get("referCode");
String referType = map.get("referType");
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
AjaxResult ajaxResult = mesService.returnQuery(referCode,referType);
return ajaxResult;
}
});
return ajaxResult;
}
/**
* 查询库位
*/
@PostMapping("/searchLocations")
@ApiOperation("查询库位")
@ResponseBody
@ApiLogger(apiName = "查询库位", from="MES")
public AjaxResult searchLocations (@RequestBody Map<String, String> map) {
String area = map.get("area");
String locationCode = map.get("locationCode");
// if(area == null || "".equals(area)){
// return AjaxResult.error("查询库位 库区不能为空");
// }
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
AjaxResult ajaxResult = mesService.searchLocations(area,locationCode);
return ajaxResult;
}
});
return ajaxResult;
}
/**
* 查询仓库
*/
@PostMapping("/searchWarehouse")
@ApiOperation("查询仓库")
@ResponseBody
@ApiLogger(apiName = "查询仓库", from="MES")
public AjaxResult searchWarehouse () {
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
AjaxResult ajaxResult = mesService.searchWarehouse();
return ajaxResult;
}
});
return ajaxResult;
}
/**
* 查询容器
*/
@PostMapping("/searchContainer")
@ApiOperation("查询容器")
@ResponseBody
@ApiLogger(apiName = "查询容器", from="MES")
public AjaxResult searchContainer () {
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
AjaxResult ajaxResult = mesService.searchContainer();
return ajaxResult;
}
});
return ajaxResult;
}
/**
* 查询容器
*/
@PostMapping("/searchMaterialWarning")
@ApiOperation("查询物料预警")
@ResponseBody
@ApiLogger(apiName = "查询物料预警", from="MES")
public AjaxResult searchMaterialWarning () {
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
AjaxResult ajaxResult = mesService.searchMaterialWarning();
return ajaxResult;
}
});
return ajaxResult;
}
/**
* 查询容器
*/
@PostMapping("/searchZone")
@ApiOperation("查询库区")
@ResponseBody
@ApiLogger(apiName = "查询库区", from="MES")
public AjaxResult searchZone () {
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
AjaxResult ajaxResult = mesService.searchZone();
return ajaxResult;
}
});
return ajaxResult;
}
}