|
|
@ -46,26 +46,38 @@ public class AgvToAcsServiceImpl implements AgvToAcsService { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("status", 200); |
|
|
|
map.put("message", "操作成功"); |
|
|
|
//取货点等待
|
|
|
|
if (address.contains("INGET")) { |
|
|
|
//告诉设备请求取货
|
|
|
|
maGangConveyorDeviceDriver.writing(4); |
|
|
|
//判断是否满足取货条件
|
|
|
|
if (maGangConveyorDeviceDriver.getMove() == 1 && maGangConveyorDeviceDriver.getAction() == 1) { |
|
|
|
//满足响应成功
|
|
|
|
logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); |
|
|
|
return map; |
|
|
|
} else { |
|
|
|
//不满足抛异常
|
|
|
|
logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求失败-原因:取货前-取货点无货!"); |
|
|
|
throw new BadRequestException("请求失败,取货前-取货点无货!"); |
|
|
|
} |
|
|
|
} else if (address.contains("OUTGET")) { |
|
|
|
}//取货完成等待
|
|
|
|
else if (address.contains("OUTGET")) { |
|
|
|
//取货完成以后判断取货点是否有货
|
|
|
|
if (maGangConveyorDeviceDriver.getMove() == 0) { |
|
|
|
//无货告诉设备取货完成
|
|
|
|
maGangConveyorDeviceDriver.writing(2); |
|
|
|
logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); |
|
|
|
return map; |
|
|
|
} else { |
|
|
|
//有货抛异常
|
|
|
|
logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求失败-原因:取货完成后-取货点有货!"); |
|
|
|
throw new BadRequestException("请求失败,取货完成后-取货点有货!"); |
|
|
|
} |
|
|
|
} else if (address.contains("INPUT")) { |
|
|
|
}//放货前等待
|
|
|
|
else if (address.contains("INPUT")) { |
|
|
|
//告诉设备请求放货
|
|
|
|
maGangConveyorDeviceDriver.writing(5); |
|
|
|
//判断是否满足放货信号
|
|
|
|
if (maGangConveyorDeviceDriver.getMove() == 0 && maGangConveyorDeviceDriver.getAction() == 2) { |
|
|
|
logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); |
|
|
|
return map; |
|
|
@ -73,7 +85,9 @@ public class AgvToAcsServiceImpl implements AgvToAcsService { |
|
|
|
logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求失败-原因:放货前-放货点有货!"); |
|
|
|
throw new BadRequestException("请求失败,放货前-放货点有货!"); |
|
|
|
} |
|
|
|
} else if (address.contains("OUTPUT")) { |
|
|
|
}//放货完成等待
|
|
|
|
else if (address.contains("OUTPUT")) { |
|
|
|
//放货完成后判断放货点是否有货
|
|
|
|
if (maGangConveyorDeviceDriver.getMove() == 1) { |
|
|
|
maGangConveyorDeviceDriver.writing(3); |
|
|
|
logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); |
|
|
|