WcsStackingController.java
3.62 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
package com.huaheng.api.wcs.controller;
import javax.annotation.Resource;
import org.apache.tools.ant.types.Quantifier;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import com.huaheng.api.wcs.service.wcsInteract.WcsStackingService;
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.config.location.service.LocationService;
import io.swagger.annotations.ApiOperation;
/**
* wcs码垛接口
* @author xcq
*/
@RestController
@RequestMapping("/API/WMS/v2")
public class WcsStackingController extends BaseController {
@Resource
private WcsStackingService wcsStackingService;
@Resource
private LocationService locationService;
@PostMapping("/cartonsWhetherRelease")
@ApiOperation(value = "是否放行", notes = "是否放行", httpMethod = "POST")
@ResponseBody
@ApiLogger(apiName = "是否放行", from = "WCS")
public AjaxResult cartonsWhetherRelease(@RequestBody String barcode) {
return wcsStackingService.cartonsWhetherRelease(barcode);
}
@PostMapping("/stackingDestination")
@ApiOperation(value = "码垛去向", notes = "码垛去向", httpMethod = "POST")
@ResponseBody
@ApiLogger(apiName = "码垛去向", from = "WCS")
public AjaxResult stackingDestination(@RequestBody String json) {
if (StringUtils.isEmpty(json)) {
return AjaxResult.error("请勿提交空数据!");
}
JSONObject object = JSONObject.parseObject(json);
String barcode = object.getString("barcode");
return handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
return wcsStackingService.manipulatorStackingPort(barcode);
}
});
}
@PostMapping("/manipulatorStackingResult")
@ApiOperation(value = "机械手码垛结果", notes = "机械手码垛结果", httpMethod = "POST")
@ResponseBody
@ApiLogger(apiName = "机械手码垛结果", from = "WCS")
public AjaxResult manipulatorStackingResult(@RequestBody String json) {
return handleMultiProcess(new MultiProcessListener() {
@Override
public AjaxResult doProcess() {
return wcsStackingService.manipulatorStackingResult(json);
}
});
}
@PostMapping("/getLastBox")
@ApiOperation(value = "是否为最后一箱", notes = "是否为最后一箱", httpMethod = "POST")
@ResponseBody
@ApiLogger(apiName = "是否为最后一箱", from = "WCS")
public AjaxResult getLastBox(@RequestBody String json) {
if (StringUtils.isEmpty(json)) {
return AjaxResult.error("请勿提交空数据!");
}
JSONObject object = JSONObject.parseObject(json);
String barcode = object.getString("barcode");
return wcsStackingService.getLastBoxServer(barcode);
}
/**
* wcs获取库区状态
*/
@PostMapping("/getAreaStatus")
@ApiOperation(value = "获取库区状态", notes = "获取库区状态", httpMethod = "POST")
@ResponseBody
@ApiLogger(apiName = "获取库区状态", from = "WCS")
public AjaxResult getAreaStatus(@RequestBody String json) {
if (StringUtils.isEmpty(json)) {
return AjaxResult.error("请勿提交空数据!");
}
JSONObject object = JSONObject.parseObject(json);
String area = object.getString("area");
return locationService.getAreaStatus(area);
}
}