diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java index 345bfcf7e..eddb90030 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java @@ -87,7 +87,7 @@ public class AgvWaitUtil { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) endDevice.getDeviceDriver(); manipulatorAgvStationDeviceDriver.writing(2); if(manipulatorAgvStationDeviceDriver.getAction() != 1){ - log.info("不允许仙工AGV取货,烘箱对接位有报警,设备号 - {}", endDevice); + log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", endDevice); throw new BadRequestException("上位系统不允许取货"); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index 9f7ed40ee..cf2c55423 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -363,9 +363,9 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { jo1.put("blockId", IdUtil.simpleUUID()); jo1.put("location", pointCode); jo1.put("operation", "JackLoad"); -// jo1.put("operationArgs", new JSONObject() {{ -// put("recognize", true); -// }}); + jo1.put("operationArgs", new JSONObject() {{ + put("recognize", true); + }}); ja.add(jo1); 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 18cbc8360..758217593 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 @@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import lombok.val; import org.apache.commons.lang3.ObjectUtils; import org.nl.acs.agv.server.AgvService; import org.nl.acs.common.base.CommonFinalParam; @@ -89,6 +90,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements String notCreateInstMessage = ""; + /** * 心跳 */ @@ -167,7 +169,6 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements int last_to_height_level = 0; - //子卷条码 String material_barcode = null; String last_material_barcode = null; @@ -200,6 +201,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements String hand_barcode = null; + Boolean ignore_pickup_check = false; + /** * led点阵屏信息 */ @@ -234,14 +237,13 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements to_container_no = this.itemProtocol.getContainer_direction(); - - if (move != last_move && move==0 && last_move==1) { + if (move != last_move && move == 0 && last_move == 1) { requireSucess = false; clearWrite(); } if (move != 0 && task > 0) { - CompletableFuture.runAsync(() -> { + CompletableFuture.runAsync(() -> { // 异步更新指令状态 try { update_instruction_status(); @@ -259,7 +261,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements //申请空托盘出库 if (mode == 8 && !requireSucess) { - if (container_type==0){ + if (container_type == 0) { message = "托盘类型为空"; } applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode); @@ -287,7 +289,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements break; case 2: //申请任务 - if (move == 1 && !requireSucess) { + if (move == 1 && !requireSucess) { instruction_require(); } else { String remark = ""; @@ -322,8 +324,6 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements break; - - default: break; } @@ -344,26 +344,26 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements last_to_container_type = to_container_type; } - public void clearWrite() { - List list = new ArrayList<>(); - Map map = new HashMap<>(); - map.put("code","to_target"); - map.put("value","0"); - list.add(map); - Map map2 = new HashMap<>(); - map2.put("code","to_task"); - map2.put("value","0"); - list.add(map2); - Map map4 = new HashMap<>(); - map4.put("code","to_container_type"); - map4.put("value","0"); - list.add(map4); + public void clearWrite() { + List list = new ArrayList<>(); + Map map = new HashMap<>(); + map.put("code", "to_target"); + map.put("value", "0"); + list.add(map); + Map map2 = new HashMap<>(); + map2.put("code", "to_task"); + map2.put("value", "0"); + list.add(map2); + Map map4 = new HashMap<>(); + map4.put("code", "to_container_type"); + map4.put("value", "0"); + list.add(map4); - this.writing(list); - message=null; - vehicle_code=null; + this.writing(list); + message = null; + vehicle_code = null; - } + } public void writing(int command) { @@ -430,9 +430,6 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } - - - /** * 申请任务 */ @@ -471,10 +468,10 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class); String containerType = ""; if (ObjectUtil.isNotEmpty(interactionJsonDTO)) { - containerType = interactionJsonDTO.getContainerType(); + containerType = interactionJsonDTO.getContainerType(); } List list = new ArrayList(); - writeData(next_addr, list, inst,containerType); + writeData(next_addr, list, inst, containerType); // led_message = getLedMessage(inst); requireSucess = true; return true; @@ -522,7 +519,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) { next_point_code = next_device_code + "-" + taskDtoHandCode.getTo_y() + "-" + taskDtoHandCode.getTo_z(); Instruction instdto = new Instruction(); - packageData(instdto, route_plan_code, taskDtoHandCode, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority, containerType,vehicleCode); + packageData(instdto, route_plan_code, taskDtoHandCode, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority, containerType, vehicleCode); try { instructionService.create(instdto); } catch (Exception e) { @@ -606,14 +603,18 @@ 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) { - log.error("输送机,{}未联机或执行中", next_device_code); - this.setNotCreateInstMessage("universal_notCreateInstMessage4"); - return false; + Boolean ignorePickupCheck = (Boolean) beltConveyorDeviceDriver.getExtraValue().get("ignore_pickup_check"); + if (!ignorePickupCheck) { + if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) { + log.error("输送机,{}未联机或执行中", next_device_code); + this.setNotCreateInstMessage("universal_notCreateInstMessage4"); + return false; + } } - }else if (nextdevice.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver){ + } else if (nextdevice.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver) { foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) nextdevice.getDeviceDriver(); if (foldDiscSiteDeviceDriver.getMode() != 2 || foldDiscSiteDeviceDriver.getMove() == 1) { log.error("输送机,{}未联机或执行中", next_device_code); @@ -653,7 +654,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class); String containerType = ""; if (ObjectUtil.isNotEmpty(interactionJsonDTO)) { - containerType = interactionJsonDTO.getContainerType(); + containerType = interactionJsonDTO.getContainerType(); } List list = new ArrayList(); writeData(next_addr, list, instdto, containerType); @@ -662,7 +663,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements return true; } - private void writeData(String next_addr, List list, Instruction inst,String containerType) { + private void writeData(String next_addr, List list, Instruction inst, String containerType) { List list1 = new ArrayList(); Map map = new HashMap(); map.put("code", "to_target"); @@ -824,6 +825,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements jo.put("isOnline", this.getIsonline()); jo.put("requireSucess", requireSucess); jo.put("hand_barcode", hand_barcode); + jo.put("materiel", material_barcode); jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java index 2921e52d4..d525b6f26 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java @@ -260,6 +260,10 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i } break; case 25: + if ( StrUtil.isEmpty(material_barcode)) { + message = "子卷码为空"; + } + //二楼到一楼输送线申请行架任务 if (move == 1 && !requireSucess) { applyManipulatorTask(); 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 1acc43072..c43ad8638 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 @@ -295,10 +295,11 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv List toInstructions; //木箱入库申请入库任务 if (mode == 6 && !requireSucess) { - if (StrUtil.isEmpty(barcode)) { - message = "托盘条码为空"; + if (StrUtil.isEmpty(barcode)||StrUtil.isEmpty(material_barcode)) { + message = "托盘条码为空、或者子卷码为空"; + }else { + applyIn(StorageTypeEnum.BOX_IN.getType(), mode); } - applyIn(StorageTypeEnum.BOX_IN.getType(), mode); } @@ -306,8 +307,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv if (mode == 7 && move == 1 && !requireSucess) { if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) { message = "托盘条码为空、或者子卷码为空"; + }else { + applyIn(StorageTypeEnum.STORAGE.getType(), mode); } - applyIn(StorageTypeEnum.STORAGE.getType(), mode); } @@ -316,25 +318,27 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv if (mode == 9 && move == 1 && !requireSucess) { if (container_type == 0) { message = "托盘类型为空"; + }else { + applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); } - applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); - } //申请退货入库 if (mode == 18 && move == 1 && !requireSucess) { if (StrUtil.isEmpty(barcode)) { message = "托盘条码为空"; + }else { + applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode); } - applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode); } //申请高度 if (mode == 23 && !requireSucess) { if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) { message = "条码为空"; + }else { + applyErrorHeight(); } - applyErrorHeight(); } @@ -399,7 +403,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv if (StrUtil.isNotEmpty(hand_barcode)) { param.put("vehicle_code", hand_barcode); } - if (StrUtil.isNotEmpty(barcode)) { + if (StrUtil.isNotEmpty(barcode)&&(barcode.startsWith("A")||barcode.startsWith("B"))) { param.put("vehicle_code", barcode); } if (StrUtil.isNotEmpty(material_barcode)) { @@ -464,7 +468,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv if (StrUtil.isNotEmpty(hand_barcode)) { param.put("vehicle_code", hand_barcode); } - if (StrUtil.isNotEmpty(barcode)) { + if (StrUtil.isNotEmpty(barcode)&&(barcode.startsWith("A")||barcode.startsWith("B"))) { param.put("vehicle_code", barcode); } if (StrUtil.isNotEmpty(material_barcode)) { @@ -529,6 +533,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv this.writing(list); message = null; vehicle_code = null; + hand_barcode = null; } @@ -575,12 +580,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv JSONObject param = new JSONObject(); param.put("device_code", device_code); param.put("container_type", container_type); - if (StrUtil.isNotEmpty(hand_barcode)) { - param.put("vehicle_code", hand_barcode); - } - if (StrUtil.isNotEmpty(barcode)) { - param.put("vehicle_code", barcode); - } param.put("type", type); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) @@ -632,7 +631,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv if (StrUtil.isNotEmpty(hand_barcode)) { param.put("vehicle_code", hand_barcode); } - if (StrUtil.isNotEmpty(barcode)) { + if (StrUtil.isNotEmpty(barcode)&&(barcode.startsWith("A")||barcode.startsWith("B"))) { param.put("vehicle_code", barcode); } if (StrUtil.isNotEmpty(material_barcode)) { @@ -998,6 +997,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("hand_barcode", hand_barcode); + jo.put("barcode", barcode); + jo.put("material_barcode", material_barcode); jo.put("move", move); jo.put("action", action); jo.put("task", task); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java index 74780b4e3..54ad24ca5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java @@ -620,7 +620,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); + jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); 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 f3a350bbb..eac1a4d77 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 @@ -833,6 +833,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme requireSucess = true; return true; } + }else { + message = "不是取货中或者取货完成报警"; } } //放货中报警 @@ -843,6 +845,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme requireSucess = true; return true; } + }else { + message = "不是放货中报警"; } } //出库报警 @@ -855,6 +859,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme requireSucess = true; return true; } + }else { + message = "不是取货中或者取货完成报警"; } //放货中报警 if ("3".equals(instructionErro.getExecute_code()) && forkCargo == 2) { @@ -866,6 +872,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme requireSucess = true; return true; } + }else { + message = "不是放货中报警"; } } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 2dd85cf07..ca2ac49f2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -1085,9 +1085,10 @@ public class TaskServiceImpl extends CommonServiceImpl impleme @Override public TaskDto findByStartCodeAndReady(String device_code) { + //根据时间升序取第一个 Optional optionalTask = tasks.stream() .filter(task -> StrUtil.equals(task.getStart_device_code(), device_code) - && StrUtil.equals(task.getTask_status(), TaskStatusEnum.READY.getIndex())) + && StrUtil.equals(task.getTask_status(), TaskStatusEnum.READY.getIndex())).sorted(Comparator.comparing(TaskDto::getCreate_time)) .findFirst(); return optionalTask.orElse(null); } diff --git a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue index da2e2c627..4aa475fbb 100644 --- a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue @@ -704,7 +704,7 @@ export default { const obj = { name: i18n.t('monitor.click.inventory_quantity'), value: data[val] } this.arr.push(obj) } else if (val === 'hand_barcode') { - const obj = { name: '子卷编号', value: data[val] } + const obj = { name: '补码信息', value: data[val] } this.arr.push(obj) } else if (val === 'x') { const obj = { name: 'X', value: data[val] } @@ -745,6 +745,9 @@ export default { } else if (val === 'command') { const obj = { name: i18n.t('monitor.click.command'), value: data[val] } this.arr.push(obj) + } else if (val === 'material_barcode') { + const obj = { name: '子卷编号', value: data[val] } + this.arr.push(obj) } } }