diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java index e75f0ecef..f116b9a93 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java @@ -149,7 +149,6 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i material1 = this.itemProtocol.getMaterial1(); material2 = this.itemProtocol.getMaterial2(); qty = this.itemProtocol.getQty(); - to_command = this.itemProtocol.getTo_command(); @@ -227,8 +226,6 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i } else { this.setIsonline(true); this.setIserror(false); - Instruction instruction = null; - List toInstructions; //纸管库申请任务 switch (mode) { case 1: @@ -246,23 +243,22 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i case 5: if (move == 1 && !requireSucess && task > 0 && task1 > 0) { //申请套管校验 -// apply_for_casing_inspection(material1, material2); bushingSucess(); } else if (move != 1) { - remark = "套管工位没有货"; + message = "套管工位没有货"; } else if (task < 1) { - remark = "纸管库的任务号为空"; + message = "纸管库的任务号为空"; } else if (task1 < 1) { - remark = "行架任务为空"; + message = "行架任务为空"; } else { - remark = "requrieSucess 为: " + requireSucess; + message = "requrieSucess 为: " + requireSucess; } break; case 6: if (move == 0 && !requireSucess) { sucess(); - }else if (move != 0){ - remark = "套管工位有货"; + } else if (move != 0) { + message = "套管工位有货"; } default: log.info("未知模式"); @@ -282,7 +278,9 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i last_qty = qty; } - //取货完成 + /** + * 取货完成 + */ private void sucess() { Date date = new Date(); if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { @@ -292,6 +290,10 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); if (ObjectUtil.isNotEmpty(inst1)) { String task_code = inst1.getTask_code(); + if (Long.parseLong(task_code) < 1) { + message = "任务ACS创建,不反馈LMS取货完成"; + return; + } applyManipulatorActionRequest.setAction("1"); applyManipulatorActionRequest.setTask_code1(task_code); logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈套管工位取货完成"); @@ -302,7 +304,6 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i map.put("to_command", 6); this.writing(map); message = "套管工位取货完成"; - remark = ""; requireSucess = true; } else { requireSucess = false; @@ -324,6 +325,10 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i Instruction inst2 = instructionService.findByCode(String.valueOf(task1)); String task_code1 = inst1.getTask_code(); String task_code2 = inst2.getTask_code(); + if (Long.parseLong(task_code1) < 1 && Long.parseLong(task_code2) < 1) { + message = "任务ACS创建,不反馈LMS套轴完成"; + return; + } applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setTask_code1(task_code2); applyManipulatorActionRequest.setTask_code2(task_code1); @@ -336,7 +341,6 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i requireSucess = true; logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴完成反馈完成,返回参数:" + applyManipulatorActionResponse); message = "套轴完成成功"; - remark = null; } else { message = applyManipulatorActionResponse.getMessage(); Map map = new LinkedHashMap<>(); @@ -481,7 +485,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("material1", material1); jo.put("material2", material2); jo.put("isOnline", this.getIsonline()); - jo.put("message", ObjectUtil.isNotEmpty(remark) ? "反馈套管失败的原因:" + remark : message); + jo.put("message", message); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index 170425072..796ed4278 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -174,7 +174,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String notCreateInstMessage = ""; String feedMessage = ""; - + Integer task_count = 0; List getDeviceCodeList = null; @@ -429,18 +429,21 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple inst1.setInstruction_status("1"); inst1.setExecute_device_code(this.device_code); instructionService.update(inst1); + } } } - //反馈尺寸 if (mode == 3 && action == 2) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不反馈LMS尺寸"; + return; + } applyManipulatorActionRequest.setType("2"); applyManipulatorActionRequest.setTask_code1(task_code); applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); - logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈尺寸"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { feedbackSucess = true; @@ -451,17 +454,19 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple this.writing(map); } else { feedbackSucess = false; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - //logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + message = "反馈LMS尺寸失败"; } } //申请放货点 - if (mode == 3 && action == 3) { + if (mode == 3 && action == 3 ) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不向LMS申请放货点"; + return; + } applyManipulatorActionRequest.setType("3"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "开始申请放货点"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "申请放货点请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); @@ -478,17 +483,19 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple message = "申请新取货点成功"; } else { feedbackSucess = false; - message = "申请放货点LMS失败," + String.valueOf(applyManipulatorActionResponse.getMessage()); - //logServer.deviceExecuteLog(this.device_code, "", "", "申请放货点请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + message = "申请放货点LMS失败"; } } //申请新取货点 if (mode == 3 && action == 4) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不向LMS申请新取货点"; + return; + } applyManipulatorActionRequest.setType("4"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "开始申请取货点"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { String get_device_code = applyManipulatorActionResponse.getDevice_code(); @@ -497,7 +504,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple Map map = new LinkedHashMap<>(); map.put("to_command", 4); map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion()); - map.put("to_new_getpoint", Integer.parseInt(to_new_getpoint)); this.writing(map); feedbackSucess = true; @@ -506,16 +512,18 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } else { feedbackSucess = false; message = "申请新取货点失败"; - //logServer.deviceExecuteLog(this.device_code, "", "", "申请新取货点失败,返回参数:" + applyManipulatorActionResponse); } } //申请二次放货点 if (mode == 3 && action == 5) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不反馈LMS"; + return; + } applyManipulatorActionRequest.setType("5"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { String put_device_code2 = applyManipulatorActionResponse.getDevice_code(); @@ -533,16 +541,18 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } else { feedbackSucess = false; message = "申请二次放货点失败"; - //logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点,返回参数:" + applyManipulatorActionResponse); } } //缓存库取货完成 if (mode == 3 && action == 6) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不反馈LMS缓存库取货成功"; + return; + } applyManipulatorActionRequest.setAction("1"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈缓存库取货完成"); ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse1.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); @@ -554,16 +564,18 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } else { feedbackSucess = false; message = "缓存库取货失败"; - //logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货失败,返回参数:" + applyManipulatorActionResponse1); } } //缓存库放货完成 if (mode == 3 && action == 7) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不反馈LMS缓存库放货完成"; + return; + } applyManipulatorActionRequest.setAction("2"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈缓存库放货完成"); ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse1.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); @@ -575,7 +587,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } else { feedbackSucess = false; message = "缓存库放货失败"; - //logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,返回参数:" + applyManipulatorActionResponse1); } } } @@ -596,31 +607,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } catch (Exception e) { message = "取消任务或指令失败,失败原因"+ e.getMessage(); feedbackSucess = false; - //logServer.deviceExecuteLog(this.device_code, "", "", "取消任务或指令失败,失败原因"+e.getMessage()); } - /*String task_code = inst1.getTask_code(); - applyManipulatorActionRequest.setType("9"); - applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "异常反馈"); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (ObjectUtil.isNotEmpty(applyManipulatorActionResponse) && applyManipulatorActionResponse.getstatus() == 200) { - logServer.deviceExecuteLog(this.device_code, "", "", "异常反馈完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - Map map = new LinkedHashMap<>(); - map.put("to_command", 9); - this.writing(map); - feedbackSucess = true; - message = "缓存库放货成功"; - try { - instructionService.cancel(inst1.getInstruction_id()); - logServer.deviceExecuteLog(this.device_code, "", "", "取消指令完成"); - TaskDto byTaskCode = taskserver.findByTaskCode(inst1.getTask_code()); - taskserver.cancel(byTaskCode.getTask_id()); - logServer.deviceExecuteLog(this.device_code, "", "", "取消任务完成"); - } catch (Exception e) { - message = "取消任务或指令失败,失败原因"+ e.getMessage(); - logServer.deviceExecuteLog(this.device_code, "", "", "取消任务或指令失败,失败原因"+e.getMessage()); - } - }*/ } @@ -629,7 +616,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple if (inst1 != null) { try { feedbackSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "放货完成"); finish_instruction(inst1); Map map = new LinkedHashMap<>(); map.put("to_command", 8); @@ -910,11 +896,11 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件满足,允许创建指令,任务号为:" + task.getTask_code()); break; } else { + message = "任务号为:" + task.getTask_code() + "的RGV条件不满足,不允许允许创建指令"; task = null; - logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件不满足,不允许允许创建指令,任务号为:" + task); + // logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件不满足,不允许允许创建指令,任务号为:" + task); continue; } - } // 9 行架任务 if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "9")) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java index 494afa193..2f19d50a5 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java @@ -173,6 +173,10 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv ApplyManipulatorActionResponse applyManipulatorActionResponse; Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); String task_code1 = inst1.getTask_code(); + if (Long.parseLong(task_code1) < 1) { + message = "任务ACS创建,不向LMS反馈拔轴状态"; + return; + } applyManipulatorActionRequest.setTask_code1(task_code1); applyManipulatorActionRequest.setType("8"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); @@ -232,6 +236,10 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); // Instruction inst2 = instructionService.findByCode(String.valueOf(task2)); String task_code1 = inst1.getTask_code(); + if (Long.parseLong(task_code1) < 1) { + message = "任务ACS创建,不向LMS申请套轴"; + return; + } // String task_code2 = inst2.getTask_code(); applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setTask_code1(task_code1); @@ -264,6 +272,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv } } + public boolean exe_error() { if (this.error == 0) { return true; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index 16264fe90..a6c827882 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -469,13 +469,13 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme applyManipulatorActionRequest.setTask_code1(inst.getTask_code()); logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest); try { - for (int i = 0; i < 20; i++) { + for (int i = 0; i < 5; i++) { ApplyManipulatorActionResponse response = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); if (response == null || response.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage()); break; } else { - logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS失败" + response.getMessage()); + message = "task变化请求LMS失败: " + response.getMessage(); Thread.sleep(5000); } }