package com.zy.asrs.wms.apis.wcs.controller;
|
|
|
import com.zy.asrs.framework.common.R;
|
import com.zy.asrs.wms.apis.wcs.entity.request.ContainerArrivedParam;
|
import com.zy.asrs.wms.apis.wcs.entity.request.TasksStatusCallbackParam;
|
import com.zy.asrs.wms.apis.wcs.services.WcsApiService;
|
import io.netty.util.internal.StringUtil;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@Slf4j
|
@RestController
|
@RequestMapping("/out/stock/")
|
public class OutStockController {
|
|
@Autowired
|
private WcsApiService wcsApiService;
|
|
/**
|
* 出库任务-接收回调状态接口
|
* @param callbackParam
|
* @return
|
*/
|
@PostMapping("/receive/tasks/status")
|
public R receiveTaskStatus(@RequestBody TasksStatusCallbackParam callbackParam) {
|
if (!StringUtil.isNullOrEmpty(callbackParam.getEventType())) {
|
if (StringUtil.isNullOrEmpty(callbackParam.getContainerCode())) {
|
return R.error("容器编码不能为空!!");
|
}
|
if (StringUtil.isNullOrEmpty(callbackParam.getTaskCode())) {
|
return R.error("任务编码不能为空!!");
|
}
|
wcsApiService.receiveTaskStatus(callbackParam, "outStock");
|
} else {
|
return R.error("上报事件类型不能为空!!");
|
}
|
|
return R.success();
|
}
|
|
/***
|
* 容器到达接收
|
* @param arrivedParam
|
* @return
|
*/
|
@PostMapping("/container/arrived")
|
public R containerArrivedNotify(@RequestBody ContainerArrivedParam arrivedParam) {
|
|
if (StringUtil.isNullOrEmpty(arrivedParam.getContainerCode())) {
|
return R.error("容器编码不能为空!!");
|
}
|
if (StringUtil.isNullOrEmpty(arrivedParam.getSlotCode())) {
|
return R.error("输送线节点编码不能为空!!");
|
}
|
|
return wcsApiService.containerArrivedNotify(arrivedParam, "outStock");
|
|
}
|
|
|
}
|