增加agv状态回传
This commit is contained in:
@@ -19,6 +19,7 @@ import org.nl.extInterface.agvKit.service.KitToAcsService;
|
|||||||
import org.nl.extInterface.agvKit.service.enums.MsgTypeEnum;
|
import org.nl.extInterface.agvKit.service.enums.MsgTypeEnum;
|
||||||
import org.nl.extInterface.agvKit.service.enums.TaskPhaseEnum;
|
import org.nl.extInterface.agvKit.service.enums.TaskPhaseEnum;
|
||||||
import org.nl.extInterface.agvKit.service.enums.TaskStateEnum;
|
import org.nl.extInterface.agvKit.service.enums.TaskStateEnum;
|
||||||
|
import org.nl.extInterface.wms.service.AcsToWmsService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -32,6 +33,8 @@ public class KitToAcsServiceImpl implements KitToAcsService {
|
|||||||
private StorageCellService storageCellService;
|
private StorageCellService storageCellService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeviceAppService deviceAppService;
|
private DeviceAppService deviceAppService;
|
||||||
|
@Autowired
|
||||||
|
private AcsToWmsService acsToWmsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject agvCallback(JSONObject requestParam) throws Exception{
|
public JSONObject agvCallback(JSONObject requestParam) throws Exception{
|
||||||
@@ -176,6 +179,22 @@ public class KitToAcsServiceImpl implements KitToAcsService {
|
|||||||
log.info("---kit响应请求---{}", resp);
|
log.info("---kit响应请求---{}", resp);
|
||||||
return resp;
|
return resp;
|
||||||
} else if (MsgTypeEnum.AGV_STATE_RPT.getValue().equals(type)){
|
} else if (MsgTypeEnum.AGV_STATE_RPT.getValue().equals(type)){
|
||||||
|
String deviceCode = StrUtil.blankToDefault(params.getString("deviceCode"), params.getString("agvId"));
|
||||||
|
Integer status = params.getInteger("status");
|
||||||
|
String statusDescription = params.getString("statusDescription");
|
||||||
|
if (StrUtil.isEmpty(deviceCode) || status == null) {
|
||||||
|
resp.put("code", "400");
|
||||||
|
resp.put("message", "AGV状态上报参数异常");
|
||||||
|
log.info("---kit响应请求---{}", resp);
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
boolean success = acsToWmsService.deviceStatusUpdate(deviceCode, status, statusDescription);
|
||||||
|
if (!success) {
|
||||||
|
resp.put("code", "400");
|
||||||
|
resp.put("message", "回馈WMS设备状态失败");
|
||||||
|
log.info("---kit响应请求---{}", resp);
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
resp.put("code", "200");
|
resp.put("code", "200");
|
||||||
resp.put("message", "更新指令执行中成功");
|
resp.put("message", "更新指令执行中成功");
|
||||||
log.info("---kit响应请求---{}", resp);
|
log.info("---kit响应请求---{}", resp);
|
||||||
|
|||||||
Reference in New Issue
Block a user