add : 测试入库
This commit is contained in:
@@ -116,7 +116,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
}
|
||||
|
||||
if (i > 3) {
|
||||
// log.info("写入次数超过3次而失败");
|
||||
// log.info("写入次数超过3次而失败");
|
||||
throw new RuntimeException("写入次数超过3次而失败");
|
||||
}
|
||||
++i;
|
||||
|
||||
@@ -18,17 +18,17 @@ import java.util.List;
|
||||
public class BoxStorageOutConveyorDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "box_storage_conveyor";
|
||||
return "box_storage_out_conveyor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "一楼木箱入库站点";
|
||||
return "一楼木箱出入库标准站点";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "一楼木箱入库站点";
|
||||
return "一楼木箱出入库标准站点";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +45,7 @@ public class BoxStorageOutConveyorDefination implements OpcDeviceDriverDefinatio
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
types.add(DeviceType.conveyor);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
log.debug("设备运转模式:等待工作");
|
||||
break;
|
||||
case 2:
|
||||
//木箱出库申请任务
|
||||
//申请任务
|
||||
if (move > 0 && !requireSucess) {
|
||||
instruction_require();
|
||||
}
|
||||
|
||||
@@ -187,64 +187,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
weight = this.itemProtocol.getWeight();
|
||||
barcode = this.itemProtocol.getBarcode();
|
||||
|
||||
if (to_container_type != last_to_container_type) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_container_type:" + last_to_container_type + "->" + to_container_type);
|
||||
}
|
||||
if (container_type != last_container_type) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号container_type:" + last_container_type + "->" + container_type);
|
||||
}
|
||||
if (hj_task != last_hj_task) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号hj_task:" + last_hj_task + "->" + hj_task);
|
||||
}
|
||||
if (qty != last_qty) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号qty:" + last_qty + "->" + qty);
|
||||
}
|
||||
if (weight != last_weight) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号weight:" + last_weight + "->" + weight);
|
||||
}
|
||||
if (barcode != last_barcode) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号barcode:" + last_barcode + "->" + barcode);
|
||||
}
|
||||
if (carrier_direction != last_carrier_direction) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction:" + last_carrier_direction + "->" + carrier_direction);
|
||||
}
|
||||
if (to_command != last_to_command) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command);
|
||||
}
|
||||
if (to_target != last_to_target) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target);
|
||||
}
|
||||
if (to_task != last_to_task) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task);
|
||||
}
|
||||
if (mode != last_mode) {
|
||||
requireSucess = false;
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (move != last_move) {
|
||||
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
||||
}
|
||||
if (action != last_action) {
|
||||
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action);
|
||||
}
|
||||
if (error != last_error) {
|
||||
|
||||
//存在报警信号,则下发去异常处理位的任务
|
||||
applyErrorTask();
|
||||
|
||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
if (task != last_task) {
|
||||
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||
}
|
||||
|
||||
// 更新指令状态
|
||||
updateInstruct();
|
||||
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
|
||||
@@ -258,7 +201,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
//申请异常位任务
|
||||
applyErrorTask();
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
@@ -271,7 +215,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
}
|
||||
|
||||
//申请入库指令、异常位指令
|
||||
if (mode == 2 && move == 1 && task > 0 && !requireSucess) {
|
||||
if (mode == 2 && move == 1 && !requireSucess) {
|
||||
boolean res = instruction_require();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
|
||||
@@ -308,7 +308,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
//找符合条件的任务
|
||||
BoxSubvolumesConveyorDeviceDriver boxOutSubvolumesConveyorDeviceDriver = new BoxSubvolumesConveyorDeviceDriver();
|
||||
String deviceCode = boxOutSubvolumesConveyorDeviceDriver.getDevice_code();
|
||||
TaskDto taskDto = taskserver.findByEndCodeAndReady(deviceCode, TaskTypeEnum.Truss_Task.getIndex());
|
||||
TaskDto taskDto = taskserver.findByEndCodeAndReady(deviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDto)) {
|
||||
|
||||
String interactionJson = taskDto.getInteraction_json();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.device_driver.one_manipulator.box_package_manipulator;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -154,7 +154,6 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
to_barcode = this.itemProtocol.getTo_barcode();
|
||||
|
||||
|
||||
|
||||
// 更新指令状态
|
||||
if (mode == 3 && task > 0) {
|
||||
updateInstructionStatus();
|
||||
@@ -242,10 +241,10 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
|
||||
//放货完成
|
||||
if (mode == 3 && action == 4 && move == 0) {
|
||||
if (action == 4 && move == 0) {
|
||||
if (inst != null) {
|
||||
try {
|
||||
logServer.deviceExecuteLog(this.device_code,"","","放货完成");
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "放货完成");
|
||||
finish_instruction(inst);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 5);
|
||||
@@ -256,12 +255,12 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
e.printStackTrace();
|
||||
}
|
||||
feedMessage = "";
|
||||
}else {
|
||||
} else {
|
||||
feedMessage = "行架机械手:";
|
||||
if (mode != 3) {
|
||||
feedMessage = feedMessage + "工作模式(mode)不为运行中状态,";
|
||||
}
|
||||
if (action != 8) {
|
||||
if (action != 5) {
|
||||
feedMessage = feedMessage + "动作信号(action)不为放货完成状态,";
|
||||
}
|
||||
if (move != 0) {
|
||||
@@ -285,95 +284,100 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_require_time = date;
|
||||
//抓取工位
|
||||
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
||||
getDeviceCodeList = this.getExtraDeviceCodes("get_device_code");
|
||||
}
|
||||
//放货工位
|
||||
if (ObjectUtil.isEmpty(putDeviceCodeList)) {
|
||||
putDeviceCodeList = this.getExtraDeviceCodes("put_device_code");
|
||||
}
|
||||
//找终点为入库输送线工位任务类型为行架的任务
|
||||
BoxSubvolumesConveyorDeviceDriver boxOutSubvolumesConveyorDeviceDriver = new BoxSubvolumesConveyorDeviceDriver();
|
||||
String deviceCode = boxOutSubvolumesConveyorDeviceDriver.getDevice_code();
|
||||
TaskDto taskDto = taskserver.findByEndCodeAndReady(deviceCode, TaskTypeEnum.Box_Storage.getIndex());
|
||||
if (ObjectUtil.isNotEmpty(taskDto)) {
|
||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||
String startDeviceCode = getDeviceCodeList.get(i);
|
||||
TaskDto taskDto = taskserver.findByStartCodeAndReady(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDto)) {
|
||||
String interactionJson = taskDto.getInteraction_json();
|
||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||
String start_device_code = taskDto.getStart_device_code();
|
||||
String next_device_code = taskDto.getNext_device_code();
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
String taskid = taskDto.getTask_id();
|
||||
String taskcode = taskDto.getTask_code();
|
||||
String start_point_code = taskDto.getStart_point_code();
|
||||
String route_plan_code = taskDto.getRoute_plan_code();
|
||||
String next_point_code = taskDto.getNext_point_code();
|
||||
Instruction instdto = new Instruction();
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(route_plan_code);
|
||||
instdto.setTask_id(taskid);
|
||||
instdto.setTask_code(taskcode);
|
||||
instdto.setCreate_by("auto");
|
||||
instdto.setStart_device_code(start_device_code);
|
||||
instdto.setNext_device_code(next_device_code);
|
||||
instdto.setStart_point_code(start_point_code);
|
||||
instdto.setNext_point_code(next_point_code);
|
||||
instdto.setInstruction_status("0");
|
||||
instdto.setExecute_device_code(device_code);
|
||||
|
||||
String interactionJson = taskDto.getInteraction_json();
|
||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||
String start_device_code = taskDto.getStart_device_code();
|
||||
String next_device_code = taskDto.getNext_device_code();
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
String taskid = taskDto.getTask_id();
|
||||
String taskcode = taskDto.getTask_code();
|
||||
String start_point_code = taskDto.getStart_point_code();
|
||||
String route_plan_code = taskDto.getRoute_plan_code();
|
||||
String next_point_code = taskDto.getNext_point_code();
|
||||
Instruction instdto = new Instruction();
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(route_plan_code);
|
||||
instdto.setTask_id(taskid);
|
||||
instdto.setTask_code(taskcode);
|
||||
String now = DateUtil.now();
|
||||
instdto.setCreate_time(now);
|
||||
instdto.setCreate_by("auto");
|
||||
instdto.setStart_device_code(start_device_code);
|
||||
instdto.setNext_device_code(next_device_code);
|
||||
instdto.setStart_point_code(start_point_code);
|
||||
instdto.setNext_point_code(next_point_code);
|
||||
instdto.setInstruction_status("0");
|
||||
instdto.setExecute_device_code(device_code);
|
||||
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = e.getMessage();
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "创建指令时出现异常:" + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
+ instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
|
||||
+ ",指令终点:" + instdto.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString());
|
||||
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 1);
|
||||
map.put("to_target", next_addr);
|
||||
map.put("to_onset", start_addr);
|
||||
map.put("to_task", instdto.getInstruction_code());
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getItem_to_weight())) {
|
||||
map.put("to_wedth", interactionJsonDTO.getItem_to_weight());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getItem_to_length())) {
|
||||
map.put("to_length", interactionJsonDTO.getItem_to_length());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getItem_to_height())) {
|
||||
map.put("to_height", interactionJsonDTO.getItem_to_height());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getItem_to_barcode())) {
|
||||
map.put("to_barcode", interactionJsonDTO.getItem_to_barcode());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getItem_to_layer())) {
|
||||
map.put("to_layer", interactionJsonDTO.getItem_to_layer());
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
this.writing(map);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
//创建指令后修改任务状态
|
||||
taskDto.setTask_status("1");
|
||||
taskserver.update(taskDto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = e.getMessage();
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "创建指令时出现异常:" + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
+ instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
|
||||
+ ",指令终点:" + instdto.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString() + ",指令执行失败:" + e.getMessage());
|
||||
+ ",指令终点:" + instdto.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString());
|
||||
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 1);
|
||||
map.put("to_target", next_addr);
|
||||
map.put("to_onset", start_addr);
|
||||
map.put("to_task", instdto.getInstruction_code());
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getTo_weight())) {
|
||||
map.put("to_wedth", interactionJsonDTO.getTo_weight());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getTo_length())) {
|
||||
map.put("to_length", interactionJsonDTO.getTo_length());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getTo_height())) {
|
||||
map.put("to_height", interactionJsonDTO.getTo_height());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getTo_barcode())) {
|
||||
map.put("to_barcode", interactionJsonDTO.getTo_barcode());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getTo_layer())) {
|
||||
map.put("to_layer", interactionJsonDTO.getTo_layer());
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
this.writing(map);
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
+ instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
|
||||
+ ",指令终点:" + instdto.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString() + ",指令执行失败:" + e.getMessage());
|
||||
}
|
||||
this.setRequireSucess(true);
|
||||
return true;
|
||||
}else{
|
||||
notCreateInstMessage = "未找到关联设备的任务,指令无法创建";
|
||||
}
|
||||
this.setRequireSucess(true);
|
||||
return true;
|
||||
} else {
|
||||
notCreateInstMessage = "未找到关联设备的任务,指令无法创建";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发
|
||||
* @param map
|
||||
*/
|
||||
public void writing(Map<String, Object> map) {
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
Map<String, Object> itemMap = new LinkedHashMap<>();
|
||||
@@ -383,15 +387,12 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
});
|
||||
if (ObjectUtil.isNotEmpty(itemMap)) {
|
||||
try {
|
||||
this.checkcontrol(itemMap);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
this.control(itemMap);
|
||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public synchronized boolean finish_instruction(Instruction inst) throws Exception {
|
||||
instructionService.finish(inst);
|
||||
return true;
|
||||
@@ -405,6 +406,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
public String getToParam() {
|
||||
return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + ".";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
@@ -8,24 +8,24 @@ public class InteractionJsonDTO {
|
||||
/**
|
||||
*木箱长度
|
||||
*/
|
||||
private String item_to_length = "to_length";
|
||||
private String to_length;
|
||||
/**
|
||||
*木箱宽度
|
||||
*/
|
||||
private String item_to_weight = "to_weight";
|
||||
private String to_weight;
|
||||
/**
|
||||
*木箱高度
|
||||
*/
|
||||
private String item_to_height = "to_height";
|
||||
private String to_height;
|
||||
|
||||
/**
|
||||
*下发木箱条码
|
||||
*/
|
||||
private String item_to_barcode = "to_barcode";
|
||||
private String to_barcode;
|
||||
|
||||
/**
|
||||
*下发木箱层数
|
||||
*/
|
||||
private String item_to_layer = "to_layer";
|
||||
private String to_layer;
|
||||
|
||||
}
|
||||
|
||||
@@ -169,6 +169,8 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.B5"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D6"));
|
||||
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4"));
|
||||
list.add(new ItemDto(item_to_barcode, "下发木箱条码", "DB1.B7"));
|
||||
list.add(new ItemDto(item_to_layer, "下发木箱层数", "DB1.B8"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
this.instruction_require_time = date;
|
||||
BoxStorageOutConveyorDeviceDriver boxStorageConveyorDeviceDriver = new BoxStorageOutConveyorDeviceDriver();
|
||||
String deviceCode = boxStorageConveyorDeviceDriver.getDevice_code();
|
||||
TaskDto taskDto = taskserver.findByEndCodeAndReady(deviceCode, TaskTypeEnum.Return_Good.getIndex());
|
||||
TaskDto taskDto = taskserver.findByEndCodeAndReady(deviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDto)) {
|
||||
String start_device_code = taskDto.getStart_device_code();
|
||||
String next_device_code = taskDto.getNext_device_code();
|
||||
|
||||
@@ -289,7 +289,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
|
||||
|
||||
BoxManipulatorSiteDeviceDriver boxManipulatorSiteDeviceDriver = new BoxManipulatorSiteDeviceDriver();
|
||||
String deviceCode = boxManipulatorSiteDeviceDriver.getDevice_code();
|
||||
TaskDto taskDto = taskserver.findByEndCodeAndReady(deviceCode, TaskTypeEnum.Truss_Task.getIndex());
|
||||
TaskDto taskDto = taskserver.findByEndCodeAndReady(deviceCode);
|
||||
String interactionJson = taskDto.getInteraction_json();
|
||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||
if (ObjectUtil.isNotEmpty(taskDto)) {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class RgvDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.conveyor);
|
||||
types.add(DeviceType.rgv);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -386,10 +386,9 @@ public interface TaskService extends CommonService<Task> {
|
||||
* 根据终点设备编号查询当前是否有就绪任务
|
||||
*
|
||||
* @param device_code
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
TaskDto findByEndCodeAndReady(String device_code, String index);
|
||||
TaskDto findByEndCodeAndReady(String device_code);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1000,11 +1000,11 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
|
||||
|
||||
@Override
|
||||
public TaskDto findByEndCodeAndReady(String device_code, String index) {
|
||||
public TaskDto findByEndCodeAndReady(String device_code) {
|
||||
Optional<TaskDto> optionalTask = tasks.stream()
|
||||
.filter(task -> StrUtil.equals(task.getNext_device_code(), device_code)
|
||||
&& StrUtil.equals(task.getTask_status(), TaskStatusEnum.READY.getIndex())
|
||||
&& StrUtil.equals(task.getTask_type(), index))
|
||||
)
|
||||
.findFirst();
|
||||
return optionalTask.orElse(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user