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 9a70c32bc..79c2fa9e5 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 @@ -52,7 +52,19 @@ public class AgvWaitUtil { if(startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver){ manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); manipulatorAgvStationDeviceDriver.writing(2); - if(manipulatorAgvStationDeviceDriver.getAction() != 1){ + if(manipulatorAgvStationDeviceDriver.getAction() == 1){ + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("诺宝agv允许取货"+"点位"+startDeviceCode) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + JSONObject map = new JSONObject(); + map.put("status", 200); + map.put("message", "允许取货!"); + log.info("允许仙工AGV取货,设备号 - {}", startDeviceCode); + return map; + }else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(inst.getCarno()) .content("agv诺宝对接位行架不允许取货:" + inst.getCarno()+ "点位号"+ manipulatorAgvStationDeviceDriver.getDevice_code()) @@ -66,7 +78,19 @@ public class AgvWaitUtil { //agv叉车对接位安全信号交互 if(startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver){ boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) startDevice.getDeviceDriver(); - if(boxSubvolumesConveyorDeviceDriver.getMode() != 2){ + if(boxSubvolumesConveyorDeviceDriver.getMode() == 2){ + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("叉车允许取货") + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + JSONObject map = new JSONObject(); + map.put("status", 200); + map.put("message", "允许取货!"); + log.info("允许仙工AGV取货,设备号 - {}", startDeviceCode); + return map; + }else { LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(inst.getCarno()) .content("agv叉车对接位输送线不允许取货:" + inst.getCarno()+ "点位号"+ boxSubvolumesConveyorDeviceDriver.getDevice_code()) @@ -76,15 +100,9 @@ public class AgvWaitUtil { throw new BadRequestException("上位系统不允许取货"); } } - LuceneLogDto logDto1 = LuceneLogDto.builder() - .device_code(inst.getCarno()) - .content("200:允许取货") - .build(); - logDto1.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto1); JSONObject map = new JSONObject(); - map.put("status", 200); - map.put("message", "允许取货!"); + map.put("status", 400); + map.put("message", "取货点位信息不对!"); log.info("允许仙工AGV取货,设备号 - {}", startDeviceCode); return map; } @@ -98,14 +116,19 @@ public class AgvWaitUtil { Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode); ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())){ - BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver; - boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) startDevice.getDeviceDriver(); - boxSubvolumesConveyorDeviceDriver.writing(3); + if(startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver) { + BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver; + boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) startDevice.getDeviceDriver(); + boxSubvolumesConveyorDeviceDriver.writing(3); + } } + //诺宝agv调lms更新点位 if(inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())){ applyLmsGetOut(inst); - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(3); + if(startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); + manipulatorAgvStationDeviceDriver.writing(3); + } } JSONObject map = new JSONObject(); @@ -181,8 +204,10 @@ public class AgvWaitUtil { Device nextDevice = deviceAppService.findDeviceByCode(inst.getNext_device_code()); ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; if(inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())){ - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) nextDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(5); + if(nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) nextDevice.getDeviceDriver(); + manipulatorAgvStationDeviceDriver.writing(5); + } } log.info("仙工AGV放货完成后请求离开,设备号 - {}", endDeviceCode); 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 9ba83d160..b43d9b9c0 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 @@ -18,6 +18,8 @@ import org.nl.acs.agv.server.dto.AgvDto; import org.nl.acs.angle.service.IAcsPointAngleService; import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.device.domain.Device; +import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver; +import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; @@ -28,6 +30,7 @@ import org.nl.acs.task.enums.ActionTypeEnum; import org.nl.acs.task.enums.AgvActionTypeEnum; import org.nl.acs.task.enums.AgvSystemTypeEnum; import org.nl.common.exception.BadRequestException; +import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; @@ -58,6 +61,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { @Autowired private LuceneExecuteLogService luceneExecuteLogService; +// DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); + @Autowired private AgvWaitUtil agvWaitUtil; @@ -373,6 +378,9 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { jo1.put("blockId", IdUtil.simpleUUID()); jo1.put("location", pointCode); jo1.put("operation", "JackLoad"); +// Device device = deviceAppservice.findDeviceByCode(pointCode); +// StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; +// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver() ; jo1.put("operationArgs", new JSONObject() {{ put("recognize", true); }}); @@ -730,60 +738,52 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) { throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!"); } - if (address.contains("GET") || address.contains("WAIT")) { - if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { + //一楼诺宝agv + if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { + if (address.contains("GET") || address.contains("WAIT")) { //如果是取货二次分配,取放货二次分配需要重新追加动作块 if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { Integer actionType = ActionTypeEnum.IN_STOCK.getCode(); - deviceCodeNow = applyXGAgvTask(task_code, actionType, instructionDto); - if (StrUtil.isNotEmpty(deviceCodeNow)) { - return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); - } else { - LuceneLogDto logDto = LuceneLogDto.builder() - .content("取货分配新的点位为空") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - throw new BadRequestException("取货分配新的点位为空"); - } + String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); + return agvWaitUtil.waitInGet(newPointCode, instructionDto); } - } - return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); - } else if (address.contains("PUT") || address.contains("WAIT")) { - if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { + return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); + } else if (address.contains("PUT") || address.contains("WAIT")) { //如果是放货二次分配,取放货二次分配需要重新追加动作块 if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { Integer actionType = ActionTypeEnum.OUT_STOCK.getCode(); - deviceCodeNow = applyXGAgvTask(task_code, actionType, instructionDto); - if (StrUtil.isNotEmpty(deviceCodeNow)) { - return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); - } else { - LuceneLogDto logDto = LuceneLogDto.builder() - .content("防货分配新的点位为空") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - throw new BadRequestException("防货分配新的点位为空"); - } +// deviceCodeNow = applyXGAgvTask(task_code, actionType, instructionDto); + deviceCodeNow = "ZXQ_05"; + return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); } - } else if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { - deviceCodeNow = applyCCAgvTask(task_code, instructionDto); - if (StrUtil.isNotEmpty(deviceCodeNow)) { - JSONObject map = new JSONObject(); - map.put("status", 200); - map.put("message", "允许放货!"); - log.info("允许仙工AGV放货,设备号 - {}", deviceCodeNow); - return map; - } else { + return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); + } + } + //一楼叉车 + if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { + if (address.contains("GET")) { + //取货前等待 + return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); + } else { + //放货前二次分配 + if (address.contains("WAIT")) { + String newPointCode = applyCCAgvTask(task_code, instructionDto); LuceneLogDto logDto = LuceneLogDto.builder() - .content("防货分配新的点位为空") + .content("叉车允许放货"+"新点位:"+newPointCode) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - throw new BadRequestException("防货分配新的点位为空"); + JSONObject map = new JSONObject(); + map.put("status", 200); + map.put("message", "允许叉车放货!"+"点位"+newPointCode); + log.info("允许仙工AGV放货,设备号 - {}", newPointCode); + return map; + } + //放货前等待 + if (address.contains("PUT")) { + return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); } } - return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); } } if (address.contains("OUT")) { @@ -793,8 +793,10 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } if (address.contains("GET")) { + //取货完成 return agvWaitUtil.waitOutGet(deviceCodeNow, instructionDto); } else if (address.contains("PUT")) { + //放货完成 return agvWaitUtil.waitOutPut(deviceCodeNow, instructionDto); } } @@ -849,8 +851,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { jo.put("blocks", createBlocksDataTowCCStart(nextPoint)); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code("追加诺宝运单") - .content("指令号:" + instructionCode + ",追加诺宝运单参数:" + jo) + .device_code("追加叉车运单") + .content("指令号:" + instructionCode + ",追加叉车运单参数:" + jo) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -873,9 +875,9 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { .device_code("叉车追加运单响应") .content("指令号:" + instructionCode + ",下发追加诺宝叉车运单反馈参数:" + jo) .build(); - logDto.setLog_level(4); + logDto1.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto1); - log.info("指令号{},状态{},下发追加诺宝运单序列反馈:{}", instructionCode, result.getStatus(), result.body()); + log.info("指令号{},状态{},下发追加叉车运单序列反馈:{}", instructionCode, result.getStatus(), result.body()); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index 8a30e9cc5..c0eba6b43 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -113,6 +113,11 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple * 申请搬运任务 */ private Boolean apply_handling = false; + + /** + * 忽略校验 + */ + private Boolean standard_ordinary_site = false; /** * 申请物料 */ diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java index 88b5365b2..95fbef8db 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java @@ -184,6 +184,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i to_task = this.itemProtocol.getTo_task(); heartbeat = this.itemProtocol.getHeartbeat(); material_barcode = this.itemProtocol.getMaterialBarCode(); + // 更新指令状态 if (mode != last_mode) { JSONObject param = new JSONObject(); @@ -463,7 +464,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("isError", this.getIserror()); jo.put("message", message); jo.put("hand_barcode", hand_barcode); - jo.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code()); + jo.put("material_barcode", material_barcode); jo.put("is_click", true); jo.put("requireSucess", requireSucess); jo.put("driver_type", "siemens_conveyor"); 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 3dee61a78..49d3e1b78 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 @@ -648,6 +648,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv if (StrUtil.isNotEmpty(hand_material_barcode)) { param.put("material_barcode", hand_material_barcode); } + if (mode == 7 && weight != 0){ + param.put("weight", weight); + } param.put("type", type); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) diff --git a/acs2/nladmin-ui/src/i18n/langs/task/en.js b/acs2/nladmin-ui/src/i18n/langs/task/en.js index 5585ec735..1a450c80f 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/en.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/en.js @@ -10,6 +10,7 @@ export default { 'Warehouse_task_type': 'Warehouse Task Type', 'AGV_system': 'AGV System', 'Routing_scheme': 'Routing Scheme', + 'agv_action_type': 'agv Secondary allocation type', 'Priority': 'Priority', 'Vehicle_number': 'Vehicle Number', 'Task_code': 'Task Code', diff --git a/acs2/nladmin-ui/src/i18n/langs/task/in.js b/acs2/nladmin-ui/src/i18n/langs/task/in.js index ff60c0e7e..c64ecb3d2 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/in.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/in.js @@ -10,6 +10,7 @@ export default { 'Warehouse_task_type': 'Jenis Tugas Gudang', 'AGV_system': 'Sistem AGV', 'Routing_scheme': 'Skema Routing', + 'agv_action_type': 'Tipe distribusi kedua agv', 'Priority': 'Prioritas', 'Vehicle_number': 'Nomor Kendaraan', 'Task_code': 'Nomor Tugas', diff --git a/acs2/nladmin-ui/src/i18n/langs/task/zh.js b/acs2/nladmin-ui/src/i18n/langs/task/zh.js index 045882c91..a2d04657a 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/zh.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/zh.js @@ -10,6 +10,7 @@ export default { 'Warehouse_task_type': '立库任务类型', 'AGV_system': 'agv系统', 'Routing_scheme': '路由方案', + 'agv_action_type': 'agv二次分配类型', 'Priority': '优先级', 'Vehicle_number': '载具号', 'Task_code': '任务号', diff --git a/acs2/nladmin-ui/src/views/acs/device/driver/standard_ordinary_site.vue b/acs2/nladmin-ui/src/views/acs/device/driver/standard_ordinary_site.vue index ed4bf0d84..4c0e63e5c 100644 --- a/acs2/nladmin-ui/src/views/acs/device/driver/standard_ordinary_site.vue +++ b/acs2/nladmin-ui/src/views/acs/device/driver/standard_ordinary_site.vue @@ -24,7 +24,7 @@ - + diff --git a/acs2/nladmin-ui/src/views/acs/task/index.vue b/acs2/nladmin-ui/src/views/acs/task/index.vue index 638cf53c5..88c42db4c 100644 --- a/acs2/nladmin-ui/src/views/acs/task/index.vue +++ b/acs2/nladmin-ui/src/views/acs/task/index.vue @@ -204,6 +204,23 @@ /> + + + + +