ReceivingHandleController.java
4.95 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
package com.huaheng.api.wcs.controller;
import com.huaheng.api.wcs.service.receivingHandle.ReceivingHandleService;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerView;
import com.huaheng.pc.task.agvTask.domain.AgvTask;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/API/WMS/v2")
public class ReceivingHandleController extends BaseController {
@Resource
private ReceivingHandleService receivingHandleService;
@PostMapping("/saveWholeContainer")
@ApiOperation("WCS组盘")
@ApiLogger(apiName = "WCS组盘", from = "WCS")
@ResponseBody
public AjaxResult saveWholeContainer(@RequestBody ReceiptContainerView view) {
String area = view.getArea();
String rollNumber = view.getRollNumber();
String containerCode = view.getContainerCode();
Integer containerDetailNumber = view.getPosition();
String port = view.getPort();
if (StringUtils.isEmpty(area)) {
return AjaxResult.error("库区编号为空");
}
if (StringUtils.isEmpty(rollNumber)) {
return AjaxResult.error("卷号为空");
}
if (StringUtils.isEmpty(containerCode)) {
return AjaxResult.error("容器号为空");
}
if (StringUtils.isNull(containerDetailNumber)) {
return AjaxResult.error("位置号为空");
}
if (StringUtils.isEmpty(port)) {
return AjaxResult.error("站台为空");
}
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
return receivingHandleService.saveWholeContainer(view);
}
});
return ajaxResult;
}
@PostMapping("/continueSaveContainer")
@ApiOperation("是否继续组盘")
@ApiLogger(apiName = "是否继续组盘", from = "WCS")
@ResponseBody
public AjaxResult continueSaveContainer(@RequestBody ReceiptContainerView view) {
String area = view.getArea();
String rollNumber = view.getRollNumber();
String containerCode = view.getContainerCode();
Integer containerDetailNumber = view.getPosition();
String port = view.getPort();
if (StringUtils.isEmpty(area)) {
return AjaxResult.error("库区编号为空");
}
if (StringUtils.isEmpty(rollNumber)) {
return AjaxResult.error("卷号为空");
}
if (StringUtils.isEmpty(containerCode)) {
return AjaxResult.error("容器号为空");
}
if (StringUtils.isNull(containerDetailNumber)) {
return AjaxResult.error("位置号为空");
}
if (StringUtils.isEmpty(port)) {
return AjaxResult.error("站台为空");
}
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
return receivingHandleService.saveWholeContainer(view);
}
});
return ajaxResult;
}
@PostMapping("/acsSaveWholeContainer")
@ApiOperation("AGV组盘")
@ApiLogger(apiName = "AGV组盘", from = "acs")
@ResponseBody
public AjaxResult acsSaveWholeContainer(@RequestBody AgvTask agvTask) {
String area = agvTask.getArea();
List<String> rollNumbers = agvTask.getRollNumbers();
String containerCode = agvTask.getPalletNo();
List<Integer> positions = agvTask.getPositions();
String port = agvTask.getToPoint();
if (StringUtils.isEmpty(area)) {
return AjaxResult.error("库区编号为空");
}
if (rollNumbers.isEmpty()) {
return AjaxResult.error("卷号为空");
}
if (StringUtils.isEmpty(containerCode)) {
return AjaxResult.error("容器号为空");
}
if (StringUtils.isEmpty(port)) {
return AjaxResult.error("站台为空");
}
if(positions.size() != rollNumbers.size()){
return AjaxResult.error("批次 数量与位置 数量不一致");
}
AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
ReceiptContainerView view = new ReceiptContainerView();
view.setArea(area);
view.setRollNumbers(rollNumbers);
view.setPositions(positions);
view.setPort(port);
view.setContainerCode(containerCode);
return receivingHandleService.acsSaveWholeContainer(view);
}
});
return ajaxResult;
}
}