feat: 库卡交互

This commit is contained in:
2026-11-27 17:49:42 +08:00
parent b047abd21a
commit 5c9c394a55
3 changed files with 22 additions and 23 deletions

View File

@@ -332,12 +332,7 @@ public class InflatableShaftManipulatorDeviceDriver extends AbstractOpcDeviceDri
log.error("二次分配请求失败,LMS返回为空!");
return;
}
JSONObject dataJSONObject = data.getJSONObject("data");
if (ObjectUtil.isEmpty(dataJSONObject)) {
log.error("二次分配请求失败,LMS返回为空!");
return;
}
newPoint = dataJSONObject.getString("data");
newPoint = data.getString("data");
if (ObjectUtil.isEmpty(newPoint)) {
log.error("二次分配请求失败,LMS返回点位为空!");
return;

View File

@@ -120,10 +120,10 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i
// 取货完成
public String requestRelease(int command) {
Boolean isUsed = (Boolean) this.getDevice().getExtraValue().getOrDefault("is_used", true);
String isUsed = (String) this.getDevice().getExtraValue().get("is_used");
Map<String, Object> extraValue = this.getDevice().getExtraValue();
Object object = extraValue.getOrDefault("link_device_code", null);
if (!isUsed && ObjectUtil.isNotEmpty(object)) {
if ((ObjectUtil.isEmpty(isUsed) || isUsed.equals("false")) && ObjectUtil.isNotEmpty(object)) {
// 如果is_used设置false,并且配置了备份站点,就用备份站点请求
String linkDeviceCode = (String) object;
Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
@@ -144,10 +144,10 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i
// 放货完成
public void finishRelease(int command) {
Boolean isUsed = (Boolean) this.getDevice().getExtraValue().getOrDefault("is_used", true);
String isUsed = (String) this.getDevice().getExtraValue().get("is_used");
Map<String, Object> extraValue = this.getDevice().getExtraValue();
Object object = extraValue.getOrDefault("link_device_code", null);
if (!isUsed && ObjectUtil.isNotEmpty(object)) {
if ((ObjectUtil.isEmpty(isUsed) || isUsed.equals("false")) && ObjectUtil.isNotEmpty(object)) {
// 如果is_used设置false,并且配置了备份站点,就用备份站点请求
String linkDeviceCode = (String) object;
Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);

View File

@@ -78,7 +78,7 @@ public class KukaToAcsServiceImpl implements KukaToAcsService {
instruction.setInstruction_status(InstructionStatusEnum.BUSY.getIndex());
instructionService.update(instruction);
} else if (COMPLETED.equals(missionStatus)) {
Device putPoint = deviceAppService.findDeviceByCode(instruction.getStart_point_code());
Device putPoint = deviceAppService.findDeviceByCode(instruction.getNext_point_code());
if (putPoint.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
ManipulatorAgvStationDeviceDriver driver =
(ManipulatorAgvStationDeviceDriver) putPoint.getDeviceDriver();
@@ -164,8 +164,8 @@ public class KukaToAcsServiceImpl implements KukaToAcsService {
BoxAgvWaitStationDeviceDriver driver =
(BoxAgvWaitStationDeviceDriver) device.getDeviceDriver();
Boolean isUsed = (Boolean) driver.getDevice().getExtraValue().get("is_used");
if (!isUsed) {
String isUsed = (String) driver.getDevice().getExtraValue().get("is_used");
if (isUsed.equals("true")) {
driver.writing(ItemProtocol.TO_COMMAND.getKey(), 1);
if (driver.getAction() != 1) {
data.setResult("0");
@@ -231,8 +231,8 @@ public class KukaToAcsServiceImpl implements KukaToAcsService {
BoxAgvWaitStationDeviceDriver driver =
(BoxAgvWaitStationDeviceDriver) device.getDeviceDriver();
Boolean isUsed = (Boolean) driver.getDevice().getExtraValue().get("is_used");
if (!isUsed) {
String isUsed = (String) driver.getDevice().getExtraValue().get("is_used");
if ("true".equals(isUsed)) {
driver.writing(ItemProtocol.TO_COMMAND.getKey(), 2);
response.setCode("0");
} else {
@@ -263,14 +263,18 @@ public class KukaToAcsServiceImpl implements KukaToAcsService {
Instruction instruction = instructionService.findByCodeFromCache(request.getTaskId());
TaskDto taskDto = taskService.findByCodeFromCache(instruction.getTask_code());
FeedbackStatusRequest feedbackRequest = new FeedbackStatusRequest();
feedbackRequest.setCarNo(request.getRobotId());
feedbackRequest.setDeviceCode(request.getPositionId());
feedbackRequest.setEventId(IdUtil.simpleUUID());
feedbackRequest.setTaskId(Long.parseLong(taskDto.getExt_task_id()));
feedbackRequest.setTaskCode(taskDto.getTask_code());
feedbackRequest.setStatus(BusinessOperationTypeEnum.PICKED.getCode());
wmsApi.feedbackBusinessStatusAsync(feedbackRequest);
if (ObjectUtil.isNotEmpty(taskDto.getExt_task_id())) {
FeedbackStatusRequest feedbackRequest = new FeedbackStatusRequest();
feedbackRequest.setCarNo(request.getRobotId());
feedbackRequest.setDeviceCode(request.getPositionId());
feedbackRequest.setEventId(IdUtil.simpleUUID());
feedbackRequest.setTaskId(Long.parseLong(taskDto.getExt_task_id()));
feedbackRequest.setTaskCode(taskDto.getTask_code());
feedbackRequest.setStatus(BusinessOperationTypeEnum.PICKED.getCode());
wmsApi.feedbackBusinessStatusAsync(feedbackRequest);
}
return response;
}
default: