add : 测试入库
This commit is contained in:
@@ -353,23 +353,10 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
String taskcode = taskdto.getTask_code();
|
String taskcode = taskdto.getTask_code();
|
||||||
String vehiclecode = taskdto.getVehicle_code();
|
String vehiclecode = taskdto.getVehicle_code();
|
||||||
String priority = taskdto.getPriority();
|
String priority = taskdto.getPriority();
|
||||||
String route_plan_code = taskdto.getRoute_plan_code();
|
|
||||||
|
|
||||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(taskdto.getStart_device_code(), taskdto.getNext_device_code(), route_plan_code);
|
|
||||||
if (CollectionUtil.isEmpty(shortPathsList)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
RouteLineDto routeLineDto = shortPathsList.get(0);
|
|
||||||
String path = routeLineDto.getPath();
|
|
||||||
String[] str = path.split("->");
|
|
||||||
List<String> pathlist = Arrays.asList(str);
|
|
||||||
Integer start = 2;
|
|
||||||
String start_point_code = pathlist.get(start);
|
|
||||||
String start_device_code = pathlist.get(start);
|
|
||||||
String next_device_code = pathlist.get(start+1);
|
|
||||||
Instruction instdto = new Instruction();
|
Instruction instdto = new Instruction();
|
||||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||||
instdto.setRoute_plan_code(route_plan_code);
|
instdto.setRoute_plan_code(taskdto.getRoute_plan_code());
|
||||||
instdto.setRemark(taskdto.getRemark());
|
instdto.setRemark(taskdto.getRemark());
|
||||||
instdto.setMaterial(taskdto.getMaterial());
|
instdto.setMaterial(taskdto.getMaterial());
|
||||||
instdto.setQuantity(taskdto.getQuantity());
|
instdto.setQuantity(taskdto.getQuantity());
|
||||||
@@ -379,13 +366,13 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
instdto.setCreate_time(now);
|
instdto.setCreate_time(now);
|
||||||
instdto.setCreate_by("auto");
|
instdto.setCreate_by("auto");
|
||||||
instdto.setStart_device_code(start_device_code);
|
instdto.setStart_device_code(taskdto.getStart_device_code());
|
||||||
instdto.setNext_device_code(next_device_code);
|
instdto.setNext_device_code(taskdto.getNext_device_code());
|
||||||
instdto.setStart_point_code(start_point_code);
|
instdto.setStart_point_code(taskdto.getStart_device_code());
|
||||||
instdto.setNext_point_code(next_device_code);
|
instdto.setNext_point_code(taskdto.getNext_device_code());
|
||||||
instdto.setPriority(priority);
|
instdto.setPriority(priority);
|
||||||
instdto.setInstruction_status("0");
|
instdto.setInstruction_status("0");
|
||||||
instdto.setExecute_device_code(start_point_code);
|
instdto.setExecute_device_code(device_code);
|
||||||
try {
|
try {
|
||||||
instructionService.create(instdto);
|
instructionService.create(instdto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -393,7 +380,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
log.error("指令创建失败!", e.getMessage());
|
log.error("指令创建失败!", e.getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
|
Device nextdevice = deviceAppservice.findDeviceByCode(taskdto.getNext_device_code());
|
||||||
|
|
||||||
//创建指令后修改任务状态
|
//创建指令后修改任务状态
|
||||||
taskdto.setTask_status("1");
|
taskdto.setTask_status("1");
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class BoxPackageManipulatorDefination implements OpcDeviceDriverDefinatio
|
|||||||
@Override
|
@Override
|
||||||
public List<DeviceType> getFitDeviceTypes() {
|
public List<DeviceType> getFitDeviceTypes() {
|
||||||
List<DeviceType> types = new LinkedList();
|
List<DeviceType> types = new LinkedList();
|
||||||
types.add(DeviceType.station);
|
types.add(DeviceType.robot);
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.nl.acs.history.ErrorUtil;
|
|||||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||||
import org.nl.acs.instruction.domain.Instruction;
|
import org.nl.acs.instruction.domain.Instruction;
|
||||||
|
import org.nl.acs.instruction.enums.InstructionStatusEnum;
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||||
@@ -234,7 +235,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
Instruction inst = checkInst();
|
Instruction inst = checkInst();
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
if (StrUtil.equals(inst.getInstruction_status(), "0")) {
|
if (StrUtil.equals(inst.getInstruction_status(), "0")) {
|
||||||
inst.setInstruction_status(CommonFinalParam.ONE);
|
inst.setInstruction_status(InstructionStatusEnum.BUSY.getIndex());
|
||||||
inst.setExecute_device_code(this.device_code);
|
inst.setExecute_device_code(this.device_code);
|
||||||
instructionService.update(inst);
|
instructionService.update(inst);
|
||||||
}
|
}
|
||||||
@@ -299,7 +300,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||||
String startDeviceCode = getDeviceCodeList.get(i);
|
String startDeviceCode = getDeviceCodeList.get(i);
|
||||||
TaskDto taskDto = taskserver.findByStartCodeAndReady(startDeviceCode);
|
TaskDto taskDto = taskserver.findByStartCodeAndReady(startDeviceCode);
|
||||||
if (ObjectUtil.isNotEmpty(taskDto)) {
|
if (ObjectUtil.isNotEmpty(taskDto) && TaskTypeEnum.Truss_Task.getIndex().equals(taskDto.getTask_type())) {
|
||||||
String interactionJson = taskDto.getInteraction_json();
|
String interactionJson = taskDto.getInteraction_json();
|
||||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||||
String start_device_code = taskDto.getStart_device_code();
|
String start_device_code = taskDto.getStart_device_code();
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package org.nl.acs.device_driver.storage.double_extension_storage;
|
||||||
|
|
||||||
|
import org.nl.acs.device.domain.Device;
|
||||||
|
import org.nl.acs.device.enums.DeviceType;
|
||||||
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.DeviceDriverDefination;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 双伸位货架
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DoubleExtensionStorageDefination implements DeviceDriverDefination {
|
||||||
|
@Override
|
||||||
|
public String getDriverCode() {
|
||||||
|
return "double_extension_storage";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDriverName() {
|
||||||
|
return "双伸位货架";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDriverDescription() {
|
||||||
|
return "双伸位货架";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeviceDriver getDriverInstance(Device device) {
|
||||||
|
return (new DoubleExtensionStorageDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||||
|
return DoubleExtensionStorageDeviceDriver.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceType> getFitDeviceTypes() {
|
||||||
|
List<DeviceType> types = new LinkedList();
|
||||||
|
types.add(DeviceType.storage);
|
||||||
|
return types;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package org.nl.acs.device_driver.storage.double_extension_storage;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.StorageDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准版货架
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Data
|
||||||
|
public class DoubleExtensionStorageDeviceDriver extends AbstractDeviceDriver implements RouteableDeviceDriver, StorageDeviceDriver, DeviceDriver {
|
||||||
|
public DoubleExtensionStorageDeviceDriver() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTakeReady() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPutReady() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean fixTypes(Integer type) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user