diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java index 59dce8c31..eee7ab0a3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java @@ -22,6 +22,7 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDriver; import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO; import org.nl.acs.enums.AcsToLmsApplyTaskTypeEnum; import org.nl.acs.ext.wms.service.AcsToWmsService; @@ -647,6 +648,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } //判断下一个输送线点位是否有货 BeltConveyorDeviceDriver beltConveyorDeviceDriver; + //异常位到叠盘位 + FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver; if (nextdevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver(); if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) { @@ -654,7 +657,14 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements this.setNotCreateInstMessage("universal_notCreateInstMessage4"); return false; } - }else { + }else if (nextdevice.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver){ + foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) nextdevice.getDeviceDriver(); + if (foldDiscSiteDeviceDriver.getMode() != 2 || foldDiscSiteDeviceDriver.getMove() == 1) { + log.error("输送机,{}未联机或执行中", next_device_code); + this.setNotCreateInstMessage("universal_notCreateInstMessage4"); + return false; + } + } else { //下一个设备不是输送线指令 this.setNotCreateInstMessage("universal_notCreateInstMessage6"); return false; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java index 42aea8be4..fad8ebf7d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java @@ -243,7 +243,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements //申请空托盘出库 - if (mode == 8 && move == 1 && !requireSucess){ + if (mode == 8 && !requireSucess){ applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(),mode); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index d6f28126d..ac1e675dd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -448,6 +448,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv .device_code(device_code) .content("木箱、子卷入库申请入库任务,参数:" + param) .build(); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); String response = acsToWmsService.applyTwo(param); JSONObject jo = JSON.parseObject(response); @@ -456,6 +457,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv .device_code(device_code) .content("木箱、子卷入库申请入库任务,参数,接口返回:" + jo) .build(); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); List list1 = new ArrayList(); Map map = new HashMap(); @@ -469,6 +471,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv .device_code(device_code) .content("木箱、子卷入库申请入库任务,返回参数:" + jo.getString("body")) .build(); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/ItemProtocol.java index 6ff248ff1..2a8699e3d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/ItemProtocol.java @@ -56,10 +56,7 @@ public class ItemProtocol { */ public static String item_y = "y"; - /** - * 行走开关信号 - */ - public static String item_move = "move"; + /** * 载货台开关信号 @@ -96,10 +93,7 @@ public class ItemProtocol { */ public static String item_forkLocation = "forkLocation"; - /** - * 货叉动作信号 - */ - public static String item_forkAction = "forkAction"; + /** * 特殊开关量1 */ @@ -129,43 +123,10 @@ public class ItemProtocol { * 轴运行次数 */ public static String item_stacker_runing_time = "stacker_runing time"; - /** - * 轴工作时间(小时) - */ - public static String item_stacker_workingHours = "stacker_workingHours"; - /** - * 载货台速度(转/分钟) - */ - public static String item_cargo_rpm = "cargo_rpm"; - /** - * 载货台电流 - */ - public static String item_cargo_electric_Current = "cargo_electric Current"; - /** - * 载货台轴工作小时数 - */ - public static String item_cargo_workingHours = "cargo_workingHours"; - /** - * 载货台轴运行次数 - */ - public static String item_cargo_runingTimes = "cargo_runingTimes"; - /** - * 货叉速度(转/分钟 - */ - public static String item_fork_rpm = "fork_rpm"; - /** - * 货叉电流 - */ - public static String item_fork_electric_Current = "fork_electric Current"; - /** - * 货叉轴工作时间(小时 - */ - public static String item_fork_workingHours = "fork_workingHours"; - /** - * 货叉轴运行次数 - */ - public static String item_fork_runingTimes = "fork_runingTimes"; + + + /** * 心跳 @@ -200,10 +161,7 @@ public class ItemProtocol { * 作业层 */ public static String item_to_y = "to_y"; - /** - * 托盘号 - */ - public static String item_to_trayCode = "to_trayCode"; + Boolean isonline; @@ -252,9 +210,6 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_y); } - public float getItem_move() { - return this.getOpcFloatValue(item_move); - } public float getItem_cargoMove() { return this.getOpcFloatValue(item_cargoMove); @@ -284,9 +239,7 @@ public class ItemProtocol { return this.getOpcFloatValue(item_forkLocation); } - public float getItem_forkAction() { - return this.getOpcFloatValue(item_forkAction); - } + public float getItem_special1() { return this.getOpcFloatValue(item_special1); @@ -312,45 +265,16 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_stacker_electricCurrent); } - public Integer getItem_stacker_workingHours() { - return this.getOpcIntegerValue(item_stacker_workingHours); - } + public Integer getItem_stacker_runing_time() { return this.getOpcIntegerValue(item_stacker_runing_time); } - public Integer getItem_cargo_rpm() { - return this.getOpcIntegerValue(item_cargo_rpm); - } - public Integer getItem_cargo_electric_Current() { - return this.getOpcIntegerValue(item_cargo_electric_Current); - } - public Integer getItem_cargo_workingHours() { - return this.getOpcIntegerValue(item_cargo_workingHours); - } - public Integer getItem_cargo_runingTimes() { - return this.getOpcIntegerValue(item_cargo_runingTimes); - } - public Integer getItem_fork_rpm() { - return this.getOpcIntegerValue(item_fork_rpm); - } - - public Integer getItem_fork_electric_Current() { - return this.getOpcIntegerValue(item_fork_electric_Current); - } - - public Integer getItem_fork_workingHours() { - return this.getOpcIntegerValue(item_fork_workingHours); - } - - public Integer getItem_fork_runingTimes() { - return this.getOpcIntegerValue(item_fork_runingTimes); - } public int getOpcIntegerValue(String protocol) { @@ -420,7 +344,6 @@ public class ItemProtocol { list.add(new ItemDto(item_z, "行走排号", "DB101.B38")); list.add(new ItemDto(item_x, "行走列号", "DB101.B39")); list.add(new ItemDto(item_y, "行走层号", "DB101.B40")); - list.add(new ItemDto(item_move, "行走开关信号", "DB101.B4")); list.add(new ItemDto(item_cargoMove, "载货台开关信号", "DB101.B41")); list.add(new ItemDto(item_action, "行走动作信号", "DB101.B5")); list.add(new ItemDto(item_distancex, "行走激光数值", "DB101.D16")); @@ -428,23 +351,13 @@ public class ItemProtocol { list.add(new ItemDto(item_cargoError, "载货台超限信号", "DB101.B43")); list.add(new ItemDto(item_forkCargo, "货叉探货信号", "DB101.B48")); list.add(new ItemDto(item_forkLocation, "货叉位置信号", "DB101.B49")); - list.add(new ItemDto(item_forkAction, "货叉动作信号", "DB101.B50")); list.add(new ItemDto(item_special1, "特殊开关量1", "DB101.B10")); list.add(new ItemDto(item_special2, "特殊开关量2", "DB101.B11")); list.add(new ItemDto(item_trayCode, "托盘条码", "DB101.B30.20")); list.add(new ItemDto(item_storage_cache, "水箱和消防缓存位有无货", "DB101.B50")); list.add(new ItemDto(item_stacker_rpm, "速度(转/分钟)", "DB101.W52")); list.add(new ItemDto(item_stacker_electricCurrent, "电流", "DB101.W54")); - list.add(new ItemDto(item_stacker_workingHours, "轴工作时间(小时)", "DB101.D56")); list.add(new ItemDto(item_stacker_runing_time, "轴运行次数", "DB101.D60")); - list.add(new ItemDto(item_cargo_rpm, "载货台速度(转/分钟)", "DB101.W64")); - list.add(new ItemDto(item_cargo_electric_Current, "载货台电流", "DB101.W66")); - list.add(new ItemDto(item_cargo_workingHours, "载货台轴工作小时数", "DB101.D68")); - list.add(new ItemDto(item_cargo_runingTimes, "载货台轴运行次数", "DB101.D72")); - list.add(new ItemDto(item_fork_rpm, "货叉速度(转/分钟)", "DB101.W76")); - list.add(new ItemDto(item_fork_electric_Current, "货叉电流", "DB101.W78")); - list.add(new ItemDto(item_fork_workingHours, "货叉轴工作时间(小时)", "DB101.D80")); - list.add(new ItemDto(item_fork_runingTimes, "货叉轴运行次数", "DB101.D84")); return list; } @@ -458,7 +371,6 @@ public class ItemProtocol { list.add(new ItemDto(item_to_z, "作业排", "DB100.B6")); list.add(new ItemDto(item_to_x, "作业列", "DB100.B7")); list.add(new ItemDto(item_to_y, "作业层", "DB100.B8")); - list.add(new ItemDto(item_to_trayCode, "托盘号", "DB100.B11.20")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java index f993b2a14..61e38ce26 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java @@ -19,6 +19,7 @@ import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver; import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.history.ErrorUtil; @@ -311,7 +312,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme z = this.itemProtocol.getItem_z(); x = this.itemProtocol.getItem_x(); y = this.itemProtocol.getItem_y(); - move = this.itemProtocol.getItem_move(); cargoMove = this.itemProtocol.getItem_cargoMove(); action = this.itemProtocol.getItem_action(); distancex = this.itemProtocol.getItem_distancex(); @@ -319,15 +319,14 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme cargoError = this.itemProtocol.getItem_cargoError(); forkCargo = this.itemProtocol.getItem_forkCargo(); forkLocation = this.itemProtocol.getItem_forkLocation(); - forkAction = this.itemProtocol.getItem_forkAction(); special1 = this.itemProtocol.getItem_special1(); special2 = this.itemProtocol.getItem_special2(); trayCode = this.itemProtocol.getItem_trayCode(); storage_cache = this.itemProtocol.getItem_storage_cache(); - if (!command.equals(last_command)){ - requireSucess=false; - if (command==0){ + if (!command.equals(last_command)) { + requireSucess = false; + if (command == 0) { clearWrite(); } } @@ -361,7 +360,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } //不同任务限制清零 - if (!Objects.equals(task, last_task)){ + if (!Objects.equals(task, last_task)) { count = 0; } @@ -396,24 +395,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme String next_device_code = instruction2.getNext_device_code(); Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) { - if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z"))) { - Map map = new HashMap(); - map.put("code", "to_x"); - map.put("value", nextDevice.getExtraValue().get("z")); - list.add(map); - } - if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("x"))) { - Map map = new HashMap<>(); - map.put("code", "to_z"); - map.put("value", nextDevice.getExtraValue().get("x")); - list.add(map); - } - if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("y"))) { - Map map = new HashMap<>(); - map.put("code", "to_y"); - map.put("value", nextDevice.getExtraValue().get("y")); - list.add(map); - } + packageDevicePoint(nextDevice, list); } if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())) { String pattern = "\\d+"; @@ -558,6 +540,27 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme last_fork_runingTimes = fork_runingTimes;*/ } + private static void packageDevicePoint(Device nextDevice, List list) { + if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z"))) { + Map map = new HashMap(); + map.put("code", "to_x"); + map.put("value", nextDevice.getExtraValue().get("z")); + list.add(map); + } + if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("x"))) { + Map map = new HashMap<>(); + map.put("code", "to_z"); + map.put("value", nextDevice.getExtraValue().get("x")); + list.add(map); + } + if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("y"))) { + Map map = new HashMap<>(); + map.put("code", "to_y"); + map.put("value", nextDevice.getExtraValue().get("y")); + list.add(map); + } + } + private boolean updateCommand(String toCommand) { Instruction instruction0 = checkInst(); if (ObjectUtil.isEmpty(instruction0)) { @@ -574,11 +577,11 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme message = "universal_message3"; //指定库位满入 - if (error == 5 && count< WcsConfig.stacker_error_in_count) { + if (error == 5 && count < WcsConfig.stacker_error_in_count) { //清警 cleanErro(); //相同任务时限制加一 - if (Objects.equals(task, last_task)){ + if (Objects.equals(task, last_task)) { count++; } applyUpdatePointCode(StandarStirageErroEnum.FILL.getType()); @@ -600,9 +603,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme //清警 cleanErro(); //放货 - if (cargoMove == 1 && count< WcsConfig.stacker_error_in_count) { + if (cargoMove == 1 && count < WcsConfig.stacker_error_in_count) { //相同任务时限制加一 - if (Objects.equals(task, last_task)){ + if (Objects.equals(task, last_task)) { count++; } applyUpdatePointCode(StandarStirageErroEnum.BLOCK_OUT.getType()); @@ -617,8 +620,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme List list = new ArrayList(); HashMap map = new HashMap(); - map.put("code","to_command"); - map.put("value","5"); + map.put("code", "to_command"); + map.put("value", "5"); list.add(map); writing(list); } @@ -662,13 +665,13 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())) { - task = task*1000; - updateData2(poinCode, instruction, point, split,task); + task = task * 1000; + updateData2(poinCode, instruction, point, split, task); List list = new ArrayList(); String x = point.getExtraValue().get("x").toString(); String y = split[1]; String z = split[2]; - pakagePLCData(list, x,y,z,"2",task); + pakagePLCData(list, x, y, z, "2", task.toString()); } } //取货潜货位阻挡做完移库任务 @@ -697,7 +700,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } } - private void pakagePLCData(List list, String x, String y, String z, String toCommand, Integer task) { + private void pakagePLCData(List list, String x, String y, String z, String toCommand, String task) { HashMap map1 = new HashMap(); map1.put("code", "to_x"); map1.put("value", y); @@ -727,28 +730,28 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme public void clearWrite() { List list = new ArrayList<>(); Map map = new HashMap<>(); - map.put("code","to_x"); - map.put("value","0"); + map.put("code", "to_x"); + map.put("value", "0"); list.add(map); Map map2 = new HashMap<>(); - map2.put("code","to_y"); - map2.put("value","0"); + map2.put("code", "to_y"); + map2.put("value", "0"); list.add(map2); Map map3 = new HashMap<>(); - map3.put("code","to_z"); - map3.put("value","0"); + map3.put("code", "to_z"); + map3.put("value", "0"); list.add(map3); Map map4 = new HashMap<>(); - map4.put("code","to_command"); - map4.put("value","0"); + map4.put("code", "to_command"); + map4.put("value", "0"); list.add(map4); Map map5 = new HashMap<>(); - map4.put("code","to_task"); - map4.put("value","0"); + map4.put("code", "to_task"); + map4.put("value", "0"); list.add(map4); this.writing(list); - message=null; + message = null; } private void updateData2(String poinCode, Instruction instruction, Device point, String[] split, Integer task) { @@ -766,20 +769,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } - - private void pakageData1(Instruction instruction, Instruction instructionUpdate, Device starPoint, String[] split, TaskDto taskUpdate) { - instructionUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString()); - instructionUpdate.setFrom_y(split[1]); - instructionUpdate.setFrom_z(split[2]); - instructionUpdate.setInstruction_code(String.valueOf(task)); - taskUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString()); - taskUpdate.setFrom_y(split[1]); - taskUpdate.setFrom_z(split[2]); - taskUpdate.setTask_code(instruction.getTask_code()); - - } - - private void pakageData2(Instruction instruction, Instruction instructionUpdate, Device starPoint, String[] split, TaskDto taskUpdate) { instructionUpdate.setTo_x(starPoint.getExtraValue().get("x").toString()); instructionUpdate.setTo_y(split[1]); @@ -805,16 +794,63 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } else { //维修解警后重新向堆垛机下发指令 Instruction instructionErro = checkInst(); - if (ObjectUtil.isNotEmpty(instructionErro)&&InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status())&& StrUtil.isNotEmpty(instructionErro.getExecute_code())){ - List list = new ArrayList(); - pakagePLCData(list, String.valueOf(z),String.valueOf(x),String.valueOf(y),instructionErro.getExecute_code(),task); - requireSucess = true; - return true; + if (ObjectUtil.isNotEmpty(instructionErro) && InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status()) && StrUtil.isNotEmpty(instructionErro.getExecute_code())) { + String start_device_code = instructionErro.getStart_device_code(); + Device startDevice = deviceAppService.findDeviceByCode(start_device_code); + if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { + //放货完成 + if (forkCargo==0) { + //取货中或者取货完成(分入库出库) + if ("1".equals(instructionErro.getExecute_code())||"2".equals(instructionErro.getExecute_code())) { + List list = new ArrayList(); + String startDeviceCode = instructionErro.getStart_device_code(); + Device startDeviceError = deviceAppService.findDeviceByCode(startDeviceCode); + if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) { + pakagePLCData(list, startDeviceError.getExtraValue().get("x").toString(), startDeviceError.getExtraValue().get("y").toString(), startDeviceError.getExtraValue().get("z").toString(), instructionErro.getExecute_code(), instructionErro.getInstruction_code()); + requireSucess = true; + return true; + } + } + } + //放货中报警 + if ("3".equals(instructionErro.getExecute_code())&&forkCargo==2) { + List list = new ArrayList(); + if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) { + pakagePLCData(list, instructionErro.getTo_x(), instructionErro.getTo_y(), instructionErro.getTo_z(), instructionErro.getExecute_code(), instructionErro.getInstruction_code()); + requireSucess = true; + return true; + } + } + } + //出库报警 + if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { + //取货报警 + if ("1".equals(instructionErro.getExecute_code())||"2".equals(instructionErro.getExecute_code())) { + List list = new ArrayList(); + if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name())) { + pakagePLCData(list, instructionErro.getFrom_x(), instructionErro.getFrom_y(), instructionErro.getFrom_z(), instructionErro.getExecute_code(), instructionErro.getInstruction_code()); + requireSucess = true; + return true; + } + } + //放货中报警 + if ("3".equals(instructionErro.getExecute_code())&&forkCargo==2) { + String next_device_code = instructionErro.getNext_device_code(); + Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); + List list = new ArrayList(); + if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) { + pakagePLCData(list, nextDevice.getExtraValue().get("x").toString(), nextDevice.getExtraValue().get("y").toString(), nextDevice.getExtraValue().get("z").toString(), instructionErro.getExecute_code(), instructionErro.getInstruction_code()); + requireSucess = true; + return true; + } + } + } + } this.instruction_require_time = date; //暂停任务 - if (stopReceiveTask){ + if (stopReceiveTask) { this.notCreateInstMessage = "任务暂停"; return false; } @@ -872,7 +908,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } List list = new ArrayList(); - pakageCommand(list,"1", inst.getInstruction_code()); + pakageCommand(list, "1", inst.getInstruction_code()); if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name()) && !prohibitInWarehouse) { if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) { HashMap map4 = new HashMap(); @@ -928,7 +964,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme list.add(map7); } - private void pakageCommand(List list, String toCommand,String inst) { + private void pakageCommand(List list, String toCommand, String inst) { HashMap map1 = new HashMap(); map1.put("code", "to_device_code"); map1.put("value", this.getDevice().getAddress()); @@ -1069,25 +1105,25 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme requireSucess = "1"; } String command = ""; - if(this.command == 0){ + if (this.command == 0) { command = LangProcess.msg("universal_standby"); - }else if(this.command == 1){ + } else if (this.command == 1) { command = LangProcess.msg("universal_delivery"); - }else if(this.command == 2){ + } else if (this.command == 2) { command = LangProcess.msg("universal_completed"); - }else if(this.command == 3){ + } else if (this.command == 3) { command = LangProcess.msg("universal_releasing"); - }else if(this.command == 4){ + } else if (this.command == 4) { command = LangProcess.msg("one_message1"); - }else if(this.command == 5){ + } else if (this.command == 5) { command = LangProcess.msg("universal_releasing_completed"); - }else if(this.command == 6){ + } else if (this.command == 6) { command = LangProcess.msg("one_message2"); - }else if(this.command == 7){ + } else if (this.command == 7) { command = LangProcess.msg("one_message3"); - }else if(this.command == 8){ + } else if (this.command == 8) { command = LangProcess.msg("one_message4"); - }else if(this.command == 9){ + } else if (this.command == 9) { command = LangProcess.msg("one_message5"); } jo.put("mode", mode); @@ -1102,7 +1138,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme jo.put("stopReceiveTask", this.stopReceiveTask); jo.put("requireSucess", requireSucess); jo.put("driver_type", "standard_stacker"); - jo.put("notCreateInstMessage", notCreateInstMessage); + jo.put("notCreateInstMessage", notCreateInstMessage); return jo; }