|
|
@ -181,32 +181,37 @@ public class MaGangConveyorDeviceDriver extends AbstractOpcDeviceDriver implemen |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String taskType = String.valueOf(this.getExtraValue().get("taskType")); |
|
|
|
String start_device_code = this.getDevice().getDevice_code(); |
|
|
|
if (StrUtil.isEmpty(next_device_code)) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
if (StrUtil.equals(taskType, "null") || StrUtil.isEmpty(taskType)) { |
|
|
|
taskType = "0"; |
|
|
|
} |
|
|
|
TaskDto taskDto = new TaskDto(); |
|
|
|
String now = DateUtil.now(); |
|
|
|
taskDto.setTask_id(IdUtil.simpleUUID()); |
|
|
|
taskDto.setTask_code("-" + CodeUtil.getNewCode("TASK_NO")); |
|
|
|
taskDto.setTask_type("1"); |
|
|
|
taskDto.setTask_type(taskType); |
|
|
|
taskDto.setRoute_plan_code("normal"); |
|
|
|
taskDto.setTask_status("0"); |
|
|
|
taskDto.setPriority("101"); |
|
|
|
taskDto.setAgv_system_type("1"); |
|
|
|
taskDto.setStart_device_code(this.getDevice().getDevice_code()); |
|
|
|
taskDto.setStart_point_code(this.getDevice().getDevice_code()); |
|
|
|
taskDto.setStart_device_code(start_device_code); |
|
|
|
taskDto.setStart_point_code(start_device_code); |
|
|
|
taskDto.setNext_point_code(next_device_code); |
|
|
|
taskDto.setNext_point_code(next_device_code); |
|
|
|
taskDto.setCreate_by(this.getDevice().getDevice_code()); |
|
|
|
taskDto.setUpdate_by(this.getDevice().getDevice_code()); |
|
|
|
taskDto.setCreate_by(start_device_code); |
|
|
|
taskDto.setUpdate_by(start_device_code); |
|
|
|
taskDto.setUpdate_time(now); |
|
|
|
taskDto.setCreate_time(now); |
|
|
|
try { |
|
|
|
taskserver.create(taskDto); |
|
|
|
} catch (Exception e) { |
|
|
|
logServer.deviceExecuteLog(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); |
|
|
|
logServer.deviceExecuteLog(this.device_code, "", "", this.device_code + ":创建任务失败," + String.valueOf(e.getMessage())); |
|
|
|
} |
|
|
|
logServer.deviceExecuteLog(this.device_code, "", "", device_code + ":创建任务成功"); |
|
|
|
logServer.deviceExecuteLog(this.device_code, "", "", this.device_code + ":创建任务成功"); |
|
|
|
this.writing(1); |
|
|
|
this.setRequireSucess(true); |
|
|
|
return true; |
|
|
@ -220,7 +225,7 @@ public class MaGangConveyorDeviceDriver extends AbstractOpcDeviceDriver implemen |
|
|
|
//将扩展表中的字符串数据转换成集合
|
|
|
|
public List<String> getExtraDeviceCodes(String extraName) { |
|
|
|
String extraValue = (String) this.getDevice().getExtraValue().get(extraName); |
|
|
|
if (StrUtil.isEmpty(extraValue)){ |
|
|
|
if (StrUtil.isEmpty(extraValue)) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
String devicesString = extraValue.substring(1, extraValue.length() - 1); |
|
|
|