From 3021a83d0c8344534efd4d0e62b2826c340f3371 Mon Sep 17 00:00:00 2001 From: yanps Date: Tue, 20 Feb 2024 14:03:10 +0800 Subject: [PATCH] =?UTF-8?q?opt:=20=E5=87=BA=E7=83=98=E7=AE=B1,=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E6=96=AD=E8=BF=9E=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...BoxPalletizingManipulatorDeviceDriver.java | 3 + .../CasingStationConveyorDeviceDriver.java | 3 + .../HongXiangConveyorDeviceDriver.java | 4 + .../IndoorManipulatorDeviceDriver.java | 3 +- .../OvenGantryManipulatorDeviceDriver.java | 200 ++++++++++-------- .../PaperTubeConveyorDeviceDriver.java | 11 +- .../PaperTubeConveyor2DeviceDriver.java | 4 + .../basedriver/rgv/RgvDeviceDriver.java | 3 + .../SiemensConveyorDeviceDriver.java | 3 + .../SiemensConveyorCkkDeviceDriver.java | 7 +- .../SiemensConveyorLabelingDeviceDriver.java | 7 +- ...iemensOneFloorAGVConveyorDeviceDriver.java | 3 + .../SlitTwoManipulatorDeviceDriver.java | 6 +- .../StandardCoveyorControlDeviceDriver.java | 4 + ...eyorControlWithPlcScannerDeviceDriver.java | 4 + ...CoveyorControlWithScannerDeviceDriver.java | 3 + .../StandardInspectSiteDeviceDriver.java | 6 + .../service/impl/InstructionServiceImpl.java | 28 +++ 18 files changed, 200 insertions(+), 102 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDeviceDriver.java index a09a9b202..b98a72a6d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDeviceDriver.java @@ -266,6 +266,9 @@ public class BoxPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriv } else if (this.getAction() == 4) { action = "放货完成"; } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); 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 7be76472c..7a038237c 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 @@ -479,6 +479,9 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i } else if (this.getMove() == 1) { move = "有托盘"; } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("task", task); jo.put("mode", mode); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java index 01c564b03..2fc5e8dc6 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -336,6 +336,9 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple move = "有托盘有货"; jo.put("hasGoods", true); } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("temperature", temperature); jo.put("finish", finish); @@ -351,6 +354,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple jo.put("move", move); jo.put("action", action); jo.put("task", this.getTask()); + jo.put("message", this.getMessage()); 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 74c974f91..70bce40a7 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 @@ -755,8 +755,9 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple if (this.requireSucess) { requireSucess = "1"; } - if(deviceStatus){ + if(deviceStatus && error == 0){ iserror = true; + message = "信号连接超时!"; } if(error == 0 && !deviceStatus){ iserror = false; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 86e9b7d11..f0ea29e13 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -123,6 +123,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i //行架机械手申请任务成功标识 boolean requireSucess = false; + public boolean deviceStatus = false; + private int instruction_finished_time_out; int branchProtocol = 0; @@ -172,6 +174,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i to_onset = this.itemProtocol.getTo_onset(); x_position = this.itemProtocol.getX_position(); y_position = this.itemProtocol.getY_position(); + deviceStatus = this.itemProtocol.getDevice_status(); + // if(heartbeat != last_heartbeat){ // logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat); // } @@ -386,105 +390,107 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code()); - String start_device_code = instruction.getStart_device_code(); - String next_device_code = instruction.getNext_device_code(); - Device nextdevice = deviceAppService.findDeviceByCode(next_device_code); - Device startdevice = deviceAppService.findDeviceByCode(start_device_code); - PhotoelectricInspectionSiteDeviceDriver photoelectricInspectionSiteDeviceDriver; - HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; - StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; - if (startdevice.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) { - photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) startdevice.getDeviceDriver(); - if (photoelectricInspectionSiteDeviceDriver.getMove() != 1) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + photoelectricInspectionSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code(); - return false; + if(ObjectUtil.isNotEmpty(instruction)){ + String start_device_code = instruction.getStart_device_code(); + String next_device_code = instruction.getNext_device_code(); + Device nextdevice = deviceAppService.findDeviceByCode(next_device_code); + Device startdevice = deviceAppService.findDeviceByCode(start_device_code); + PhotoelectricInspectionSiteDeviceDriver photoelectricInspectionSiteDeviceDriver; + HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; + StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; + if (startdevice.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) { + photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) startdevice.getDeviceDriver(); + if (photoelectricInspectionSiteDeviceDriver.getMove() != 1) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + photoelectricInspectionSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code(); + return false; + } } - } - if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); - if (standardInspectSiteDeviceDriver.getMove() != 1) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code(); - return false; + if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); + if (standardInspectSiteDeviceDriver.getMove() != 1) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code(); + return false; + } } - } - if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { - hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); - if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code(); - return false; + if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); + if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code(); + return false; + } } - } - if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); - if (standardInspectSiteDeviceDriver.getMove() != 0) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code(); + if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); + if (standardInspectSiteDeviceDriver.getMove() != 0) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code(); + return false; + } + } + if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); + if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code(); + return false; + } + } + //判断关联的同一列烘箱设备是否都关门 都关门返回false,有一个不关门就返回true + boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code); + //未关门结束 + if (isCloseDoor) { + notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); return false; } - } - if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { - hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); - if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code(); - return false; + instruction.setInstruction_status("1"); + instruction.setUpdate_time(DateUtil.now()); + instructionService.update(instruction); + Device startDevice = deviceAppService.findDeviceByCode(start_device_code); + Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); + if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { + throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); } - } - //判断关联的同一列烘箱设备是否都关门 都关门返回false,有一个不关门就返回true - boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code); - //未关门结束 - if (isCloseDoor) { - notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); - return false; - } - instruction.setInstruction_status("1"); - instruction.setUpdate_time(DateUtil.now()); - instructionService.update(instruction); - Device startDevice = deviceAppService.findDeviceByCode(start_device_code); - Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); - if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { - throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); - } - if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { - throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); - } - String start_addr = startDevice.getExtraValue().get("address").toString(); - String next_addr = nextDevice.getExtraValue().get("address").toString(); - logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:" - + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code() - + ",指令终点:" + instruction.getNext_device_code()); - this.writing("to_onset", start_addr); - this.writing("to_target", next_addr); - this.writing("to_task", instruction.getInstruction_code()); - this.writing("to_command", "1"); - if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { - hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); - List list = new ArrayList(); - Map map = new HashMap(); - map.put("code", "to_open_door"); - map.put("value", "1"); - list.add(map); - try { - hongXiangConveyorDeviceDriver.writing(list); - } catch (Exception e) { - logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2 ;now_steps_type:" + now_steps_type); + if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { + throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - } - if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { - hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); - List list = new ArrayList(); - Map map = new HashMap(); - map.put("code", "to_open_door"); - map.put("value", "1"); - list.add(map); - try { - hongXiangConveyorDeviceDriver.writing(list); - } catch (Exception e) { - logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type); + String start_addr = startDevice.getExtraValue().get("address").toString(); + String next_addr = nextDevice.getExtraValue().get("address").toString(); + logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:" + + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code() + + ",指令终点:" + instruction.getNext_device_code()); + this.writing("to_onset", start_addr); + this.writing("to_target", next_addr); + this.writing("to_task", instruction.getInstruction_code()); + this.writing("to_command", "1"); + if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_open_door"); + map.put("value", "1"); + list.add(map); + try { + hongXiangConveyorDeviceDriver.writing(list); + } catch (Exception e) { + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2 ;now_steps_type:" + now_steps_type); + } } + if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_open_door"); + map.put("value", "1"); + list.add(map); + try { + hongXiangConveyorDeviceDriver.writing(list); + } catch (Exception e) { + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type); + } + } + this.setNow_steps_type(2); + this.setRequireSucess(true); + return true; } - this.setNow_steps_type(2); - this.setRequireSucess(true); - return true; } else { List taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); if (ObjectUtil.isNotEmpty(taskDtoList)) { @@ -560,8 +566,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i String route_plan_code = task.getRoute_plan_code(); String next_point_code = task.getNext_point_code(); String next_device_code = task.getNext_device_code(); + String put_device_code = task.getPut_device_code(); + String put_point_code = task.getPut_point_code(); Instruction instdto = new Instruction(); + instdto.setPut_device_code(put_device_code); + instdto.setPut_point_code(put_point_code); instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setRoute_plan_code(route_plan_code); instdto.setRemark(task.getRemark()); @@ -843,7 +853,13 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else if (now_steps_type == 5) { steps_type += "放货完成"; } - + if(deviceStatus && error == 0){ + iserror = true; + message = "信号连接超时!"; + } + if(error == 0 && !deviceStatus){ + iserror = false; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); @@ -1128,7 +1144,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } - if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + /*if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver(); // hongXiangConveyorDeviceDriver.writing("to_close_door", "1"); @@ -1147,7 +1163,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } - } + }*/ this.writing("to_command", "5"); this.setNow_steps_type(6); this.setNow_steps_type(0); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device/PaperTubeConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device/PaperTubeConveyorDeviceDriver.java index f0f4ba6fa..cf8706b15 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device/PaperTubeConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device/PaperTubeConveyorDeviceDriver.java @@ -70,6 +70,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple int to_command =0; int to_target =0; String material = null; + String message = null; Boolean isonline = true; @@ -96,7 +97,6 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple @Override public void execute() { - String message = null; device_code = this.getDeviceCode(); heartbeat = this.itemProtocol.getHeartbeat(); @@ -137,9 +137,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple if(error > 0){ this.setIserror(true); } else { - if(error > 0){ - this.setIserror(false); - } + this.setIserror(false); } logServer.deviceExecuteLog(this.device_code, "", "", "信号out_finish:" + last_out_finish + "->" + out_finish); } @@ -217,6 +215,9 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple } else if (this.getMode() == 4) { mode = "出库中"; } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); @@ -224,6 +225,8 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple jo.put("out_finish", out_finish); jo.put("material", material); jo.put("isOnline", this.getIsonline()); + jo.put("isError", iserror); + jo.put("message", message); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java index 016a9fe7a..3e74f6042 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java @@ -759,6 +759,10 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl if (this.requireSucess) { requireSucess = "1"; } + if(error == 0 && iserror){ + this.message = "信号连接超时!"; + } + map.put("message", message); map.put("requireSucess", requireSucess); map.put("driver_type", "conveyor"); JSONObject jo = new JSONObject(map); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java index a4b14907b..3e22f1ac2 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java @@ -335,6 +335,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr } jo.put("hasGoods", true); } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move1", move1); 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 b7b0bec32..eceef6cb8 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 @@ -628,6 +628,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme if (this.requireSucess) { requireSucess = "1"; } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java index 2ea6b27fc..c7ed79a40 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java @@ -463,6 +463,9 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl if (this.requireSucess) { requireSucess = "1"; } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); @@ -471,8 +474,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl jo.put("last_task", last_task); jo.put("task_code", task_code); jo.put("hand_barcode", hand_barcode); - jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? null : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code()); -// jo.put("last_task", last_task); + jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null + ? null : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code()); jo.put("inst_message", this.inst_message); jo.put("last_inst_message", this.last_inst_message); jo.put("isOnline", this.getIsonline()); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java index 59439837d..1135ab5ae 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java @@ -456,7 +456,9 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver if (this.requireSucess) { requireSucess = "1"; } - + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); @@ -465,7 +467,8 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver jo.put("isOnline", this.getIsonline()); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); - jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? vehicle_code : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code()); + jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null + ? vehicle_code : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code()); jo.put("message", this.getMessage()); jo.put("is_click", true); jo.put("requireSucess", requireSucess); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_onefloor_agv_conveyor/SiemensOneFloorAGVConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_onefloor_agv_conveyor/SiemensOneFloorAGVConveyorDeviceDriver.java index ec02afa3b..c1103c6b3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_onefloor_agv_conveyor/SiemensOneFloorAGVConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_onefloor_agv_conveyor/SiemensOneFloorAGVConveyorDeviceDriver.java @@ -349,6 +349,9 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri if (this.requireSucess) { requireSucess = "1"; } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index d0b32465d..4d5d6ccd0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -1217,8 +1217,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl if (this.requireSucess) { requireSucess = "1"; } + if(error == 0 && iserror){ + type = 4; + } jo.put("requireSucess", requireSucess); - jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("status", status); @@ -1279,6 +1281,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl map.put("8", "双任务后工位放货完成"); map.put("9", "双任务前工位允许放货"); map.put("10", "双任务前工位放货完成"); + }else if(type == 4){ + return "信号连接超时!"; } else { return "未执行任务"; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java index e91c73019..bed3a27ba 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java @@ -464,6 +464,9 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver move = "有托盘有货"; jo.put("hasGoods", true); } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); @@ -472,6 +475,7 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver jo.put("error", this.getError()); jo.put("isError", this.getIserror()); jo.put("task", this.getTask()); + jo.put("message", message); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardCoveyorControlWithPlcScannerDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardCoveyorControlWithPlcScannerDeviceDriver.java index 81bce096e..68b4bc87d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardCoveyorControlWithPlcScannerDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardCoveyorControlWithPlcScannerDeviceDriver.java @@ -873,6 +873,9 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp if (this.applySucess) { applySucess = "1"; } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("requireSucess", requireSucess); jo.put("applySucess", applySucess); jo.put("driver_type", "standard_conveyor_control_with_scanner"); @@ -885,6 +888,7 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp jo.put("error", this.getError()); jo.put("isError", this.getIserror()); jo.put("task", this.getTask()); + jo.put("message", message); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java index f83892059..0e19aa287 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java @@ -1105,6 +1105,9 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe move = "有托盘有货"; jo.put("hasGoods", true); } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("driver_type", "standard_conveyor_control_with_scanner"); jo.put("mode", mode); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java index aa5488e21..f70ad76b3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java @@ -57,6 +57,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp //有货标记 protected boolean has_goods_tag = false; + int heartbeat = 0; int mode = 0; int error = 0; int move = 0; @@ -133,6 +134,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp try { device_code = this.getDeviceCode(); mode = this.itemProtocol.getMode(); + heartbeat = this.itemProtocol.getHeartbeat(); error = this.itemProtocol.getError(); move = this.itemProtocol.getMove(); action = this.itemProtocol.getAction(); @@ -233,6 +235,9 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp move = "有托盘有货"; jo.put("hasGoods", true); } + if(error == 0 && iserror){ + message = "信号连接超时!"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); @@ -243,6 +248,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp jo.put("task", this.getTask()); jo.put("is_click", true); jo.put("is_force", this.getIs_force()); + jo.put("message", message); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index ecb833cfc..ca03a80d9 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -413,6 +413,34 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu // 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统 if (!StrUtil.equals(task.getAgv_system_type(), "0") && ObjectUtil.isNotEmpty(task.getAgv_system_type())) { + if(StrUtil.isBlank(dto.getAgv_inst_type())){ + String agv_system_type = task.getAgv_system_type(); + String task_type = task.getTask_type(); + if (!StrUtil.equals(agv_system_type, "1")) { + // task_type + //1、生箔; Itype=1:取空,取满,放空,放满; + //2、分切 Itype=3取满、取空、放满、放空; + //3、普通任务 Itype=2:取货、放货; + //4、叉车任务 + //5、输送任务 + //6、行架 + //7、立库 + if (StrUtil.equals(task_type, "1")) { + dto.setAgv_inst_type("1"); + } else if (StrUtil.equals(task_type, "3")) { + dto.setAgv_inst_type("2"); + } else if (StrUtil.equals(task_type, "2")) { + dto.setAgv_inst_type("3"); + } else if (StrUtil.equals(task_type, "8")) { + dto.setAgv_inst_type("2"); + } else { + log.info("未找到对应的AGV指令类型,任务号:" + task.getTask_code() + ",task_type:" + task.getTask_type()) ; + } + } else { + dto.setAgv_inst_type("4"); + } + dto.setAgv_system_type(task.getAgv_system_type()); + } NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); log.warn("下发AGV指令数据,"+ "指令号:" + dto.getInstruction_code() + ",AGV系统类型:"+ dto.getAgv_system_type() + ",AGV指令类型:" + dto.getInstruction_type() );