|
@ -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)) { |
|
|
if (StrUtil.isEmpty(next_device_code)) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
if (StrUtil.equals(taskType, "null") || StrUtil.isEmpty(taskType)) { |
|
|
|
|
|
taskType = "0"; |
|
|
|
|
|
} |
|
|
TaskDto taskDto = new TaskDto(); |
|
|
TaskDto taskDto = new TaskDto(); |
|
|
String now = DateUtil.now(); |
|
|
String now = DateUtil.now(); |
|
|
taskDto.setTask_id(IdUtil.simpleUUID()); |
|
|
taskDto.setTask_id(IdUtil.simpleUUID()); |
|
|
taskDto.setTask_code("-" + CodeUtil.getNewCode("TASK_NO")); |
|
|
taskDto.setTask_code("-" + CodeUtil.getNewCode("TASK_NO")); |
|
|
taskDto.setTask_type("1"); |
|
|
taskDto.setTask_type(taskType); |
|
|
taskDto.setRoute_plan_code("normal"); |
|
|
taskDto.setRoute_plan_code("normal"); |
|
|
taskDto.setTask_status("0"); |
|
|
taskDto.setTask_status("0"); |
|
|
taskDto.setPriority("101"); |
|
|
taskDto.setPriority("101"); |
|
|
taskDto.setAgv_system_type("1"); |
|
|
taskDto.setAgv_system_type("1"); |
|
|
taskDto.setStart_device_code(this.getDevice().getDevice_code()); |
|
|
taskDto.setStart_device_code(start_device_code); |
|
|
taskDto.setStart_point_code(this.getDevice().getDevice_code()); |
|
|
taskDto.setStart_point_code(start_device_code); |
|
|
taskDto.setNext_point_code(next_device_code); |
|
|
taskDto.setNext_point_code(next_device_code); |
|
|
taskDto.setNext_point_code(next_device_code); |
|
|
taskDto.setNext_point_code(next_device_code); |
|
|
taskDto.setCreate_by(this.getDevice().getDevice_code()); |
|
|
taskDto.setCreate_by(start_device_code); |
|
|
taskDto.setUpdate_by(this.getDevice().getDevice_code()); |
|
|
taskDto.setUpdate_by(start_device_code); |
|
|
taskDto.setUpdate_time(now); |
|
|
taskDto.setUpdate_time(now); |
|
|
taskDto.setCreate_time(now); |
|
|
taskDto.setCreate_time(now); |
|
|
try { |
|
|
try { |
|
|
taskserver.create(taskDto); |
|
|
taskserver.create(taskDto); |
|
|
} catch (Exception e) { |
|
|
} 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.writing(1); |
|
|
this.setRequireSucess(true); |
|
|
this.setRequireSucess(true); |
|
|
return true; |
|
|
return true; |
|
|