fix: 堆垛机对接位到货架修改

This commit is contained in:
2024-04-19 14:08:30 +08:00
parent dc10c8ffc3
commit 53b6d91c3f
2 changed files with 63 additions and 60 deletions

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.conveyor.belt_conveyor; package org.nl.acs.device_driver.conveyor.belt_conveyor;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
@@ -463,9 +464,6 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
requireSucess = true; requireSucess = true;
return true; return true;
} else { } else {
//判断是否有相同起点的,任务状态就绪的任务
TaskDto taskdto = taskserver.findByStartCodeAndReady(device_code);
if (ObjectUtil.isNull(taskdto)) {
//补码生成堆垛机对接位到货架的指令 //补码生成堆垛机对接位到货架的指令
if (StrUtil.isNotEmpty(hand_barcode)) { if (StrUtil.isNotEmpty(hand_barcode)) {
TaskDto taskDtoHandCode = taskserver.findByVehicleCodeCodeAndReady(hand_barcode); TaskDto taskDtoHandCode = taskserver.findByVehicleCodeCodeAndReady(hand_barcode);
@@ -490,8 +488,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
List<String> pathlist = Arrays.asList(str); List<String> pathlist = Arrays.asList(str);
int index = 0; int index = 0;
for (int m = 0; m < pathlist.size(); m++) { for (int m = 0; m < pathlist.size(); m++) {
if (pathlist.get(m).equals(next_device_code)) { if (pathlist.get(m).equals(start_device_code)) {
index = m - 2; index = m + 2;
break; break;
} }
} }
@@ -504,7 +502,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code); Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
String next_point_code; String next_point_code;
if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) { if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) {
next_point_code = taskDtoHandCode.getTo_x() + "-" + taskDtoHandCode.getTo_y() + "-" + taskDtoHandCode.getTo_z(); next_point_code = next_device_code + "-" + taskDtoHandCode.getTo_y() + "-" + taskDtoHandCode.getTo_z();
Instruction instdto = new Instruction(); Instruction instdto = new Instruction();
packageData(instdto, route_plan_code, taskDtoHandCode, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority, containerType); packageData(instdto, route_plan_code, taskDtoHandCode, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority, containerType);
try { try {
@@ -520,8 +518,12 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
return false; return false;
} }
} }
return false; /**
} * 目前没有从标准输送线为起点的任务
*/
//判断是否有相同起点的,任务状态就绪的任务
/**
TaskDto taskdto = taskserver.findByStartCodeAndReady(device_code);
if (ObjectUtil.isNotNull(taskdto)) { if (ObjectUtil.isNotNull(taskdto)) {
//判断指令的起点和当前的设备号相同 //判断指令的起点和当前的设备号相同
if (!taskdto.getStart_device_code().equals(device_code)) { if (!taskdto.getStart_device_code().equals(device_code)) {
@@ -541,9 +543,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class); InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
containerType = interactionJsonDTO.getContainerType(); containerType = interactionJsonDTO.getContainerType();
} }
/**
* 开始平均分配
*/
String this_coevice_code = taskserver.queryAssignedByDevice(device_code, taskdto.getNext_device_code()); String this_coevice_code = taskserver.queryAssignedByDevice(device_code, taskdto.getNext_device_code());
if (StrUtil.isEmpty(this_coevice_code)) { if (StrUtil.isEmpty(this_coevice_code)) {
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, taskdto.getNext_device_code(), route_plan_code); List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, taskdto.getNext_device_code(), route_plan_code);
@@ -590,6 +590,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
} }
return updateTask(taskdto, nextdevice, instdto); return updateTask(taskdto, nextdevice, instdto);
} }
**/
} }
return false; return false;
@@ -602,7 +603,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
requireSucess = true; requireSucess = true;
String next_addr = nextdevice.getExtraValue().get("address").toString(); String next_addr = nextdevice.getExtraValue().get("address").toString();
List list = new ArrayList(); List list = new ArrayList();
writeData(next_addr, list, instdto); // writeData(next_addr, list, instdto);
// led_message = getLedMessage(instdto); // led_message = getLedMessage(instdto);
requireSucess = true; requireSucess = true;
return true; return true;

View File

@@ -1,9 +1,11 @@
package org.nl.acs.device_driver.storage.standard_storage; package org.nl.acs.device_driver.storage.standard_storage;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device; import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.DeviceDriverDefination; import org.nl.acs.device_driver.DeviceDriverDefination;
import org.nl.acs.device.enums.DeviceType; import org.nl.acs.device.enums.DeviceType;
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.LinkedList; import java.util.LinkedList;