From a46c59ac48408c85848d66012108a60aad4eef94 Mon Sep 17 00:00:00 2001 From: wangsong <546428999@qq.com> Date: Fri, 21 Jun 2024 10:26:32 +0800 Subject: [PATCH 01/40] =?UTF-8?q?rev=20=20=E6=8B=94=E5=89=8D=E8=A1=8C?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pull_head_manipulator/PullHeadManipulatorDeviceDriver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index 4ef5de975..f51d46475 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -408,7 +408,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp Device next_device = deviceAppService.findDeviceByCode(nextDeviceCode); if (next_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) next_device.getDeviceDriver(); - if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2&&plugPullDeviceSiteDeviceDriver.getAction() != 3) + if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2 || plugPullDeviceSiteDeviceDriver.getAction() != 3) notCreateInstMessage = "universal_notCreateInstMessage9"; return false; } From 1ae38d6d86d1d482f6592f84ef5ad24facc7a006 Mon Sep 17 00:00:00 2001 From: liuxy Date: Fri, 21 Jun 2024 14:07:27 +0800 Subject: [PATCH 02/40] =?UTF-8?q?rev=EF=BC=9A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/nl/config/lucene/AsyncLuceneAppender.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/config/lucene/AsyncLuceneAppender.java b/lms/nladmin-system/src/main/java/org/nl/config/lucene/AsyncLuceneAppender.java index 4ab09d6f4..c30fb74fa 100644 --- a/lms/nladmin-system/src/main/java/org/nl/config/lucene/AsyncLuceneAppender.java +++ b/lms/nladmin-system/src/main/java/org/nl/config/lucene/AsyncLuceneAppender.java @@ -26,7 +26,12 @@ public class AsyncLuceneAppender extends AspectLogbackAsyncAppender { mdcPropertyMap.put("traceId", traceId); } } - super.append(event); + try { + super.append(event); + } catch (Exception e) { + System.out.println(e.getMessage()); + return; + } } } From 6c201406e2181f1fa4df9ae423f06865377aa149 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Sat, 22 Jun 2024 09:12:48 +0800 Subject: [PATCH 03/40] =?UTF-8?q?fix:=20=E4=BB=99=E5=AE=AB=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/acs/agv/AgvWaitUtil.java | 8 +++ .../server/impl/XianGongAgvServiceImpl.java | 37 ++++++------ .../BoxSubvolumesConveyorDeviceDriver.java | 18 ++++-- .../FoldDiscSiteDeviceDriver.java | 11 +++- ...ConveyorWithScannerWeightDeviceDriver.java | 9 +++ .../StandardStackerDeviceDriver.java | 46 +++++++++++++-- .../acs/ext/wms/data/CreateTaskRequest.java | 5 ++ .../wms/service/impl/AcsToWmsServiceImpl.java | 56 +++++++++---------- .../wms/service/impl/WmsToAcsServiceImpl.java | 2 + .../service/impl/InstructionServiceImpl.java | 26 +-------- .../task/service/impl/TaskServiceImpl.java | 1 + .../monitor/one_device/one_device.properties | 2 + .../one_device/one_device_en_US.properties | 3 +- .../one_device/one_device_in_ID.properties | 3 +- .../one_device/one_device_zh_CN.properties | 3 +- 15 files changed, 142 insertions(+), 88 deletions(-) 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 7c74d4e71..c5f1965ba 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 @@ -16,6 +16,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.task.enums.AgvSystemTypeEnum; import org.nl.common.exception.BadRequestException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; @@ -74,6 +75,13 @@ public class AgvWaitUtil { log.info("仙工AGV取货完成后请求离开,设备号 - {}", startDeviceCode); inst.setExecute_status("2"); instructionService.update(inst); + //如果是叉车,取货完成给输送线完成信号 + Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode); + if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())){ + BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver; + boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) startDevice.getDeviceDriver(); + boxSubvolumesConveyorDeviceDriver.writing(3); + } JSONObject map = new JSONObject(); map.put("status", 200); map.put("message", "允许离开!"); 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 ce0f3a873..2104b71a8 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 @@ -696,7 +696,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { throw new BadRequestException("请求失败,地址为空!"); } if (address.contains("IN")) { - String instructionCode = instructionDto.getInstruction_code(); + String task_code = instructionDto.getTask_code(); String deviceCodeNow = address.substring(0, address.length() - 5); if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) { throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!"); @@ -706,10 +706,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { //如果是取货二次分配,取放货二次分配需要重新追加动作块 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(instructionCode, actionType, instructionDto); + deviceCodeNow = applyXGAgvTask(task_code, actionType, instructionDto); } - } else if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { - } return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); } else if (address.contains("PUT")) { @@ -717,11 +715,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { //如果是放货二次分配,取放货二次分配需要重新追加动作块 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(instructionCode, actionType, instructionDto); + deviceCodeNow = applyXGAgvTask(task_code, actionType, instructionDto); } } else if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { - Integer actionType = ActionTypeEnum.OUT_STOCK.getCode(); - deviceCodeNow = applyCCAgvTask(instructionCode, actionType, instructionDto); + + deviceCodeNow = applyCCAgvTask(task_code, instructionDto); } return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); } @@ -742,18 +740,17 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { throw new BadRequestException("请求失败,IN OUT 站点错误!"); } - private String applyCCAgvTask(String instructionCode, Integer actionType, Instruction instructionDto) { + private String applyCCAgvTask(String task_code, Instruction instructionDto) { try { JSONObject param = new JSONObject(); - param.put("taskCode", instructionCode); - param.put("actionType", actionType.toString()); + param.put("task_code", task_code); LuceneLogDto logDto = LuceneLogDto.builder() .device_code("追加动叉车作块:") - .content("追加动叉车作块,参数:" + instructionCode + "--" + actionType) + .content("追加动叉车作块,参数:" + task_code ) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - String response = acsToWmsService.secondaryAllocationPoint(param); + String response = acsToWmsService.applySendOutTwo(param); JSONObject jo = JSON.parseObject(response); if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() @@ -763,7 +760,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); //请求成功调用叉车追加动作块 - sendAddSequencesToCCAgv(instructionCode, jo.getString("data"), instructionDto); + sendAddSequencesToCCAgv(task_code, jo.getString("data"), instructionDto); return jo.getString("data"); } else { @@ -856,14 +853,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - private String applyXGAgvTask(String instructionCode, Integer actionType, Instruction instructionDto) { + private String applyXGAgvTask(String task_code, Integer actionType, Instruction instructionDto) { try { JSONObject param = new JSONObject(); - param.put("taskCode", instructionCode); + param.put("taskCode", task_code); param.put("actionType", actionType.toString()); LuceneLogDto logDto = LuceneLogDto.builder() .device_code("追加动诺宝作块:") - .content("追加动诺宝作块,参数:" + instructionCode + "--" + actionType) + .content("追加动诺宝作块,参数:" + task_code + "--" + actionType) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -878,7 +875,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { luceneExecuteLogService.deviceExecuteLog(logDto2); if (!ActionTypeEnum.IN_FINISHING.getCode().equals(actionType)) { //请求成功调用诺宝追加动作块 - sendAddSequencesToNBAgv(instructionCode, jo.getString("data"), instructionDto); + sendAddSequencesToNBAgv(task_code, jo.getString("data"), instructionDto); } return jo.getString("data"); @@ -1346,16 +1343,16 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONObject jo9 = new JSONObject(); jo9.put("blockId", IdUtil.simpleUUID()); - jo9.put("location", pointCode + "INPUT"); + jo9.put("location", inst.getNext_device_code() + "INPUT"); jo9.put("operation", "script"); - jo9.put("id", pointCode + "INPUT"); + jo9.put("id", inst.getNext_device_code() + "INPUT"); jo9.put("script_name", "userpy/interact.py"); JSONObject script_args5 = new JSONObject(); script_args5.put("addr", addr); JSONObject data3 = new JSONObject(); JSONObject reach3 = new JSONObject(); reach3.put("task_code", inst.getInstruction_code()); - reach3.put("address", pointCode + "INPUT"); + reach3.put("address", inst.getNext_device_code() + "INPUT"); data3.put("reach", reach3); script_args5.put("data", data3); script_args5.put("protocol", "HTTP"); 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 6dc8e9a3c..903b214f9 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 @@ -327,8 +327,12 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i JSONObject apply = new JSONObject(); apply.put("device_code", device_code); apply.put("vehicle_code", hand_barcode); - - String str = acsToWmsService.applyTaskToWms(apply); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请AGV任务,请求参数:" + apply) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); + String str = acsToWmsService.applySendOutTwo(apply); JSONObject jo = JSON.parseObject(str); LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) @@ -344,12 +348,12 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i map.put("value", 19); list1.add(map); this.writing(list1); - LuceneLogDto logDto = LuceneLogDto.builder() + LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(device_code) .content("申请AGV任务,返回参数:" + jo.getString("body")) .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); requireSucess = true; } return; @@ -401,10 +405,12 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i } public void writing(int command) { + String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.ItemProtocol.item_to_command; Map itemMap = new HashMap(); + itemMap.put(to_command, command); this.control(itemMap); } - @Override public JSONObject getDeviceStatusName() { JSONObject jo = new JSONObject(); 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 26a219819..6759b151e 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 @@ -1,5 +1,6 @@ package org.nl.acs.device_driver.one_conveyor.fold_disc_site; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; @@ -204,7 +205,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements } catch (Exception var17) { var17.printStackTrace(); - feedMessage = var17.getMessage(); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } @@ -385,6 +385,8 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements String route_plan_code = taskdto.getRoute_plan_code(); String next_device_code = ""; + + /** * 开始平均分配 */ @@ -414,6 +416,13 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements if (ObjectUtils.isEmpty(shortPathsList)) { throw new RuntimeException("路由不通!"); } + //判断有没有DDJ对接位出入库的指令 + List byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code); + if (CollUtil.isNotEmpty(byCodeAndExcute)){ + this.message="有DDJ对接位出入库的指令"; + requireSucess = false; + return true; + } Device startdevice = deviceAppservice.findDeviceByCode(start_device_code); Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code); 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 8132f0ff5..f7448e772 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 @@ -1,5 +1,6 @@ package org.nl.acs.device_driver.one_conveyor.scanner_weight_conveyor; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; @@ -25,6 +26,7 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.led.led_screen.LedScreenDeviceDriver; import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO; +import org.nl.acs.device_driver.stacker.standard_stacker.StandardStackerDeviceDriver; import org.nl.acs.enums.StorageTypeEnum; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.history.ErrorUtil; @@ -780,6 +782,13 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv String next_device_code = pathlist.get(start + 1); //判断有无出入库任务是相同路线 + //判断有没有DDJ对接位出入库的指令 + List byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code); + if (CollUtil.isNotEmpty(byCodeAndExcute)){ + this.message="有DDJ对接位出入库的指令"; + requireSucess = false; + return true; + } TaskDto dto = taskserver.findByCodeAndExcute(taskdto.getNext_device_code(), taskdto.getStart_device_code()); if (ObjectUtil.isNotEmpty(dto)) { requireSucess = false; 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 eac1a4d77..01d823f66 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 @@ -292,6 +292,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme * 入库异常错误限制 */ Integer count = 0; + Boolean isonline = true; + + Boolean iserror = false; @Override @@ -363,11 +366,18 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme count = 0; } - + if (mode == 0) { + this.setIsonline(false); + message = "universal_off"; + } else if (error != 0) { + this.setIserror(true); + message = "universal_message3"; + } if (mode != 3 || requireSucess) { message = "one_message7"; } else { if (error != 0) { + Date date = new Date(); if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); @@ -385,10 +395,22 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } break; case 1: + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("取货中") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); message = "universal_delivery"; if (updateCommand("1")) break; break; case 2: + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("取货完成") + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); message = "universal_completed"; if (updateCommand("2")) break; Instruction instruction2 = checkInst(); @@ -432,6 +454,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme requireSucess = false; break; case 3: + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("放货") + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); message = "universal_releasing"; if (updateCommand("3")) break; break; @@ -459,6 +487,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme requireSucess = false; break; case 5: + LuceneLogDto logDto3 = LuceneLogDto.builder() + .device_code(device_code) + .content("放货完成") + .build(); + logDto3.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto3); message = "universal_releasing_completed"; Map map = new HashMap<>(); List list5 = new ArrayList(); @@ -834,7 +868,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme return true; } }else { - message = "不是取货中或者取货完成报警"; + message = "one_message19"; } } //放货中报警 @@ -846,7 +880,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme return true; } }else { - message = "不是放货中报警"; + message = "one_message20"; } } //出库报警 @@ -860,7 +894,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme return true; } }else { - message = "不是取货中或者取货完成报警"; + message = "one_message19"; } //放货中报警 if ("3".equals(instructionErro.getExecute_code()) && forkCargo == 2) { @@ -873,7 +907,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme return true; } }else { - message = "不是放货中报警"; + message = "one_message20"; } } } @@ -1187,6 +1221,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme jo.put("stopReceiveTask", this.stopReceiveTask); jo.put("requireSucess", requireSucess); jo.put("driver_type", "standard_stacker"); + jo.put("isOnline", this.getIsonline()); + jo.put("isError", this.getIserror()); jo.put("notCreateInstMessage", notCreateInstMessage); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java index 52c466b68..b79a45cff 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java @@ -205,4 +205,9 @@ public class CreateTaskRequest extends BaseRequest { * 是否拔轴 0/1 */ private String is_pulling; + + /** + * agv二次分配类型(1、普通任务 2、取货二次分配 3、防货二次分配 4、取放货二次分配) + */ + private Integer agv_action_type; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 62c0e68b2..7ab397e99 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -198,7 +198,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String applySendOutTwo(JSONObject param) { try { MDC.put(log_file_type, log_type); - log.info("applyTaskToWms-----输入参数{}", param); + log.info("applySendOutTwo-----输入参数{}", param); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("applySendOutTwo"); String url = wmsurl + addressDto.getMethods_url(); @@ -210,11 +210,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .execute(); } catch (Exception e) { String msg = e.getMessage(); - log.info("applyTaskToWms-----输出参数{}", msg); + log.info("applySendOutTwo-----输出参数{}", msg); //网络不通 } if(ObjectUtil.isEmpty(result2)){ - log.info("applyTaskToWms-----输出参数{}", "返回结果为空"); + log.info("applySendOutTwo-----输出参数{}", "返回结果为空"); return null; } String type = ""; @@ -223,8 +223,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } else { type = "error"; } - log.info("applyTaskToWms-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()), + log.info("applySendOutTwo-----输出参数{}", result2.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applySendOutTwo", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "二期发货申请任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); @@ -238,7 +238,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String deviceApplyTwo(JSONObject param) { try { MDC.put(log_file_type, log_type); - log.info("applyTaskToWms-----输入参数{}", param); + log.info("deviceApplyTwo-----输入参数{}", param); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("deviceApplyTwo"); String url = wmsurl + addressDto.getMethods_url(); @@ -250,11 +250,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .execute(); } catch (Exception e) { String msg = e.getMessage(); - log.info("applyTaskToWms-----输出参数{}", msg); + log.info("deviceApplyTwo-----输出参数{}", msg); //网络不通 } if(ObjectUtil.isEmpty(result2)){ - log.info("applyTaskToWms-----输出参数{}", "返回结果为空"); + log.info("deviceApplyTwo-----输出参数{}", "返回结果为空"); return null; } String type = ""; @@ -263,8 +263,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } else { type = "error"; } - log.info("applyTaskToWms-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()), + log.info("deviceApplyTwo-----输出参数{}", result2.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"deviceApplyTwo", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "二期发货申请捆扎、贴标"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); @@ -278,7 +278,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String applyTowToOne(JSONObject param) { try { MDC.put(log_file_type, log_type); - log.info("applyTaskToWms-----输入参数{}", param); + log.info("sendProductToFirstFloor-----输入参数{}", param); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("sendProductToFirstFloor"); String url = wmsurl + addressDto.getMethods_url(); @@ -290,11 +290,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .execute(); } catch (Exception e) { String msg = e.getMessage(); - log.info("applyTaskToWms-----输出参数{}", msg); + log.info("sendProductToFirstFloor-----输出参数{}", msg); //网络不通 } if(ObjectUtil.isEmpty(result2)){ - log.info("applyTaskToWms-----输出参数{}", "返回结果为空"); + log.info("sendProductToFirstFloor-----输出参数{}", "返回结果为空"); return null; } String type = ""; @@ -303,8 +303,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } else { type = "error"; } - log.info("applyTaskToWms-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()), + log.info("sendProductToFirstFloor-----输出参数{}", result2.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"sendProductToFirstFloor", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "二期发货申请捆扎、贴标"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); @@ -613,11 +613,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .execute(); } catch (Exception e) { String msg = e.getMessage(); - log.info("applyTaskToWms-----输出参数{}", msg); + log.info("getBoxInfo-----输出参数{}", msg); //网络不通 } if(ObjectUtil.isEmpty(result2)){ - log.info("applyTaskToWms-----输出参数{}", "返回结果为空"); + log.info("getBoxInfo-----输出参数{}", "返回结果为空"); return null; } String type = ""; @@ -626,8 +626,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } else { type = "error"; } - log.info("applyTaskToWms-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()), + log.info("getBoxInfo-----输出参数{}", result2.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"getBoxInfo", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "二期发货申请捆扎、贴标"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); @@ -653,11 +653,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .execute(); } catch (Exception e) { String msg = e.getMessage(); - log.info("applyTaskToWms-----输出参数{}", msg); + log.info("secondaryAllocationPoint-----输出参数{}", msg); //网络不通 } if(ObjectUtil.isEmpty(result2)){ - log.info("applyTaskToWms-----输出参数{}", "返回结果为空"); + log.info("secondaryAllocationPoint-----输出参数{}", "返回结果为空"); return null; } String type = ""; @@ -666,8 +666,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } else { type = "error"; } - log.info("applyTaskToWms-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()), + log.info("secondaryAllocationPoint-----输出参数{}", result2.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"secondaryAllocationPoint", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "二期发货申请捆扎、贴标"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); @@ -766,7 +766,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String applyUpdatePointCode(JSONObject param) { try { MDC.put(log_file_type, log_type); - log.info("applyTaskToWms-----输入参数{}", param); + log.info("deviceApplyExceptional-----输入参数{}", param); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("deviceApplyExceptional"); String url = wmsurl + addressDto.getMethods_url(); @@ -778,11 +778,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .execute(); } catch (Exception e) { String msg = e.getMessage(); - log.info("applyTaskToWms-----输出参数{}", msg); + log.info("deviceApplyExceptional-----输出参数{}", msg); //网络不通 } if (ObjectUtil.isEmpty(result2)) { - log.info("applyTaskToWms-----输出参数{}", "返回结果为空"); + log.info("deviceApplyExceptional-----输出参数{}", "返回结果为空"); return null; } String type = ""; @@ -791,8 +791,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } else { type = "error"; } - log.info("applyTaskToWms-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()), + log.info("deviceApplyExceptional-----输出参数{}", result2.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"deviceApplyExceptional", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "申请更新点位"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 5eb066aff..da1a7265b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -124,6 +124,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { String route_plan_code = request.getRoute_plan_code(); String task_type = request.getTask_type(); String truss_type = request.getTruss_type(); + Integer agv_action_type = request.getAgv_action_type(); String empty_site = request.getEmpty_site(); String is_bushing = request.getIs_bushing(); String is_pulling = request.getIs_pulling(); @@ -333,6 +334,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("start_device_code2", start_device_code2); jo.put("next_device_code2", next_device_code2); jo.put("put_device_code", put_device_code); + jo.put("agv_action_type", agv_action_type); jo.put("priority", priority); jo.put("vehicle_code", vehicle_code); jo.put("vehicle_type", vehicle_type); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 889c69d29..b02067e10 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -411,22 +411,7 @@ public class InstructionServiceImpl extends CommonServiceImpl 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) { Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code()); -// if (StrUtil.equals(task.getRequest_again_success(), "1")) { -// //追加订单 -// HttpResponse result = xiangGongAgvService.addOrderSequences(dto); -// if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) { -// dto.setSend_status("2"); -// } else { -// dto.setSend_status("1"); -// } -// -// } else + if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { String interactionJson = task.getInteraction_json(); if (StrUtil.isEmpty(interactionJson)){ 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 136ee6a86..d473da1c9 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 @@ -568,6 +568,7 @@ public class TaskServiceImpl extends CommonServiceImpl impleme dto.setStart_device_code2(dto.getStart_point_code2()); dto.setNext_device_code2(dto.getNext_point_code2()); + if (StrUtil.isEmpty(dto.getPriority())) { dto.setPriority(CommonFinalParam.ONE); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device.properties index fd1981f89..8eb4b8e22 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device.properties @@ -15,6 +15,8 @@ one_message15=\u7533\u8BF7AGV\u642C\u8FD0\u4EFB\u52A1\u63A5\u53E3\u4E0D\u901A one_message16=\u7533\u8BF7AGV\u642C\u8FD0\u4EFB\u52A1\u6210\u529F one_message17=\u7533\u8BF7AGV\u642C\u8FD0\u4EFB\u52A1\u5931\u8D25 one_message18=\u672A\u627E\u5230\u66F4\u65B0\u7684\u70B9\u4F4D +one_message19=\u4E0A\u4E00\u6761\u52A8\u4F5C\u4E0D\u662F\u53D6\u8D27\u4E2D\u6216\u8005\u53D6\u8D27\u5B8C\u6210\u62A5\u8B66 +one_message20=\u4E0A\u4E00\u6761\u52A8\u4F5C\u4E0D\u662F\u653E\u8D27\u4E2D\u62A5\u8B66 one_mode1=\u7533\u8BF7\u5165\u5E93\u4EFB\u52A1 one_mode2=\u7533\u8BF7\u7A7A\u6258\u76D8\u5165\u5E93 one_mode3=\u7533\u8BF7AGV\u4EFB\u52A1 diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_en_US.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_en_US.properties index 5bc24ec89..73270fa50 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_en_US.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_en_US.properties @@ -15,7 +15,8 @@ one_message15=The interface for applying for a complement to the AGV carrying ta one_message16=Succeeded in applying for the AGV transfer task. Procedure one_message17=Failed to apply for the AGV transfer task. Procedure one_message18=No updated point found - +one_message19=The previous action is not in the process of picking up or picking up the finished alarm +one_message20=The last action was not an alarm during delivery one_mode1=Request a warehouse entry task one_mode2=Request empty pallets for storage one_mode3=Request AGV diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_in_ID.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_in_ID.properties index 80657582d..17ed9cb66 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_in_ID.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_in_ID.properties @@ -15,7 +15,8 @@ one_message15=Permintaan kode tambahan AGV memindahkan antarmuka misi tidak ters one_message16=Minta ijin ke operasi AGV one_message17=Aplikasi bantuan AGV pemindahan gagal one_message18=Titik pembaruan tidak ditemukan - +one_message19=Langkah terakhir bukan untuk mengambil barang atau menggunakannya untuk menyelesaikan alarm +one_message20=Gerakan terakhir adalah tidak menempatkan alarm di kargo one_mode1=Berlaku untuk tugas pustaka one_mode2=Pendaftaran nampan kosong one_mode3=Permintaan AGV diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_zh_CN.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_zh_CN.properties index 3ae3f4d8e..87d3b7bf1 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_zh_CN.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/one_device/one_device_zh_CN.properties @@ -15,7 +15,8 @@ one_message15=\u7533\u8BF7\u8865\u7801AGV\u642C\u8FD0\u4EFB\u52A1\u63A5\u53E3\u4 one_message16=\u7533\u8BF7\u8865\u7801AGV\u642C\u8FD0\u4EFB\u52A1\u6210\u529F one_message17=\u7533\u8BF7\u8865\u7801AGV\u642C\u8FD0\u4EFB\u52A1\u5931\u8D25 one_message18=\u672A\u627E\u5230\u66F4\u65B0\u7684\u70B9\u4F4D - +one_message19=\u4E0A\u4E00\u6761\u52A8\u4F5C\u4E0D\u662F\u53D6\u8D27\u4E2D\u6216\u8005\u53D6\u8D27\u5B8C\u6210\u62A5\u8B66 +one_message20=\u4E0A\u4E00\u6761\u52A8\u4F5C\u4E0D\u662F\u653E\u8D27\u4E2D\u62A5\u8B66 one_mode1=\u7533\u8BF7\u5165\u5E93\u4EFB\u52A1 one_mode2=\u7533\u8BF7\u7A7A\u6258\u76D8\u5165\u5E93 one_mode3=\u7533\u8BF7AGV\u4EFB\u52A1 From e862d69a1613b492f4a040ba01f6eda2b9620850 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Sun, 23 Jun 2024 11:30:51 +0800 Subject: [PATCH 04/40] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E4=BA=8C=E6=A5=BCn?= =?UTF-8?q?dc=E9=A9=B1=E5=8A=A8=E6=97=A5=E5=BF=97=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8B=94=E5=89=8D=E8=A1=8C=E6=9E=B6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 689 +++++++++++++++++- .../StandardStackerDeviceDriver.java | 2 +- .../PullHeadManipulatorDeviceDriver.java | 52 +- .../service/impl/InstructionServiceImpl.java | 6 + .../monitor/universal/universal.properties | 5 +- .../universal/universal_en_US.properties | 5 +- .../universal/universal_in_ID.properties | 5 +- .../universal/universal_zh_CN.properties | 5 +- 8 files changed, 725 insertions(+), 44 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index d122e90d4..e32322f49 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -130,7 +130,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // message = "该指令号未找到对应指令:" + ikey; // logServer.deviceExecuteLog(this.device_code, "", "", "该指令号未找到对应指令:" + ikey); // return; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("当前指令号为:"+ inst.getInstruction_code()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); task = taskService.findByTaskCode(inst.getTask_code()); + }else { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("指令号为空!") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -184,7 +197,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agvphase:" + "反馈:" + data) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } //到达取货点 @@ -220,7 +233,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content(agvaddr + "对应设备号为空") .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); return; } @@ -242,19 +255,40 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic String task_code = standardOrdinarySiteDeviceDriver.getTask_code(); log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code); if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) { - log.info("等待LMS系统进行确认允许取货,设备号{},指令号{},任务号{}", device_code, ikey, task.getTask_code()); - message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; - logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("任务号为空") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { log.info("等待LMS系统进行确认允许取货,设备号{},指令号{}", device_code, ikey); message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -267,10 +301,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() , standardInspectSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -282,9 +328,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); @@ -295,10 +353,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (hongXiangStationDeviceDriver.getMove() > 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -310,10 +380,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); @@ -346,10 +428,28 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; if (roundedNumber == 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if(roundedNumber > -50 || roundedNumber < 50){ data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); }else if(roundedNumber > 50 || roundedNumber < -50){ log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(device_code+"设备,偏移数据超出范围导致未反馈"+ roundedNumber+"指令号"+ ikey) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } }else{ log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey); @@ -363,6 +463,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic map.put("to_command", "2"); wasteFoilWeighingStationDriver.writing(map); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } catch (Exception e) { e.printStackTrace(); } @@ -370,6 +476,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -377,7 +489,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -419,7 +531,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("对应设备号为空" + device_code) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); return; } @@ -439,8 +551,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic && StrUtil.equals(task.getTask_type(), "1")) { standardOrdinarySiteDeviceDriver.setOption(0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } this.setPhase(phase); } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { @@ -453,6 +577,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); @@ -466,10 +596,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (hongXiangStationDeviceDriver.getMove() > 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -481,10 +623,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货完成反馈,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -496,10 +650,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((standardInspectSiteDeviceDriver.getMove() != 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() , standardInspectSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); @@ -510,6 +676,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic map.put("to_command", "3"); wasteFoilWeighingStationDriver.writing(map); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } catch (Exception e) { e.printStackTrace(); } @@ -517,6 +689,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -524,7 +702,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -538,7 +716,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agv地址参数有误,phase:" + phase) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); return; } @@ -582,19 +760,40 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic String task_code = standardOrdinarySiteDeviceDriver.getTask_code(); log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code); if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) { - log.info("等待LMS系统进行确认允许取货,设备号{},指令号{},任务号{}", device_code, ikey, task.getTask_code()); - message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; - logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("任务号为空!") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { log.info("等待LMS系统进行确认允许取货,设备号{},指令号{}", device_code, ikey); message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code()); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -606,9 +805,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(manipulatorAgvStationDeviceDriver.getDevice_code()+"动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -620,10 +831,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); @@ -634,10 +857,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (hongXiangStationDeviceDriver.getMove() > 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -649,10 +884,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() , standardInspectSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); @@ -685,8 +932,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; if (roundedNumber == 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if(roundedNumber > -50 || roundedNumber < 50){ data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); }else if(roundedNumber > 50 || roundedNumber < -50){ log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey); } @@ -699,7 +958,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -715,7 +974,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agv地址参数有误,phase:" + phase) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); return; } @@ -752,11 +1011,24 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic standardOrdinarySiteDeviceDriver.setOption(0); } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); standardOrdinarySiteDeviceDriver.setAgvphase(phase); standardOrdinarySiteDeviceDriver.setIndex(index); standardOrdinarySiteDeviceDriver.setInst(inst); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { @@ -766,10 +1038,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (hongXiangStationDeviceDriver.getMove() == 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -781,9 +1065,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -795,10 +1091,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -810,10 +1118,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() , standardInspectSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); @@ -821,7 +1141,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -842,6 +1162,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (ObjectUtil.isNotEmpty(task)) { logServer.deviceExecuteLog(this.device_code, "", "", "上报满卷重量,weight:" + weight); message = "上报满卷重量,weight:" + weight + ",指令号:" + ikey; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); task.setWeight(String.valueOf(weight)); task.setCarno(this.device_code); taskService.update(task); @@ -851,7 +1177,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -866,7 +1192,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agv地址参数有误,phase:" + phase) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); return; } @@ -898,7 +1224,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); standardOrdinarySiteDeviceDriver.setAgvphase(phase); standardOrdinarySiteDeviceDriver.setIndex(index); standardOrdinarySiteDeviceDriver.setInst(inst); @@ -913,10 +1244,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足放货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -928,9 +1271,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); @@ -941,20 +1296,44 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (hongXiangStationDeviceDriver.getMove() == 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.writing(1); if ((standardInspectSiteDeviceDriver.getMove() == 0 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足放货条件"; log.info("设备{}当前光电信号{},动作信号{} ,报警信号{},不满足放货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() , standardInspectSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); @@ -987,8 +1366,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; if (roundedNumber == 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if(roundedNumber > -50 || roundedNumber < 50){ data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); }else if(roundedNumber > 50 || roundedNumber < -50){ log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey); } @@ -1004,6 +1395,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic map.put("to_command", "4"); wasteFoilWeighingStationDriver.writing(map); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } catch (Exception e) { e.printStackTrace(); } @@ -1011,9 +1408,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } //放货完成 @@ -1027,7 +1436,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agv地址参数有误,phase:" + phase) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); return; } @@ -1056,7 +1465,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic return; } if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); +// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); // if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) // && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString()) // && StrUtil.equals(task.getTask_type(), "1")) { @@ -1072,6 +1481,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); this.setPhase(phase); } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -1083,9 +1498,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); @@ -1096,10 +1523,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (hongXiangStationDeviceDriver.getMove() > 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足放货完成反馈,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -1111,17 +1550,35 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); paperTubePickSiteDeviceDriver.setFlag(3); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.writing(0); if ((standardInspectSiteDeviceDriver.getMove() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); @@ -1132,6 +1589,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic map.put("to_command", "5"); wasteFoilWeighingStationDriver.writing(map); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } catch (Exception e) { e.printStackTrace(); } @@ -1139,9 +1602,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } //到达放货点 @@ -1155,7 +1630,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agv地址参数有误,phase:" + phase) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); return; } @@ -1186,7 +1661,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic String agv_inst_type = inst.getAgv_inst_type(); if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); +// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); // if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) // && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString()) // && StrUtil.equals(task.getTask_type(), "1")) { @@ -1202,6 +1677,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); this.setPhase(phase); } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { @@ -1214,9 +1695,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); @@ -1227,10 +1720,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (hongXiangStationDeviceDriver.getMove() == 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -1242,10 +1747,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); @@ -1278,16 +1795,40 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; if (roundedNumber == 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if(roundedNumber > -50 || roundedNumber < 50){ data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); }else if(roundedNumber > 50 || roundedNumber < -50){ log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("设备"+device_code+"偏移数据超出范围导致未反馈"+roundedNumber+"指令号"+ikey) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } }else{ log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } } @@ -1302,7 +1843,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agv地址参数有误,phase:" + phase) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); return; } @@ -1333,7 +1874,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic String agv_inst_type = inst.getAgv_inst_type(); if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); +// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); // if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) // && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString()) // && StrUtil.equals(task.getTask_type(), "1")) { @@ -1349,6 +1890,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); this.setPhase(phase); } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { @@ -1361,9 +1908,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -1375,10 +1934,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); @@ -1389,13 +1960,31 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (hongXiangStationDeviceDriver.getMove() > 0) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } } @@ -1403,18 +1992,48 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic else if (phase == 0x70) { //x坐标 x = ikey; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "x坐标:" + x) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if (phase == 0x71) { //y坐标 y = ikey; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "y坐标:" + y) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if (phase == 0x72) { //车辆角度 angle = ikey; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "车辆角度:" + angle) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if (phase == 0x73) { //agv电量 electric_qty = ikey; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "agv电量:" + electric_qty) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if (phase == 0x74) { //三色灯状态 status = ikey; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "三色灯状态:" + status) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); if (status != last_status && status != 6 && status != 7) { boolean flag = true; @@ -1441,15 +2060,31 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic last_status = status; } //进入区域(phase值) else if (phase == 0x50) { - + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "自动门开门") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } //离开区域(phase值) else if (phase == 0x51) { - + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "自动门关门") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } //上报异常信息 //(不需要WCS反馈) else if (phase == 0x67) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "异常信息:" + error) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); //故障信息 if (ikey == 0) { this.setErrorInfo(ikey, "0", "正常"); @@ -1482,7 +2117,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) .build(); - logDto.setLog_level(2); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); // if (StrUtil.equals(inst.getAgv_system_type(), "2")) { // TwoNDCSocketConnectionAutoRun.write(data); 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 01d823f66..b7bbb93fe 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 @@ -428,7 +428,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme Pattern compile = Pattern.compile(pattern); Map map = new HashMap<>(); map.put("code", "to_y"); - map.put("value", inst.getTo_z()); + map.put("value", inst.getTo_z() ); list.add(map); if (inst.getTo_x().length() > 1 && !compile.matcher(inst.getTo_x()).matches()) { String substring = inst.getTo_x().substring(1); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index f51d46475..458f27e71 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -293,7 +293,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp this.inst = null; } } - if (requireSucess) { + if (!requireSucess) { remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); @@ -348,17 +348,31 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp Device startPointDevice = deviceAppService.findDeviceByCode(startPoint); if (startPointDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startPointDevice.getDeviceDriver(); - if (plugPullDeviceSiteDeviceDriver.getAction() != 1&&plugPullDeviceSiteDeviceDriver.getAction() != 3) - notCreateInstMessage = "universal_notCreateInstMessage9"; - return false; + if (plugPullDeviceSiteDeviceDriver.getAction() != 1) { + notCreateInstMessage = "universal_notCreateInstMessage12"; + return false; + } } String nextDeviceCode = taskDto.getNext_device_code(); Device device = deviceAppService.findDeviceByCode(nextDeviceCode); if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver(); - if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2&&plugPullDeviceSiteDeviceDriver.getAction() != 3) - notCreateInstMessage = "universal_notCreateInstMessage9"; + String remark = ""; + if (plugPullDeviceSiteDeviceDriver.getMode() != 2) { + remark = "universal_notCreateInstMessage9"; + notCreateInstMessage = remark; return false; + } + if (plugPullDeviceSiteDeviceDriver.getMove() != 0){ + remark = "universal_notCreateInstMessage10"; + notCreateInstMessage = remark; + return false; + } + if (plugPullDeviceSiteDeviceDriver.getAction() != 2){ + remark = "universal_notCreateInstMessage11"; + notCreateInstMessage = remark; + return false; + } } Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code()); String startCode = instruction.getStart_device_code(); @@ -400,17 +414,31 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp Device start_device = deviceAppService.findDeviceByCode(startDeviceCode); if (start_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) start_device.getDeviceDriver(); - if (plugPullDeviceSiteDeviceDriver.getAction() != 1&&plugPullDeviceSiteDeviceDriver.getAction() != 3) - notCreateInstMessage = "universal_notCreateInstMessage9"; + if (plugPullDeviceSiteDeviceDriver.getAction() != 1) { + notCreateInstMessage = "universal_notCreateInstMessage12"; return false; + } } String nextDeviceCode = task.getNext_device_code(); Device next_device = deviceAppService.findDeviceByCode(nextDeviceCode); if (next_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) next_device.getDeviceDriver(); - if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2 || plugPullDeviceSiteDeviceDriver.getAction() != 3) - notCreateInstMessage = "universal_notCreateInstMessage9"; + String remark = ""; + if (plugPullDeviceSiteDeviceDriver.getMode() != 2) { + remark = "universal_notCreateInstMessage9"; + notCreateInstMessage = remark; return false; + } + if (plugPullDeviceSiteDeviceDriver.getMove() != 0){ + remark = "universal_notCreateInstMessage10"; + notCreateInstMessage = remark; + return false; + } + if (plugPullDeviceSiteDeviceDriver.getAction() != 2){ + remark = "universal_notCreateInstMessage11"; + notCreateInstMessage = remark; + return false; + } } String taskId = task.getTask_id(); String taskCode = task.getTask_code(); @@ -458,12 +486,12 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp Device startDevice = deviceAppService.findDeviceByCode(instdto.getStart_device_code()); Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code()); if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { - notCreateInstMessage = "设备:" + startDevice.getDevice_code() + "未设置电气调度号!"; + notCreateInstMessage = "universal_notCreateInstMessage1"; logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException(LangProcess.msg("device_checkAdd", startDevice.getDevice_code())); } if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { - notCreateInstMessage = "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"; + notCreateInstMessage = "universal_notCreateInstMessage1"; logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException(LangProcess.msg("device_checkAdd", nextDevice.getDevice_code())); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index b02067e10..49388677d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -475,6 +475,12 @@ public class InstructionServiceImpl extends CommonServiceImpl Date: Mon, 24 Jun 2024 08:56:54 +0800 Subject: [PATCH 05/40] =?UTF-8?q?fix:=20=E6=97=A5=E5=BF=97bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/acs/agv/AgvWaitUtil.java | 25 +++++++++++++++- .../java/org/nl/acs/agv/QueryAGVStatus.java | 11 +++++++ .../server/impl/XianGongAgvServiceImpl.java | 18 ++++++------ .../BoxManipulatorSiteDeviceDriver.java | 2 +- .../BeltConveyorDeviceDriver.java | 5 +++- .../BlankManipulatorDeviceDriver.java | 2 +- .../DryManipulatorDeviceDriver.java | 2 +- .../OvenGantryManipulatorDeviceDriver.java | 2 +- .../BoxStorageOutConveyorDeviceDriver.java | 2 ++ .../BoxSubvolumesConveyorDeviceDriver.java | 3 +- ...nishedProductOutBindLableDeviceDriver.java | 1 - .../FoldDiscSiteDeviceDriver.java | 1 + ...ConveyorWithScannerWeightDeviceDriver.java | 1 + .../BoxPackageManipulatorDeviceDriver.java | 9 ++++-- .../BoxStorageManipulatorDeviceDriver.java | 9 ++++-- .../ReturnGoodManipulatorDeviceDriver.java | 10 +++++-- ...pedManipulatorManipulatorDeviceDriver.java | 28 ++++++++++++++---- ...TwoManipulatorManipulatorDeviceDriver.java | 10 +++++-- .../StandardStackerDeviceDriver.java | 29 ++++++++++++------- .../OvenGantryManipulatorDeviceDriver.java | 2 +- .../PullHeadManipulatorDeviceDriver.java | 2 +- .../PullTailManipulatorDeviceDriver.java | 2 +- .../wms/service/impl/AcsToWmsServiceImpl.java | 12 ++++---- .../service/InstructionService.java | 8 +++++ .../service/impl/InstructionServiceImpl.java | 24 +++++++++++++++ .../nl/acs/task/enums/AgvActionTypeEnum.java | 2 +- .../org/nl/acs/task/service/TaskService.java | 7 +++++ .../task/service/impl/TaskServiceImpl.java | 9 ++++++ .../controller/logicflow/StageController.java | 1 - .../service/quartz/task/CreateDDJInst.java | 14 ++++++--- .../src/main/resources/logback-spring.xml | 1 + 31 files changed, 197 insertions(+), 57 deletions(-) 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 c5f1965ba..6932d31d8 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 @@ -18,6 +18,8 @@ import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.task.enums.AgvSystemTypeEnum; import org.nl.common.exception.BadRequestException; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @@ -41,6 +43,9 @@ public class AgvWaitUtil { @Autowired private DeviceAppService deviceAppService; + @Autowired + private LuceneExecuteLogService luceneExecuteLogService; + //取货前等待 public JSONObject waitInGet(String startDeviceCode, Instruction inst) { log.info("仙工AGV请求取货,设备号 - {}", startDeviceCode); @@ -52,7 +57,13 @@ public class AgvWaitUtil { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); manipulatorAgvStationDeviceDriver.writing(2); if(manipulatorAgvStationDeviceDriver.getAction() != 1){ - throw new BadRequestException("上位系统不允许取货"); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("agv诺宝对接位行架不允许取货:" + inst.getCarno()+ "点位号"+ manipulatorAgvStationDeviceDriver.getDevice_code()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + throw new BadRequestException("行架不允许取货"); } } @@ -60,6 +71,12 @@ public class AgvWaitUtil { if(startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver){ boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) startDevice.getDeviceDriver(); if(boxSubvolumesConveyorDeviceDriver.getMode() != 2){ + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("agv叉车对接位输送线不允许取货:" + inst.getCarno()+ "点位号"+ boxSubvolumesConveyorDeviceDriver.getDevice_code()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); throw new BadRequestException("上位系统不允许取货"); } } @@ -98,6 +115,12 @@ public class AgvWaitUtil { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) endDevice.getDeviceDriver(); manipulatorAgvStationDeviceDriver.writing(2); if(manipulatorAgvStationDeviceDriver.getAction() != 1){ + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("agv诺宝对接位行架不允许放货:" + inst.getCarno()+ "点位号"+ manipulatorAgvStationDeviceDriver.getDevice_code()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", endDevice); throw new BadRequestException("上位系统不允许取货"); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/QueryAGVStatus.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/QueryAGVStatus.java index a754c6ce6..b30688d40 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/QueryAGVStatus.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/QueryAGVStatus.java @@ -13,7 +13,10 @@ import lombok.extern.slf4j.Slf4j; import org.nl.acs.AcsConfig; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.task.domain.Task; import org.nl.acs.task.enums.AgvSystemTypeEnum; +import org.nl.acs.task.service.TaskService; +import org.nl.acs.task.service.dto.TaskDto; import org.nl.config.SpringContextHolder; import org.nl.system.service.param.ISysParamService; import org.springframework.stereotype.Component; @@ -30,6 +33,7 @@ public class QueryAGVStatus { public void run() { InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); + TaskService taskService = SpringContextHolder.getBean(TaskService.class); ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class); List allInstFromCache = instructionService.findAllInstFromCache(); List agvInstruction = allInstFromCache.stream().filter(item -> AgvSystemTypeEnum.One_NDC_System_Type.getIndex().equals(item.getAgv_system_type()) || AgvSystemTypeEnum.XG_System_Type.getIndex().equals(item.getAgv_system_type())).collect(Collectors.toList()); @@ -59,9 +63,16 @@ public class QueryAGVStatus { // 等待=WAITING //执行中 String state = json.getString("state"); + String carNo = json.getString("vehicle"); if ("RUNNING".equals(state) || "CREATED".equals(state) || "TOBEDISPATCHED".equals(state) || "WAITING".equals(state)) { instruction.setInstruction_status("1"); + instruction.setCarno(carNo); + TaskDto task = new TaskDto(); instructionService.update(instruction); + task.setCarno(carNo); + task.setTask_id(instruction.getTask_id()); + instructionService.update(instruction); + taskService.update(task); } else if ("FINISHED".equals(state)) { instruction.setInstruction_status("2"); try { 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 2104b71a8..233224d81 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 @@ -745,7 +745,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONObject param = new JSONObject(); param.put("task_code", task_code); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code("追加动叉车作块:") + .device_code(instructionDto.getCarno()) .content("追加动叉车作块,参数:" + task_code ) .build(); logDto.setLog_level(4); @@ -754,7 +754,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONObject jo = JSON.parseObject(response); if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() - .device_code("追加动叉车作块:") + .device_code(instructionDto.getCarno()) .content("追加动叉车作块,参数,接口返回:" + jo) .build(); logDto2.setLog_level(4); @@ -765,7 +765,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } else { LuceneLogDto logDto2 = LuceneLogDto.builder() - .device_code("追加动叉车作块:") + .device_code(instructionDto.getCarno()) .content("追加动叉车作块失败,返回参数:" + jo.getString("body")) .build(); logDto2.setLog_level(4); @@ -859,7 +859,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { param.put("taskCode", task_code); param.put("actionType", actionType.toString()); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code("追加动诺宝作块:") + .device_code(instructionDto.getCarno()) .content("追加动诺宝作块,参数:" + task_code + "--" + actionType) .build(); logDto.setLog_level(4); @@ -868,7 +868,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONObject jo = JSON.parseObject(response); if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() - .device_code("追加动诺宝作块:") + .device_code(instructionDto.getCarno()) .content("追加动诺宝作块,参数,接口返回:" + jo) .build(); logDto2.setLog_level(4); @@ -881,7 +881,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } else { LuceneLogDto logDto2 = LuceneLogDto.builder() - .device_code("追加动诺宝作块:") + .device_code(instructionDto.getCarno()) .content("追加动诺宝作块失败,返回参数:" + jo.getString("body")) .build(); logDto2.setLog_level(4); @@ -1343,16 +1343,16 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONObject jo9 = new JSONObject(); jo9.put("blockId", IdUtil.simpleUUID()); - jo9.put("location", inst.getNext_device_code() + "INPUT"); + jo9.put("location", inst.getNext_device_code()); jo9.put("operation", "script"); - jo9.put("id", inst.getNext_device_code() + "INPUT"); + jo9.put("id", inst.getNext_device_code()); jo9.put("script_name", "userpy/interact.py"); JSONObject script_args5 = new JSONObject(); script_args5.put("addr", addr); JSONObject data3 = new JSONObject(); JSONObject reach3 = new JSONObject(); reach3.put("task_code", inst.getInstruction_code()); - reach3.put("address", inst.getNext_device_code() + "INPUT"); + reach3.put("address", inst.getNext_device_code()); data3.put("reach", reach3); script_args5.put("data", data3); script_args5.put("protocol", "HTTP"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/box_manipulator_site/BoxManipulatorSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/box_manipulator_site/BoxManipulatorSiteDeviceDriver.java index 2f13780ec..626608dea 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/box_manipulator_site/BoxManipulatorSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/box_manipulator_site/BoxManipulatorSiteDeviceDriver.java @@ -240,7 +240,7 @@ public class BoxManipulatorSiteDeviceDriver extends AbstractOpcDeviceDriver impl } catch (Exception var17) { var17.printStackTrace(); - feedMessage = var17.getMessage(); + // feedMessage = var17.getMessage(); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } 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 04a1f0b95..f66eb5572 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 @@ -209,6 +209,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements JSONObject led_message = null; + @Override public Device getDevice() { return this.device; @@ -237,12 +238,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) { requireSucess = false; clearWrite(); } if (move != 0 && task > 0) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; CompletableFuture.runAsync(() -> { // 异步更新指令状态 try { @@ -826,6 +828,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements jo.put("requireSucess", requireSucess); jo.put("hand_barcode", hand_barcode); jo.put("materiel", material_barcode); + jo.put("inst_message", this.inst_message); jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/BlankManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/BlankManipulatorDeviceDriver.java index d7ad1df74..86cf129a7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/BlankManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/BlankManipulatorDeviceDriver.java @@ -229,7 +229,7 @@ // // } catch (Exception var17) { // var17.printStackTrace(); -// feedMessage = var17.getMessage(); +// // feedMessage = var17.getMessage(); // logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.standardItemProtocol)); // // } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/DryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/DryManipulatorDeviceDriver.java index 3f92e2a9f..770827595 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/DryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/DryManipulatorDeviceDriver.java @@ -228,7 +228,7 @@ // // } catch (Exception var17) { // var17.printStackTrace(); -// feedMessage = var17.getMessage(); +// // feedMessage = var17.getMessage(); // logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.standardItemProtocol)); // // } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/OvenGantryManipulatorDeviceDriver.java index 994fadc57..5238059e9 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -234,7 +234,7 @@ // // } catch (Exception var17) { // var17.printStackTrace(); -// feedMessage = var17.getMessage(); +// // feedMessage = var17.getMessage(); // logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.standardItemProtocol)); // // } 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 593383cda..62f16ae9a 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 @@ -167,6 +167,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i String vehicle_code; String last_vehicle_code; + @Override public Device getDevice() { return this.device; @@ -199,6 +200,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i } if (move != 0 && task > 0) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; update_instruction_status(); } } catch (Exception var17) { 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 903b214f9..f32a4dcb8 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 @@ -196,7 +196,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } if (move != 0 && task > 0) { - + inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); update_instruction_status(); } } catch (Exception var17) { @@ -737,7 +737,6 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i this.instruction_update_time = date; inst = checkInst(); if (inst != null) { - inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); vehicle_code = inst.getVehicle_code(); task_code = inst.getTask_code(); if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java index ad2dbc819..01ee64eb8 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java @@ -199,7 +199,6 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr if (move != 0 && task > 0) { - update_instruction_status(); } 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 6759b151e..ead7b4e15 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 @@ -680,6 +680,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements jo.put("notCreateTaskMessage", notCreateTaskMessage); jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); jo.put("feedMessage", LangProcess.msg(feedMessage)); + jo.put("inst_message", this.inst_message); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); return jo; 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 f7448e772..3dee61a78 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 @@ -1026,6 +1026,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "conveyor_with_scanner_weight"); jo.put("is_click", true); + jo.put("inst_message", this.inst_message); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java index b437e7dd3..d367fbd0e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java @@ -43,6 +43,7 @@ import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; import java.util.*; +import java.util.stream.Collectors; /** * 装箱智能行架 @@ -86,6 +87,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i // y坐标 float y = 0.0f; float last_y = 0.0f; + String inst_message; int heartbeat = 0; int last_heartbeat = 0; @@ -188,6 +190,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } // 更新指令状态 if (mode == 3 && task > 0) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; updateInstrction(); } @@ -336,8 +339,9 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i String startDeviceCode = getDeviceCodeList.get(i); //先查指令 List taskDtoInstruction = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode); - if (CollUtil.isNotEmpty(taskDtoInstruction)){ - TaskDto taskDtoIns = taskDtoInstruction.get(0); + List taskDtoStream = taskDtoInstruction.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(taskDtoStream)) { + TaskDto taskDtoIns = taskDtoStream.get(0); if (TaskTypeEnum.Truss_Task.getIndex().equals(taskDtoIns.getTask_type())) { Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDtoIns.getTask_code()); String interactionJson = taskDtoIns.getInteraction_json(); @@ -644,6 +648,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("is_click", true); jo.put("x", x); jo.put("y", y); + jo.put("inst_message", this.inst_message); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java index 805c7e618..800ce85a7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java @@ -46,6 +46,7 @@ import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; import java.util.*; +import java.util.stream.Collectors; /** * 木箱入库行架 @@ -106,6 +107,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int branchProtocol = 0; private String error_type = "hxhj_error_type"; + String inst_message; //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 int flag; @@ -158,6 +160,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } // 更新指令状态 if (mode == 3 && task > 0 && !requireActionSucess) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; updateInstructionStatus(); } @@ -302,8 +305,9 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i String startDeviceCode = getDeviceCodeList.get(i); //先查指令 List taskDtoInstruction = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode); - if (CollUtil.isNotEmpty(taskDtoInstruction)) { - TaskDto taskDtoIns = taskDtoInstruction.get(0); + List taskDtoStream = taskDtoInstruction.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(taskDtoStream)) { + TaskDto taskDtoIns = taskDtoStream.get(0); if (TaskTypeEnum.Truss_Task.getIndex().equals(taskDtoIns.getTask_type())) { Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDtoIns.getTask_code()); String interactionJson = taskDtoIns.getInteraction_json(); @@ -596,6 +600,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "box_storage_manipulator"); jo.put("is_click", true); + jo.put("inst_message", this.inst_message); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java index c0f1da0ba..719a5dc77 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java @@ -47,6 +47,7 @@ import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; import java.util.*; +import java.util.stream.Collectors; /** * 退货入库行架 @@ -141,6 +142,7 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i List getDeviceCodeList = null; List putDeviceCodeList = null; + String inst_message; @Override @@ -171,6 +173,8 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i // 更新指令状态 if (mode == 3 && task > 0) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; + updateInstructionStatus(); } @@ -319,8 +323,9 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i String startDeviceCode = getDeviceCodeList.get(i); //先查指令 List taskDtoInstruction = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode); - if (CollUtil.isNotEmpty(taskDtoInstruction)) { - TaskDto taskDtoIns = taskDtoInstruction.get(0); + List taskDtoStream = taskDtoInstruction.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(taskDtoStream)) { + TaskDto taskDtoIns = taskDtoStream.get(0); if (TaskTypeEnum.Truss_Task.getIndex().equals(taskDtoIns.getTask_type())) { Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDtoIns.getTask_code()); String interactionJson = taskDtoIns.getInteraction_json(); @@ -610,6 +615,7 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); + jo.put("inst_message", this.inst_message); return jo; } 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 54ad24ca5..e07988161 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 @@ -42,6 +42,8 @@ import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; /** * 捆扎智能行架 @@ -130,6 +132,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice String notCreateTaskMessage = ""; String notCreateInstMessage = ""; String feedMessage = ""; + String inst_message; List getDeviceCodeList = null; @@ -165,12 +168,14 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice } // 更新指令状态 if (mode == 3 && task > 0) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; + updateInstructionStatus(); } } catch (Exception var17) { var17.printStackTrace(); - feedMessage = var17.getMessage(); + // feedMessage = var17.getMessage(); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } @@ -311,8 +316,9 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice String startDeviceCode = getDeviceCodeList.get(i); //先查指令 List taskDtoInstruction = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode); - if (CollUtil.isNotEmpty(taskDtoInstruction)) { - TaskDto taskDtoIns = taskDtoInstruction.get(0); + List taskDtoStream = taskDtoInstruction.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(taskDtoStream)) { + TaskDto taskDtoIns = taskDtoStream.get(0); if (TaskTypeEnum.Truss_Task.getIndex().equals(taskDtoIns.getTask_type())) { Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDtoIns.getTask_code()); String interactionJson = taskDtoIns.getInteraction_json(); @@ -353,8 +359,19 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice return true; } } else { - TaskDto taskDto = taskserver.findByStartCodeAndReady(startDeviceCode); - if (ObjectUtil.isNotEmpty(taskDto) && TaskTypeEnum.Truss_Task.getIndex().equals(taskDto.getTask_type())) { + List taskDtos = taskserver.findByTrappedManipulatorReady(); + List taskDtosReady = new ArrayList<>(); + TaskDto taskDto = new TaskDto(); + for (TaskDto taskDto1 : taskDtos) { + if (getDeviceCodeList.contains(taskDto1.getStart_device_code())){ + taskDtosReady.add(taskDto1); + } + } + if (CollUtil.isNotEmpty(taskDtosReady)) { + List taskDtoList = taskDtosReady.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + taskDto = taskDtoList.get(0); + } + if (ObjectUtil.isNotEmpty(taskDto)) { String interactionJson = taskDto.getInteraction_json(); InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class); String start_device_code = taskDto.getStart_device_code(); @@ -624,6 +641,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); + jo.put("inst_message", this.inst_message); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java index ab3919106..855d074fe 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java @@ -46,6 +46,7 @@ import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; import java.util.*; +import java.util.stream.Collectors; /** * 捆扎智能行架 @@ -151,6 +152,7 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi List getDeviceCodeList = null; List putDeviceCodeList = null; + String inst_message; @Override @@ -185,6 +187,8 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi } // 更新指令状态 if (mode == 3 && task > 0) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; + updateInstructionStatus(); } @@ -335,8 +339,9 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi String startDeviceCode = getDeviceCodeList.get(i); //先查指令 List taskDtoInstruction = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode); - if (CollUtil.isNotEmpty(taskDtoInstruction)) { - TaskDto taskDtoIns = taskDtoInstruction.get(0); + List taskDtoStream = taskDtoInstruction.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(taskDtoStream)) { + TaskDto taskDtoIns = taskDtoStream.get(0); if (TaskTypeEnum.Truss_Task.getIndex().equals(taskDtoIns.getTask_type())) { Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDtoIns.getTask_code()); String start_device_code = taskDtoIns.getStart_device_code(); @@ -641,6 +646,7 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); + jo.put("inst_message", this.inst_message); return jo; } 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 01d823f66..f2b21b375 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 @@ -343,7 +343,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } else { this.instruction_update_time = date; //更改指令状态 - if (task > 0) { + if (task > 0 && !Objects.equals(command, last_command)) { Instruction inst = checkInst(); if (inst != null) { if (StrUtil.equals(inst.getInstruction_status(), "0")) { @@ -363,28 +363,27 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme //不同任务限制清零 if (!Objects.equals(task, last_task)) { + this.isonline=true; count = 0; } if (mode == 0) { this.setIsonline(false); message = "universal_off"; - } else if (error != 0) { + }else { + this.setIsonline(true); + } + if (error != 0) { this.setIserror(true); message = "universal_message3"; + } else { + this.setIserror(false); } if (mode != 3 || requireSucess) { message = "one_message7"; } else { if (error != 0) { - - Date date = new Date(); - if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); - } else { - //满入空出或者浅货位阻挡 - erroBlock(); - } + erroBlock(); } List list = new ArrayList(); switch (command) { @@ -402,6 +401,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); message = "universal_delivery"; + if (updateCommand("1")) break; break; case 2: @@ -592,6 +592,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } instruction0.setExecute_message(string); instructionService.update(instruction0); + } private static void packageDevicePoint(Device nextDevice, List list) { @@ -690,7 +691,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { - Instruction instruction = instructionService.findByCode(String.valueOf(task)); + Instruction instruction = instructionService.findByDeviceCodeRunFromCache(String.valueOf(task)); if (ObjectUtil.isEmpty(instruction)) { message = "one_message9"; return; @@ -699,6 +700,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme param.put("task_code", instruction.getTask_code()); param.put("task_id", instruction.getTask_id()); param.put("type", type); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请更新点位,参数:" + param) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); String response = acsToWmsService.applyUpdatePointCode(param); JSONObject jo = JSON.parseObject(response); if (StrUtil.isNotEmpty(jo.getString("body")) || jo.getInteger("status") == 200) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 2a64e05da..40f1d5f91 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -198,7 +198,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } catch (Exception var17) { var17.printStackTrace(); - feedMessage = var17.getMessage(); + // feedMessage = var17.getMessage(); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index f51d46475..c6cf5c904 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -249,7 +249,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp } catch (Exception var17) { var17.printStackTrace(); - feedMessage = var17.getMessage(); + // feedMessage = var17.getMessage(); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java index 9b61c7145..b431a83b5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java @@ -274,7 +274,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp } catch (Exception var17) { var17.printStackTrace(); - feedMessage = var17.getMessage(); + // feedMessage = var17.getMessage(); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 7ab397e99..772d5ca7d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -601,7 +601,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String getBoxInfo(JSONObject param) { try { MDC.put(log_file_type, log_type); - log.info("applyTaskToWms-----输入参数{}", param); + log.info("getBoxInfo-----输入参数{}", param); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("getBoxInfo"); String url = wmsurl + addressDto.getMethods_url(); @@ -766,7 +766,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String applyUpdatePointCode(JSONObject param) { try { MDC.put(log_file_type, log_type); - log.info("deviceApplyExceptional-----输入参数{}", param); + log.info("applyUpdatePointCode-----输入参数{}", param); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("deviceApplyExceptional"); String url = wmsurl + addressDto.getMethods_url(); @@ -778,11 +778,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .execute(); } catch (Exception e) { String msg = e.getMessage(); - log.info("deviceApplyExceptional-----输出参数{}", msg); + log.info("applyUpdatePointCode-----输出参数{}", msg); //网络不通 } if (ObjectUtil.isEmpty(result2)) { - log.info("deviceApplyExceptional-----输出参数{}", "返回结果为空"); + log.info("applyUpdatePointCode-----输出参数{}", "返回结果为空"); return null; } String type = ""; @@ -791,8 +791,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } else { type = "error"; } - log.info("deviceApplyExceptional-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"deviceApplyExceptional", String.valueOf(result2.getStatus()), + log.info("applyUpdatePointCode-----输出参数{}", result2.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyUpdatePointCode", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "申请更新点位"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java index 4a8087ef1..11ff78c0a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -342,6 +342,14 @@ public interface InstructionService extends CommonService { */ Instruction findByStartCodeAndReady(String device_code); + /** + * 根据起点设备编号查询当前是否有运行的指令 + * + * @param device_code + * @return + */ + Instruction findByDeviceCodeRunFromCache(String device_code); + /** * 根据终点设备编号查询当前是否有就绪指令 * diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index b02067e10..70b97622e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -1536,6 +1536,30 @@ public class InstructionServiceImpl extends CommonServiceImpl instructionList = instructions; + ListUtil.sort( + instructionList, + new Comparator() { + @Override + public int compare(Instruction o1, Instruction o2) { + return o1.getCreate_time().compareTo(o2.getCreate_time()); + } + }); + Iterator it = instructions.iterator(); + while (it.hasNext()) { + Instruction inst = it.next(); + if (StrUtil.equals(devicecode, inst.getStart_device_code()) + && inst.getInstruction_status().equals(InstructionStatusEnum.BUSY.getIndex())) { + return inst; + } + } + + return null; + } + + @Override public Instruction findByNextDeviceCodeFromCache(String devicecode) { List instructionList = instructions; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvActionTypeEnum.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvActionTypeEnum.java index 67b408a90..e90538944 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvActionTypeEnum.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvActionTypeEnum.java @@ -19,7 +19,7 @@ public enum AgvActionTypeEnum { /** * 防货二次分配 */ - OUT_STOCK(3, "防货二次分配"), + OUT_STOCK(3, "放货二次分配"), /** * 取放货二次分配 */ diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java index f671b0cb9..5a12daba4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java @@ -390,6 +390,13 @@ public interface TaskService extends CommonService { TaskDto findByStartCodeAndReady(String device_code); + /** + * 查找符合条件的堆叠行架任务 + * @return + */ + List findByTrappedManipulatorReady(); + + /** * 根据起载具号查询就绪任务 * 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 d473da1c9..351af73e0 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 @@ -1107,6 +1107,15 @@ public class TaskServiceImpl extends CommonServiceImpl impleme return optionalTask.orElse(null); } + @Override + public List findByTrappedManipulatorReady() { + //根据时间升序取第一个 + List taskDtoList = tasks.stream() + .filter(task -> StrUtil.equals(task.getTask_type(), TaskTypeEnum.Truss_Task.getIndex()) + && StrUtil.equals(task.getTask_status(), TaskStatusEnum.READY.getIndex())).collect(Collectors.toList()); + return taskDtoList; + } + @Override public TaskDto findByVehicleCodeCodeAndReady(String vehicleCode) { Optional optionalTask = tasks.stream() diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/logicflow/StageController.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/logicflow/StageController.java index 23635f2d6..80df9b2b8 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/logicflow/StageController.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/logicflow/StageController.java @@ -82,7 +82,6 @@ public class StageController { } @PostMapping("/getNewStageDataByCode") - @Log("根据stage_code获取舞台数据") public ResponseEntity getNewStageDataByCode(@RequestBody String code) { Stage one = stageService.getOne(new LambdaQueryWrapper().eq(Stage::getStage_code, code)); return new ResponseEntity<>(one, HttpStatus.CREATED); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java index 094b822ce..7f1daef29 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java @@ -57,10 +57,10 @@ public class CreateDDJInst { String next_device_code = taskDto.getNext_device_code(); Device nextDevice = appService.findDeviceByCode(next_device_code); //判断有无出入库任务是相同路线 - TaskDto dto = taskserver.findByCodeAndExcute(next_device_code, start_device_code); - if (ObjectUtil.isNotEmpty(dto)) { - continue; - } +// TaskDto dto = taskserver.findByCodeAndExcute(next_device_code, start_device_code); +// if (ObjectUtil.isNotEmpty(dto)) { +// continue; +// } if (startDevice.getDevice_type().equals(DeviceType.storage.name()) && (nextDevice.getDevice_type().equals(DeviceType.conveyor.name()) || nextDevice.getDevice_type().equals(DeviceType.storage.name()))) { taskDtoList.add(taskDto); @@ -316,6 +316,12 @@ public class CreateDDJInst { String count = deviceByCode.getExtraValue().get("count").toString(); if (StrUtil.isNotEmpty(count)) { if (max <= Integer.parseInt(count)) { + //判断有没有DDJ对接位出入库的指令 + List byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code); + if (CollUtil.isNotEmpty(byCodeAndExcute)){ + ((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位出入库的指令"); + continue; + } instdto.setInstruction_type(task_type); instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setRoute_plan_code(route_plan_code); diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml index a357d9c8a..158891bd8 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml @@ -22,6 +22,7 @@ https://juejin.cn/post/6844903775631572999 + From 4422f305a479585d43178b6c37a886664f670090 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Mon, 24 Jun 2024 08:59:30 +0800 Subject: [PATCH 06/40] =?UTF-8?q?add:=20=E5=BD=93=E5=89=8D=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acs2/nladmin-ui/src/views/system/monitor/device/index.vue | 3 +++ 1 file changed, 3 insertions(+) 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 a8780fd56..920ba2fd1 100644 --- a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue @@ -757,6 +757,9 @@ export default { } else if (val === 'material_barcode') { const obj = { name: '子卷编号', value: data[val] } this.arr.push(obj) + } else if (val === 'inst_message') { + const obj = { name: '当前指令信息', value: data[val] } + this.arr.push(obj) } } } From 8134ecbe964b6b69ff4b4c562cd3a432293408ca Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Mon, 24 Jun 2024 11:12:42 +0800 Subject: [PATCH 07/40] =?UTF-8?q?fix:=20bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../belt_conveyor/BeltConveyorDeviceDriver.java | 4 +++- .../BoxStorageOutConveyorDeviceDriver.java | 5 +++-- .../BoxSubvolumesConveyorDeviceDriver.java | 16 +++++++++++++--- .../BoxPackageManipulatorDeviceDriver.java | 4 +++- .../BoxStorageManipulatorDeviceDriver.java | 4 +++- .../ReturnGoodManipulatorDeviceDriver.java | 5 +++-- ...rappedManipulatorManipulatorDeviceDriver.java | 13 ++++++++----- ...umeTwoManipulatorManipulatorDeviceDriver.java | 5 +++-- 8 files changed, 39 insertions(+), 17 deletions(-) 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 f66eb5572..b71c2b5eb 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 @@ -244,7 +244,9 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } if (move != 0 && task > 0) { - inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; + if (null!=inst) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); + } CompletableFuture.runAsync(() -> { // 异步更新指令状态 try { 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 62f16ae9a..671bd2e86 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 @@ -200,8 +200,9 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i } if (move != 0 && task > 0) { - inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; - update_instruction_status(); + if (null!=inst) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); + } update_instruction_status(); } } catch (Exception var17) { var17.printStackTrace(); 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 f32a4dcb8..88b5365b2 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 @@ -196,8 +196,9 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } if (move != 0 && task > 0) { - inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); - update_instruction_status(); + if (null!=inst) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); + } update_instruction_status(); } } catch (Exception var17) { var17.printStackTrace(); @@ -363,11 +364,20 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i apply.put("vehicle_code", material_barcode); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请AGV任务,请求参数:" + apply) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); String str = acsToWmsService.applySendOutTwo(apply); logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数"); JSONObject jo = JSON.parseObject(str); - + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请AGV任务,参数,接口返回:" + jo) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto2); message = "申请AGV任务,参数,接口返回:" + jo; if (jo.getInteger("status") == 200) { List list = new ArrayList(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java index d367fbd0e..c608b2a05 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java @@ -190,7 +190,9 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } // 更新指令状态 if (mode == 3 && task > 0) { - inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; + if (null!=inst) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); + } updateInstrction(); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java index 800ce85a7..866f2ec9a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java @@ -160,7 +160,9 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } // 更新指令状态 if (mode == 3 && task > 0 && !requireActionSucess) { - inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; + if (null!=inst) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); + } updateInstructionStatus(); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java index 719a5dc77..2a4e902d2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java @@ -173,8 +173,9 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i // 更新指令状态 if (mode == 3 && task > 0) { - inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; - + if (null!=inst) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); + } updateInstructionStatus(); } 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 e07988161..435dced02 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 @@ -168,8 +168,9 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice } // 更新指令状态 if (mode == 3 && task > 0) { - inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; - + if (null!=inst) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); + } updateInstructionStatus(); } @@ -362,9 +363,11 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice List taskDtos = taskserver.findByTrappedManipulatorReady(); List taskDtosReady = new ArrayList<>(); TaskDto taskDto = new TaskDto(); - for (TaskDto taskDto1 : taskDtos) { - if (getDeviceCodeList.contains(taskDto1.getStart_device_code())){ - taskDtosReady.add(taskDto1); + if (CollUtil.isNotEmpty(taskDtos)) { + for (TaskDto taskDto1 : taskDtos) { + if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) { + taskDtosReady.add(taskDto1); + } } } if (CollUtil.isNotEmpty(taskDtosReady)) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java index 855d074fe..c67a73278 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java @@ -187,8 +187,9 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi } // 更新指令状态 if (mode == 3 && task > 0) { - inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() ; - + if (null!=inst) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); + } updateInstructionStatus(); } From eaefddd34dbb0277b896fc3a2443bf386b06305d Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Mon, 24 Jun 2024 11:20:43 +0800 Subject: [PATCH 08/40] =?UTF-8?q?rev:=E7=8E=B0=E5=9C=BA=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BoxStorageOutConveyorDeviceDriver.java | 1 - .../PlugPullDeviceSiteDeviceDriver.java | 100 ++++--- .../PullHeadManipulatorDeviceDriver.java | 277 +++++++++--------- .../org/nl/acs/task/service/TaskService.java | 1 + .../task/service/impl/TaskServiceImpl.java | 10 + 5 files changed, 209 insertions(+), 180 deletions(-) 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 671bd2e86..1de443dc8 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 @@ -220,7 +220,6 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i message = "脱机"; //有报警 - } else { this.setIsonline(true); this.setIserror(false); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 663811ffd..58eee3133 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -217,7 +217,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl //有报警 } else if (error != 0) { this.setIserror(true); - message ="universal_message3"; + message = "universal_message3"; //无报警 } else { this.setIsonline(true); @@ -306,7 +306,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl } else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(device_code+"当前mode值为:" + mode) + .content(device_code + "当前mode值为:" + mode) .build(); logDto.setLog_level(2); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -321,44 +321,54 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请贴标成功:" + applyPlugPullSitResponse.getData()) + .content("申请套管成功:" + applyPlugPullSitResponse.getData()) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); Map data = applyPlugPullSitResponse.getData(); - String number = data.get("number"); - String leftSize = data.get("leftSize"); - String rightSize = data.get("rightSize"); - //套管1物料 - String to_material1 = data.get("left"); - //套管2物料 - String to_material2 = data.get("right"); - //套管1规格 - String to_spec1 = data.get("leftSpec"); - //套管2规格 - String to_spec2 = data.get("rightSpec"); - Map map = new LinkedHashMap<>(); - //下发纸管信息 + String is_bushing = data.get("is_bushing"); + if (StrUtil.equals("1", is_bushing)) { + String number = data.get("number"); + String leftSize = data.get("leftSize"); + String rightSize = data.get("rightSize"); + //套管1物料 + String to_material1 = data.get("left"); + //套管2物料 + String to_material2 = data.get("right"); + //套管1规格 + String to_spec1 = data.get("leftSpec"); + //套管2规格 + String to_spec2 = data.get("rightSpec"); + Map map = new LinkedHashMap<>(); + //下发纸管信息 - map.put("to_material1", to_material1); - map.put("to_material2", to_material2); + map.put("to_material1", to_material1); + map.put("to_material2", to_material2); - if (StrUtil.isNotEmpty(leftSize)) { - map.put("to_size1", leftSize); + if (StrUtil.isNotEmpty(leftSize)) { + map.put("to_size1", leftSize); + } + if (StrUtil.isNotEmpty(rightSize)) { + map.put("to_size2", rightSize); + } + map.put("to_spec1", to_spec1); + if (ObjectUtil.isNotEmpty(to_spec2)) { + map.put("to_spec2", to_spec2); + } + map.put("to_command", mode); + map.put("to_qty1", number); + this.writing(map); + requireSucess = true; + logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse); + message = "申请套管成功"; + } else { + Map map = new LinkedHashMap<>(); + map.put("to_command", 98); + this.writing(map); + requireSucess = true; + message = "不申请套管"; + logServer.deviceExecuteLog(this.device_code, "", "", "不申请套管反馈,返回参数:" + applyPlugPullSitResponse); } - if (StrUtil.isNotEmpty(rightSize)) { - map.put("to_size2", rightSize); - } - map.put("to_spec1", to_spec1); - if (ObjectUtil.isNotEmpty(to_spec2)) { - map.put("to_spec2", to_spec2); - } - map.put("to_command", mode); - map.put("to_qty1", number); - this.writing(map); - requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse); - message = "申请套管成功"; } else { message = applyPlugPullSitResponse.getMessage(); Map map = new LinkedHashMap<>(); @@ -382,7 +392,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl } else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(device_code+"当前mode值为:" + mode) + .content(device_code + "当前mode值为:" + mode) .build(); logDto.setLog_level(2); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -398,6 +408,12 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_TWO); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请套管成功:" + applyPlugPullSitResponse.getData()) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); this.writeSignal(mode); logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse); message = "套管完成成功"; @@ -425,7 +441,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl } else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(device_code+"当前mode值为:" + mode) + .content(device_code + "当前mode值为:" + mode) .build(); logDto.setLog_level(2); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -466,7 +482,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl } else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(device_code+"当前mode值为:" + mode) + .content(device_code + "当前mode值为:" + mode) .build(); logDto.setLog_level(2); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -535,7 +551,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl } else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(device_code+"当前mode值为:" + mode) + .content(device_code + "当前mode值为:" + mode) .build(); logDto.setLog_level(2); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -661,15 +677,15 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { mode = LangProcess.msg("universal_operation"); - } else if(this.mode == 4) { + } else if (this.mode == 4) { mode = "请求套轴轴"; - } else if(this.mode == 5){ + } else if (this.mode == 5) { mode = "套轴完成反馈"; - } else if(this.mode == 6){ + } else if (this.mode == 6) { mode = "请求拔轴"; - } else if(this.mode == 7){ + } else if (this.mode == 7) { mode = "拔轴完成反馈"; - } else if(this.mode == 8){ + } else if (this.mode == 8) { mode = "缓存库已满,申请行架任务"; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index 8cb6fcab7..e7ff78364 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -35,6 +35,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.impl.RouteLineServiceImpl; import org.nl.acs.task.enums.TaskStatusEnum; +import org.nl.acs.task.enums.TaskTypeEnum; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.common.exception.BadRequestException; @@ -46,6 +47,7 @@ import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; import java.util.*; +import java.util.stream.Collectors; /** @@ -293,7 +295,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp this.inst = null; } } - if (!requireSucess) { + if (requireSucess) { remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); @@ -339,178 +341,179 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver; for (int i = 0; i < getDeviceCodeList.size(); i++) { String startDeviceCode = getDeviceCodeList.get(i); - List taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode); + //先查指令 + List taskDtos = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode); if (ObjectUtil.isNotEmpty(taskDtos)) { - //按照优先级排序 优先级相等按照创建时间排序 - taskDtos = this.sortTask(taskDtos); - TaskDto taskDto = taskDtos.get(0); - String startPoint = task.getStart_device_code(); - Device startPointDevice = deviceAppService.findDeviceByCode(startPoint); - if (startPointDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { - plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startPointDevice.getDeviceDriver(); + List taskDtoStream = taskDtos.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + if (ObjectUtil.isNotEmpty(taskDtoStream)) { + TaskDto taskDto = taskDtos.get(0); + if (TaskTypeEnum.Truss_Task.getIndex().equals(taskDto.getTask_type())) { + String startPoint = taskDto.getStart_device_code(); + Device startPointDevice = deviceAppService.findDeviceByCode(startPoint); + if (startPointDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { + plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startPointDevice.getDeviceDriver(); + if (plugPullDeviceSiteDeviceDriver.getAction() != 1) { + notCreateInstMessage = "universal_notCreateInstMessage9"; + continue; + } + } + String nextDeviceCode = taskDto.getNext_device_code(); + Device device = deviceAppService.findDeviceByCode(nextDeviceCode); + if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { + plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver(); + if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2) { + notCreateInstMessage = "universal_notCreateInstMessage9"; + continue; + } + } + Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code()); + String startCode = instruction.getStart_device_code(); + String nextCode = instruction.getNext_device_code(); + instruction.setInstruction_status(InstructionStatusEnum.BUSY.getIndex()); + instruction.setUpdate_time(DateUtil.now()); + instructionService.update(instruction); + Device startDevice = deviceAppService.findDeviceByCode(startCode); + Device nextDevice = deviceAppService.findDeviceByCode(nextCode); + if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { + notCreateInstMessage = "universal_notCreateInstMessage1"; + throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); + } + if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { + notCreateInstMessage = "universal_notCreateInstMessage1"; + throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); + } + String startAddr = startDevice.getExtraValue().get("address").toString(); + String nextAddr = nextDevice.getExtraValue().get("address").toString(); + String interaction_json = taskDto.getInteraction_json(); + Map map = toStringObjectMap(instruction, startAddr, nextAddr, interaction_json); + this.writing(map); + this.setRequireSucess(true); + return true; + } + } else { + List taskDtoList = taskserver.findByTrappedManipulatorReady(); + if (ObjectUtil.isNotEmpty(taskDtoList)) { + List taskDtosReady = new ArrayList<>(); + for (TaskDto taskDto1 : taskDtoList) { + if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) { + taskDtosReady.add(taskDto1); + } + } + //按照优先级排序 优先级相等按照创建时间排序 + taskDtosReady = this.sortTask(taskDtosReady); + task = taskDtosReady.get(0); + } + if (ObjectUtil.isNotEmpty(task)) { + break; + } + } + } + if (!ObjectUtil.isEmpty(task)) { + String firstDeviceCode = task.getStart_device_code(); + Device start_device = deviceAppService.findDeviceByCode(firstDeviceCode); + if (start_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { + plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) start_device.getDeviceDriver(); if (plugPullDeviceSiteDeviceDriver.getAction() != 1) { notCreateInstMessage = "universal_notCreateInstMessage12"; return false; } } - String nextDeviceCode = taskDto.getNext_device_code(); - Device device = deviceAppService.findDeviceByCode(nextDeviceCode); - if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { - plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver(); + String nextDeviceCode = task.getNext_device_code(); + Device next_device = deviceAppService.findDeviceByCode(nextDeviceCode); + if (next_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { + plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) next_device.getDeviceDriver(); String remark = ""; if (plugPullDeviceSiteDeviceDriver.getMode() != 2) { remark = "universal_notCreateInstMessage9"; notCreateInstMessage = remark; return false; } - if (plugPullDeviceSiteDeviceDriver.getMove() != 0){ - remark = "universal_notCreateInstMessage10"; + if (plugPullDeviceSiteDeviceDriver.getMove() != 0) { + remark = "universal_notCreateInstMessage9"; notCreateInstMessage = remark; return false; } - if (plugPullDeviceSiteDeviceDriver.getAction() != 2){ + if (plugPullDeviceSiteDeviceDriver.getAction() != 2) { remark = "universal_notCreateInstMessage11"; notCreateInstMessage = remark; return false; } } - Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code()); - String startCode = instruction.getStart_device_code(); - String nextCode = instruction.getNext_device_code(); - instruction.setInstruction_status(InstructionStatusEnum.BUSY.getIndex()); - instruction.setUpdate_time(DateUtil.now()); - instructionService.update(instruction); - Device startDevice = deviceAppService.findDeviceByCode(startCode); - Device nextDevice = deviceAppService.findDeviceByCode(nextCode); + String taskId = task.getTask_id(); + String taskCode = task.getTask_code(); + String vehicleCode = task.getVehicle_code(); + String priority = task.getPriority(); + String startPointCode = task.getStart_point_code(); + String routePlanCode = task.getRoute_plan_code(); + String nextPointCode = task.getNext_point_code(); + + Instruction instdto = new Instruction(); + instdto.setInstruction_id(IdUtil.simpleUUID()); + instdto.setRoute_plan_code(routePlanCode); + instdto.setRemark(task.getRemark()); + instdto.setMaterial(task.getMaterial()); + instdto.setQuantity(task.getQuantity()); + instdto.setTask_id(taskId); + instdto.setTask_code(taskCode); + instdto.setVehicle_code(vehicleCode); + String now = DateUtil.now(); + instdto.setCreate_time(now); + instdto.setCreate_by(SecurityUtils.getCurrentNickName()); + instdto.setStart_device_code(firstDeviceCode); + instdto.setNext_device_code(nextDeviceCode); + instdto.setStart_point_code(startPointCode); + instdto.setNext_point_code(nextPointCode); + instdto.setPriority(priority); + instdto.setInstruction_status(InstructionStatusEnum.READY.getIndex()); + instdto.setExecute_device_code(startPointCode); + + try { + instructionService.create(instdto); + } catch (Exception e) { + notCreateInstMessage = e.getMessage(); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(device_code + "创建指令时出现异常:" + e.getMessage()) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); + return false; + } + //创建指令后修改任务状态 + task.setTask_status(TaskStatusEnum.BUSY.getIndex()); + task.setUpdate_time(DateUtil.now()); + taskserver.update(task); + + Device startDevice = deviceAppService.findDeviceByCode(instdto.getStart_device_code()); + Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code()); if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { notCreateInstMessage = "universal_notCreateInstMessage1"; - throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); + throw new BadRequestException(LangProcess.msg("device_checkAdd", startDevice.getDevice_code())); } if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { notCreateInstMessage = "universal_notCreateInstMessage1"; - throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); + throw new BadRequestException(LangProcess.msg("device_checkAdd", nextDevice.getDevice_code())); + } String startAddr = startDevice.getExtraValue().get("address").toString(); String nextAddr = nextDevice.getExtraValue().get("address").toString(); - String interaction_json = taskDto.getInteraction_json(); - Map map = toStringObjectMap(instruction, startAddr, nextAddr, interaction_json); + String interaction_json = task.getInteraction_json(); + Map map = toStringObjectMap(instdto, startAddr, nextAddr, interaction_json); this.writing(map); this.setRequireSucess(true); - return true; + notCreateInstMessage = ""; + notCreateTaskMessage = ""; } else { - List taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); - if (ObjectUtil.isNotEmpty(taskDtoList)) { - //按照优先级排序 优先级相等按照创建时间排序 - taskDtoList = this.sortTask(taskDtoList); - task = taskDtoList.get(0); - } - if (ObjectUtil.isNotEmpty(task)) { - break; - } + notCreateInstMessage = "universal_notCreateInstMessage"; } + return true; } - if (!ObjectUtil.isEmpty(task)) { - String startDeviceCode = task.getStart_device_code(); - Device start_device = deviceAppService.findDeviceByCode(startDeviceCode); - if (start_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { - plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) start_device.getDeviceDriver(); - if (plugPullDeviceSiteDeviceDriver.getAction() != 1) { - notCreateInstMessage = "universal_notCreateInstMessage12"; - return false; - } - } - String nextDeviceCode = task.getNext_device_code(); - Device next_device = deviceAppService.findDeviceByCode(nextDeviceCode); - if (next_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { - plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) next_device.getDeviceDriver(); - String remark = ""; - if (plugPullDeviceSiteDeviceDriver.getMode() != 2) { - remark = "universal_notCreateInstMessage9"; - notCreateInstMessage = remark; - return false; - } - if (plugPullDeviceSiteDeviceDriver.getMove() != 0){ - remark = "universal_notCreateInstMessage10"; - notCreateInstMessage = remark; - return false; - } - if (plugPullDeviceSiteDeviceDriver.getAction() != 2){ - remark = "universal_notCreateInstMessage11"; - notCreateInstMessage = remark; - return false; - } - } - String taskId = task.getTask_id(); - String taskCode = task.getTask_code(); - String vehicleCode = task.getVehicle_code(); - String priority = task.getPriority(); - String startPointCode = task.getStart_point_code(); - String routePlanCode = task.getRoute_plan_code(); - String nextPointCode = task.getNext_point_code(); - - Instruction instdto = new Instruction(); - instdto.setInstruction_id(IdUtil.simpleUUID()); - instdto.setRoute_plan_code(routePlanCode); - instdto.setRemark(task.getRemark()); - instdto.setMaterial(task.getMaterial()); - instdto.setQuantity(task.getQuantity()); - instdto.setTask_id(taskId); - instdto.setTask_code(taskCode); - instdto.setVehicle_code(vehicleCode); - String now = DateUtil.now(); - instdto.setCreate_time(now); - instdto.setCreate_by(SecurityUtils.getCurrentNickName()); - instdto.setStart_device_code(startDeviceCode); - instdto.setNext_device_code(nextDeviceCode); - instdto.setStart_point_code(startPointCode); - instdto.setNext_point_code(nextPointCode); - instdto.setPriority(priority); - instdto.setInstruction_status(InstructionStatusEnum.READY.getIndex()); - instdto.setExecute_device_code(startPointCode); - - try { - instructionService.create(instdto); - } catch (Exception e) { - notCreateInstMessage = e.getMessage(); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(device_code+"创建指令时出现异常:" + e.getMessage()) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); return false; - } - //创建指令后修改任务状态 - task.setTask_status(TaskStatusEnum.BUSY.getIndex()); - task.setUpdate_time(DateUtil.now()); - taskserver.update(task); - - Device startDevice = deviceAppService.findDeviceByCode(instdto.getStart_device_code()); - Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code()); - if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { - notCreateInstMessage = "universal_notCreateInstMessage1"; - logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); - throw new BadRequestException(LangProcess.msg("device_checkAdd", startDevice.getDevice_code())); - } - if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { - notCreateInstMessage = "universal_notCreateInstMessage1"; - logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); - throw new BadRequestException(LangProcess.msg("device_checkAdd", nextDevice.getDevice_code())); - - } - String startAddr = startDevice.getExtraValue().get("address").toString(); - String nextAddr = nextDevice.getExtraValue().get("address").toString(); - String interaction_json = task.getInteraction_json(); - Map map = toStringObjectMap(instdto, startAddr, nextAddr, interaction_json); - this.writing(map); - this.setRequireSucess(true); - notCreateInstMessage = ""; - notCreateTaskMessage = ""; - } else { - notCreateInstMessage = "universal_notCreateInstMessage"; - } - return true; } + return true; } + @NotNull private Map toStringObjectMap(Instruction instdto, String startAddr, String nextAddr, String interaction_json) { Map map = new LinkedHashMap<>(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java index 5a12daba4..73a3e12ac 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java @@ -537,4 +537,5 @@ public interface TaskService extends CommonService { */ TaskDto findByTaskCode(String task_code); + List queryAllHJReadyTask(); } 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 351af73e0..8fc6f238e 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 @@ -1598,6 +1598,16 @@ public class TaskServiceImpl extends CommonServiceImpl impleme return null; } + @Override + public List queryAllHJReadyTask() { + return Optional + .ofNullable(this.tasks) + .orElse(new CopyOnWriteArrayList<>()) + .stream() + .filter(taskDto -> StrUtil.equals(taskDto.getTask_type(), TaskTypeEnum.Truss_Task.getIndex()) + && StrUtil.equals(taskDto.getTask_status(), TaskStatusEnum.READY.getIndex())) + .collect(Collectors.toList()); + } /** From 595d426c15bcd4c6587552e5040444578560805e Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Mon, 24 Jun 2024 11:25:18 +0800 Subject: [PATCH 09/40] =?UTF-8?q?rev=EF=BC=9A=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pull_head_manipulator/PullHeadManipulatorDeviceDriver.java | 1 - 1 file changed, 1 deletion(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index e7ff78364..0ed5dcc38 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -466,7 +466,6 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp instdto.setPriority(priority); instdto.setInstruction_status(InstructionStatusEnum.READY.getIndex()); instdto.setExecute_device_code(startPointCode); - try { instructionService.create(instdto); } catch (Exception e) { From 507a440b1e5b6a1a447b84797820152b43bdbd1f Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Mon, 24 Jun 2024 13:14:08 +0800 Subject: [PATCH 10/40] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=8B=94=E5=89=8D?= =?UTF-8?q?=E8=A1=8C=E6=9E=B6=E4=BB=BB=E5=8A=A1=E4=B8=8B=E5=8F=91=E5=87=BA?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pull_head_manipulator/PullHeadManipulatorDeviceDriver.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index 0ed5dcc38..20be7c2f3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -390,6 +390,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp this.setRequireSucess(true); return true; } + } } else { List taskDtoList = taskserver.findByTrappedManipulatorReady(); if (ObjectUtil.isNotEmpty(taskDtoList)) { @@ -509,8 +510,6 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp return true; } } - return true; - } @NotNull From 4439cc63137437a6c8547e2218f7f9409e7d99fd Mon Sep 17 00:00:00 2001 From: yanps Date: Mon, 24 Jun 2024 14:01:58 +0800 Subject: [PATCH 11/40] =?UTF-8?q?opt:=20=E8=A1=8C=E6=9E=B6-agv=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E4=BD=8D=E4=BC=98=E5=8C=96=E5=86=99=E5=85=A5=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManipulatorAgvStationDeviceDriver.java | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java index bd883b46c..8cb62f565 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java @@ -1,5 +1,6 @@ package org.nl.acs.device_driver.two_conveyor.manipulator_agv_station; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; @@ -25,6 +26,8 @@ import org.nl.acs.route.service.impl.RouteLineServiceImpl; import org.nl.acs.task.service.TaskService; 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; import org.springframework.beans.factory.annotation.Autowired; import java.util.Date; @@ -54,6 +57,8 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i @Autowired DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); + private Date instruction_require_time = new Date(); private Date instruction_finished_time = new Date(); private Date instruction_apply_time = new Date(); @@ -168,6 +173,39 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i } + + public void writing(List list) { + + Map itemMap = new HashMap(); + for (int i = 0; i < list.size(); i++) { + Object ob = list.get(i); + JSONObject json = (JSONObject) JSONObject.toJSON(ob); + if (!StrUtil.isEmpty(json.getString("value"))) { + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + json.getString("code"); + itemMap.put(to_param, json.getString("value")); + } + } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发电气信号:" + itemMap) + .build(); + logDto.setLog_level(3); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); + try { + this.checkcontrol(itemMap); + } catch (Exception e) { + e.printStackTrace(); + try { + this.checkcontrol(itemMap); + } catch (Exception e1) { + e1.printStackTrace(); + } + } + + } + protected void thingToNothing() { this.setRequireSucess(false); } @@ -175,11 +213,24 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i public void writing(int command) { String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + "." + org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.ItemProtocol.item_to_command; - //String opcservcerid = this.getDevice().getOpc_server_id(); -//Server server = ReadUtil.getServer(opcservcerid); Map itemMap = new HashMap(); itemMap.put(to_command, command); - this.control(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发电气信号:" + itemMap) + .build(); + logDto.setLog_level(3); + luceneExecuteLogService.deviceExecuteLog(logDto); + try { + this.checkcontrol(itemMap); + } catch (Exception e) { + e.printStackTrace(); + try { + this.checkcontrol(itemMap); + } catch (Exception e1) { + e1.printStackTrace(); + } + } } @Override From 036f38c00eba3203fe6872e999d2152420d2639f Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Tue, 25 Jun 2024 14:55:40 +0800 Subject: [PATCH 12/40] =?UTF-8?q?fix:=20=E8=AF=BA=E5=AE=9D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/acs/agv/AgvWaitUtil.java | 15 +++++- .../server/impl/XianGongAgvServiceImpl.java | 50 ++++++++++++++----- ...pedManipulatorManipulatorDeviceDriver.java | 2 +- .../StandardStackerDeviceDriver.java | 4 +- 4 files changed, 56 insertions(+), 15 deletions(-) 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 6932d31d8..91e8ef9e6 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 @@ -94,11 +94,17 @@ public class AgvWaitUtil { instructionService.update(inst); //如果是叉车,取货完成给输送线完成信号 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(inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())){ + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); + manipulatorAgvStationDeviceDriver.writing(3); + + } JSONObject map = new JSONObject(); map.put("status", 200); map.put("message", "允许离开!"); @@ -113,7 +119,7 @@ public class AgvWaitUtil { ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; if(endDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver){ manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) endDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(2); + manipulatorAgvStationDeviceDriver.writing(4); if(manipulatorAgvStationDeviceDriver.getAction() != 1){ LuceneLogDto logDto = LuceneLogDto.builder() .device_code(inst.getCarno()) @@ -135,6 +141,13 @@ public class AgvWaitUtil { //放货完成等待 public JSONObject waitOutPut(String endDeviceCode, Instruction inst) { + 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); + + } log.info("仙工AGV放货完成后请求离开,设备号 - {}", endDeviceCode); inst.setExecute_status("2"); instructionService.update(inst); 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 233224d81..9b86dd80b 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 @@ -695,8 +695,9 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (StrUtil.isBlank(address)) { throw new BadRequestException("请求失败,地址为空!"); } - if (address.contains("IN")) { + if (address.contains("IN") || address.contains("WAITE")) { String task_code = instructionDto.getTask_code(); + String instructionCode = instructionDto.getInstruction_code(); String deviceCodeNow = address.substring(0, address.length() - 5); if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) { throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!"); @@ -707,19 +708,45 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { 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("取货分配新的点位为空"); + } } } return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); - } else if (address.contains("PUT")) { + } else if (address.contains("PUT") || address.contains("WAITE")) { if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { //如果是放货二次分配,取放货二次分配需要重新追加动作块 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("防货分配新的点位为空"); + } } } else if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { - deviceCodeNow = applyCCAgvTask(task_code, instructionDto); + if (ObjectUtil.isEmpty(deviceCodeNow)) { + JSONObject map = new JSONObject(); + map.put("status", 200); + map.put("message", "允许放货!"); + log.info("允许仙工AGV放货,设备号 - {}", deviceCodeNow); + return map; + } } return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); } @@ -746,7 +773,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { param.put("task_code", task_code); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动叉车作块,参数:" + task_code ) + .content("追加动叉车作块,参数:" + task_code) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -760,7 +787,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); //请求成功调用叉车追加动作块 - sendAddSequencesToCCAgv(task_code, jo.getString("data"), instructionDto); + sendAddSequencesToCCAgv(instructionDto.getInstruction_code(), jo.getString("data"), instructionDto); return jo.getString("data"); } else { @@ -792,7 +819,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - log.info("任务号:{},指令号{},追加诺宝运单:{}", instructionCode, instructionCode, jo); + log.info("任务号:{},指令号{},追加诺宝叉车运单:{}", instructionCode, instructionCode, jo); if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) { String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); @@ -808,8 +835,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { .timeout(20000) .execute(); LuceneLogDto logDto1 = LuceneLogDto.builder() - .device_code("叉车运单响应") - .content("指令号:" + instructionCode + ",下发追加诺宝运单反馈参数:" + jo) + .device_code("叉车追加运单响应") + .content("指令号:" + instructionCode + ",下发追加诺宝叉车运单反馈参数:" + jo) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto1); @@ -901,7 +928,6 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject(); jo.put("id", inst.getInstruction_code()); //运单封口,true=创建运单之后不可添加动作块;false=创建运单可以添加动作块 - //运单封口,true=创建运单之后不可添加动作块;false=创建运单可以添加动作块 if (AgvActionTypeEnum.ORDINARY.getCode().equals(inst.getAgv_action_type())) { jo.put("complete", true); } else { @@ -1343,16 +1369,16 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONObject jo9 = new JSONObject(); jo9.put("blockId", IdUtil.simpleUUID()); - jo9.put("location", inst.getNext_device_code()); + jo9.put("location", inst.getNext_device_code() + "WAITE"); jo9.put("operation", "script"); - jo9.put("id", inst.getNext_device_code()); + jo9.put("id", inst.getNext_device_code() + "WAITE"); jo9.put("script_name", "userpy/interact.py"); JSONObject script_args5 = new JSONObject(); script_args5.put("addr", addr); JSONObject data3 = new JSONObject(); JSONObject reach3 = new JSONObject(); reach3.put("task_code", inst.getInstruction_code()); - reach3.put("address", inst.getNext_device_code()); + reach3.put("address", inst.getNext_device_code() + "WAITE"); data3.put("reach", reach3); script_args5.put("data", data3); script_args5.put("protocol", "HTTP"); 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 435dced02..1956493ce 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 @@ -362,7 +362,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice } else { List taskDtos = taskserver.findByTrappedManipulatorReady(); List taskDtosReady = new ArrayList<>(); - TaskDto taskDto = new TaskDto(); + TaskDto taskDto = null; if (CollUtil.isNotEmpty(taskDtos)) { for (TaskDto taskDto1 : taskDtos) { if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) { 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 ed0339816..66ecbe5ec 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 @@ -691,7 +691,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { - Instruction instruction = instructionService.findByDeviceCodeRunFromCache(String.valueOf(task)); + Instruction instruction = checkInst(); if (ObjectUtil.isEmpty(instruction)) { message = "one_message9"; return; @@ -718,6 +718,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); + this.message = "申请更新点位,参数,接口返回:" + jo; String poinCode = jo.getString("point_code"); String vehicleCode = jo.getString("vehicle_code"); if (StrUtil.isNotEmpty(poinCode)) { @@ -761,6 +762,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); + this.message = "申请更新点位,参数,接口返回:" + jo; } } } From a52386ddcbd0eb3d788922401bf776f67f5b1404 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Tue, 25 Jun 2024 14:58:37 +0800 Subject: [PATCH 13/40] =?UTF-8?q?fix:=20=E8=AF=BA=E5=AE=9D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9b86dd80b..3ed8d46ce 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 @@ -740,7 +740,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } else if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { deviceCodeNow = applyCCAgvTask(task_code, instructionDto); - if (ObjectUtil.isEmpty(deviceCodeNow)) { + if (StrUtil.isNotEmpty(deviceCodeNow)) { JSONObject map = new JSONObject(); map.put("status", 200); map.put("message", "允许放货!"); From 18cc9ccb611c22e1b39878950f89feca5fad4462 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Tue, 25 Jun 2024 14:59:13 +0800 Subject: [PATCH 14/40] =?UTF-8?q?fix:=20=E8=AF=BA=E5=AE=9D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 3ed8d46ce..26fbd3f67 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 @@ -746,6 +746,13 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { map.put("message", "允许放货!"); log.info("允许仙工AGV放货,设备号 - {}", deviceCodeNow); return map; + } else { + LuceneLogDto logDto = LuceneLogDto.builder() + .content("防货分配新的点位为空") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + throw new BadRequestException("防货分配新的点位为空"); } } return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); From 968e2540a6110b5d20a4197a4d8c55aa69ef2ede Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Tue, 25 Jun 2024 15:13:13 +0800 Subject: [PATCH 15/40] =?UTF-8?q?fix:=20=E5=A0=86=E5=9E=9B=E6=9C=BAcommand?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardStackerDeviceDriver.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 66ecbe5ec..93b818581 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 @@ -507,9 +507,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme String start_device_code = errorInst.getStart_device_code(); Device startDevice = deviceAppService.findDeviceByCode(start_device_code); List listError = new ArrayList(); - pakageCommand(listError, "1", errorInst.getInstruction_code()); + pakageCommand(listError , errorInst.getInstruction_code()); if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name()) && !prohibitOutWarehouse) { - pakagePlc(errorInst, listError); + pakagePlc(errorInst, listError,"1"); } if (ObjectUtil.isNotEmpty(listError)) { this.writing(listError); @@ -995,10 +995,10 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } } List list = new ArrayList(); - pakageCommand(list, "1", inst.getInstruction_code()); + pakageCommand(list, inst.getInstruction_code()); packagePlcCoordinate(startDevice, list); if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name()) && !prohibitOutWarehouse) { - pakagePlc(inst, list); + pakagePlc(inst, list,"1"); } if (ObjectUtil.isNotEmpty(list)) { this.writing(list); @@ -1033,7 +1033,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } - private void pakagePlc(Instruction inst, List list) { + private void pakagePlc(Instruction inst, List list, String toCommand) { HashMap map4 = new HashMap(); map4.put("code", "to_y"); map4.put("value", inst.getFrom_z()); @@ -1054,17 +1054,17 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme map7.put("code", "to_x"); map7.put("value", inst.getFrom_y()); list.add(map7); - } - - 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()); - list.add(map1); HashMap map2 = new HashMap(); map2.put("code", "to_command"); map2.put("value", toCommand); list.add(map2); + } + + private void pakageCommand(List list, String inst) { + HashMap map1 = new HashMap(); + map1.put("code", "to_device_code"); + map1.put("value", this.getDevice().getAddress()); + list.add(map1); HashMap map3 = new HashMap(); map3.put("code", "to_task"); map3.put("value", inst); From a0a7240975de5d34b90f7b76650cdafa019e8607 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Wed, 26 Jun 2024 10:31:34 +0800 Subject: [PATCH 16/40] =?UTF-8?q?fix:=20=E5=A0=86=E5=9E=9B=E6=9C=BAcommand?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/acs/agv/AgvWaitUtil.java | 47 ++++++++- .../server/impl/XianGongAgvServiceImpl.java | 96 ++++++++++++------- .../BeltConveyorDeviceDriver.java | 8 ++ .../StandardStackerDeviceDriver.java | 10 +- .../service/impl/InstructionServiceImpl.java | 16 ++-- .../nl/acs/task/enums/AgvSystemTypeEnum.java | 3 + 6 files changed, 129 insertions(+), 51 deletions(-) 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 91e8ef9e6..9a70c32bc 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 @@ -1,21 +1,17 @@ package org.nl.acs.agv; -import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.device.domain.Device; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.one_conveyor.box_subvolumes_conveyor.BoxSubvolumesConveyorDeviceDriver; -import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.BoxStorageManipulatorDeviceDriver; import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.task.enums.ActionTypeEnum; import org.nl.acs.task.enums.AgvSystemTypeEnum; import org.nl.common.exception.BadRequestException; import org.nl.config.lucene.service.LuceneExecuteLogService; @@ -80,6 +76,12 @@ 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", "允许取货!"); @@ -101,6 +103,7 @@ public class AgvWaitUtil { boxSubvolumesConveyorDeviceDriver.writing(3); } if(inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())){ + applyLmsGetOut(inst); manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); manipulatorAgvStationDeviceDriver.writing(3); @@ -112,6 +115,40 @@ public class AgvWaitUtil { return map; } + private void applyLmsGetOut(Instruction inst) { + try { + JSONObject param = new JSONObject(); + param.put("taskCode", inst.getTask_code()); + param.put("actionType", ActionTypeEnum.IN_FINISHING.getCode().toString()); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("诺宝取货完成:" + inst.getTask_code() + "--" + ActionTypeEnum.IN_FINISHING.getCode().toString()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + String response = acsToWmsService.secondaryAllocationPoint(param); + JSONObject jo = JSON.parseObject(response); + if (jo.getInteger("status") == 200) { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("追加动诺宝作块,参数,接口返回:" + jo) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + } else { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("追加动诺宝作块失败,返回参数:" + jo.getString("body")) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + throw new BadRequestException("追加动诺宝作块返回失败"); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + //放货前等待 public JSONObject waitInPut(String endDeviceCode, Instruction inst) { 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 26fbd3f67..9ba83d160 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 @@ -336,10 +336,18 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { //动作块id jo.put("blockId", IdUtil.simpleUUID()); //目的地名称 - jo.put("location", pointCode + "INGET"); + if (AgvActionTypeEnum.IN_STOCK.getCode().equals(agv_action_type) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(agv_action_type)) { + jo.put("location", pointCode + "WAIT"); + } else { + jo.put("location", pointCode + "INGET"); + } //执行脚本 jo.put("operation", "script"); - jo.put("id", pointCode + "INGET"); + if (AgvActionTypeEnum.IN_STOCK.getCode().equals(agv_action_type) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(agv_action_type)) { + jo.put("id", pointCode + "WAIT"); + } else { + jo.put("id", pointCode + "INGET"); + } //通信脚本,动作前后与现场设备交互的场景 jo.put("script_name", "userpy/interact.py"); JSONObject script_args = new JSONObject(); @@ -348,7 +356,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONObject data = new JSONObject(); JSONObject reach = new JSONObject(); reach.put("task_code", instCode); - reach.put("address", pointCode + "INGET"); + if (AgvActionTypeEnum.IN_STOCK.getCode().equals(agv_action_type) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(agv_action_type)) { + reach.put("address", pointCode + "WAIT"); + } else { + reach.put("address", pointCode + "INGET"); + } data.put("reach", reach); script_args.put("data", data); script_args.put("protocol", "HTTP"); @@ -403,16 +415,28 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { //放货前等待 JSONObject jo3 = new JSONObject(); jo3.put("blockId", IdUtil.simpleUUID()); - jo3.put("location", pointCode + "INPUT"); + if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(agv_action_type) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(agv_action_type)) { + jo3.put("location", pointCode + "WAIT"); + } else { + jo3.put("location", pointCode + "INPUT"); + } jo3.put("operation", "script"); - jo3.put("id", pointCode + "INPUT"); + if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(agv_action_type) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(agv_action_type)) { + jo3.put("id", pointCode + "WAIT"); + } else { + jo3.put("id", pointCode + "INPUT"); + } jo3.put("script_name", "userpy/interact.py"); JSONObject script_args3 = new JSONObject(); script_args3.put("addr", addr); JSONObject data3 = new JSONObject(); JSONObject reach3 = new JSONObject(); reach3.put("task_code", instCode); - reach3.put("address", pointCode + "INPUT"); + if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(agv_action_type) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(agv_action_type)) { + reach3.put("address", pointCode + "WAIT"); + } else { + reach3.put("address", pointCode + "INPUT"); + } data3.put("reach", reach3); script_args3.put("data", data3); script_args3.put("protocol", "HTTP"); @@ -695,14 +719,18 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (StrUtil.isBlank(address)) { throw new BadRequestException("请求失败,地址为空!"); } - if (address.contains("IN") || address.contains("WAITE")) { + if (address.contains("IN") || address.contains("WAIT")) { String task_code = instructionDto.getTask_code(); - String instructionCode = instructionDto.getInstruction_code(); - String deviceCodeNow = address.substring(0, address.length() - 5); + String deviceCodeNow; + if (address.contains("WAIT")) { + deviceCodeNow = address.substring(0, address.length() - 4); + } else { + deviceCodeNow = address.substring(0, address.length() - 5); + } if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) { throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!"); } - if (address.contains("GET")) { + if (address.contains("GET") || address.contains("WAIT")) { if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { //如果是取货二次分配,取放货二次分配需要重新追加动作块 if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { @@ -721,7 +749,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); - } else if (address.contains("PUT") || address.contains("WAITE")) { + } else if (address.contains("PUT") || address.contains("WAIT")) { if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { //如果是放货二次分配,取放货二次分配需要重新追加动作块 if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { @@ -909,7 +937,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { luceneExecuteLogService.deviceExecuteLog(logDto2); if (!ActionTypeEnum.IN_FINISHING.getCode().equals(actionType)) { //请求成功调用诺宝追加动作块 - sendAddSequencesToNBAgv(task_code, jo.getString("data"), instructionDto); + sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), jo.getString("data"), instructionDto); } return jo.getString("data"); @@ -1019,7 +1047,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { .timeout(20000) .execute(); LuceneLogDto logDto1 = LuceneLogDto.builder() - .device_code("叉车运单响应") + .device_code("追加诺宝运单参数") .content("指令号:" + instructionCode + ",下发追加诺宝运单反馈参数:" + jo) .build(); logDto.setLog_level(4); @@ -1079,25 +1107,25 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } private void sendEndDeviceOrder2(JSONArray ja, String nextDeviceCode, String instructionCode, Instruction instructionDto) { - //放货前等待 - JSONObject jo3 = new JSONObject(); - jo3.put("blockId", IdUtil.simpleUUID()); - jo3.put("location", nextDeviceCode + "INPUT"); - jo3.put("operation", "script"); - jo3.put("id", nextDeviceCode + "INPUT"); - jo3.put("script_name", "userpy/interact.py"); - JSONObject script_args3 = new JSONObject(); - script_args3.put("addr", addr); - JSONObject data3 = new JSONObject(); - JSONObject reach3 = new JSONObject(); - reach3.put("task_code", instructionCode); - reach3.put("address", nextDeviceCode + "INPUT"); - data3.put("reach", reach3); - script_args3.put("data", data3); - script_args3.put("protocol", "HTTP"); - jo3.put("script_args", script_args3); - ja.add(jo3); if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { + //放货前等待 + JSONObject jo3 = new JSONObject(); + jo3.put("blockId", IdUtil.simpleUUID()); + jo3.put("location", nextDeviceCode + "INPUT"); + jo3.put("operation", "script"); + jo3.put("id", nextDeviceCode + "INPUT"); + jo3.put("script_name", "userpy/interact.py"); + JSONObject script_args3 = new JSONObject(); + script_args3.put("addr", addr); + JSONObject data3 = new JSONObject(); + JSONObject reach3 = new JSONObject(); + reach3.put("task_code", instructionCode); + reach3.put("address", nextDeviceCode + "INPUT"); + data3.put("reach", reach3); + script_args3.put("data", data3); + script_args3.put("protocol", "HTTP"); + jo3.put("script_args", script_args3); + ja.add(jo3); //将货物放下 com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject(); jo4.put("blockId", IdUtil.simpleUUID()); @@ -1376,16 +1404,16 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONObject jo9 = new JSONObject(); jo9.put("blockId", IdUtil.simpleUUID()); - jo9.put("location", inst.getNext_device_code() + "WAITE"); + jo9.put("location", inst.getNext_device_code() + "WAIT"); jo9.put("operation", "script"); - jo9.put("id", inst.getNext_device_code() + "WAITE"); + jo9.put("id", inst.getNext_device_code() + "WAIT"); jo9.put("script_name", "userpy/interact.py"); JSONObject script_args5 = new JSONObject(); script_args5.put("addr", addr); JSONObject data3 = new JSONObject(); JSONObject reach3 = new JSONObject(); reach3.put("task_code", inst.getInstruction_code()); - reach3.put("address", inst.getNext_device_code() + "WAITE"); + reach3.put("address", inst.getNext_device_code() + "WAIT"); data3.put("reach", reach3); script_args5.put("data", data3); script_args5.put("protocol", "HTTP"); 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 b71c2b5eb..4e1267bd1 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 @@ -482,6 +482,14 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } else { //查看是否存在输送线到对接为的指令 Instruction byNextDeviceCodeFromCache = instructionService.findByNextDeviceCodeFromCache(this.device_code); + if (ObjectUtil.isNotEmpty(byNextDeviceCodeFromCache)){ + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("存在堆垛机对接为的指令") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } //补码生成堆垛机对接位到货架的指令 if (StrUtil.isNotEmpty(hand_barcode) && ObjectUtil.isEmpty(byNextDeviceCodeFromCache)) { TaskDto taskDtoHandCode = taskserver.findByVehicleCodeCodeAndReady(hand_barcode); 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 93b818581..e83d76910 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 @@ -45,10 +45,8 @@ import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; -import java.time.LocalDateTime; import java.util.*; import java.util.regex.Pattern; -import java.util.stream.Collectors; /** * 单工位堆垛机驱动 @@ -996,7 +994,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } List list = new ArrayList(); pakageCommand(list, inst.getInstruction_code()); - packagePlcCoordinate(startDevice, list); + packagePlcCoordinate(startDevice, list,"1"); if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name()) && !prohibitOutWarehouse) { pakagePlc(inst, list,"1"); } @@ -1009,7 +1007,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme return true; } - private void packagePlcCoordinate(Device startDevice, List list) { + private void packagePlcCoordinate(Device startDevice, List list, String toCommand) { if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name()) && !prohibitInWarehouse) { if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) { HashMap map4 = new HashMap(); @@ -1029,6 +1027,10 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme map6.put("value", startDevice.getExtraValue().get("y")); list.add(map6); } + HashMap map2 = new HashMap(); + map2.put("code", "to_command"); + map2.put("value", toCommand); + list.add(map2); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 1e611a0ce..bddbcc1d5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -546,14 +546,14 @@ public class InstructionServiceImpl extends CommonServiceImpl instructionMybatis = instructionMapper.selectList(Wrappers.lambdaQuery(InstructionMybatis.class) - .eq(InstructionMybatis::getTask_code, dto.getTask_code())); - if (CollUtil.isNotEmpty(instructionMybatis) && instructionMybatis.stream().anyMatch(inst -> inst.getStart_device_code() - .equals(start_device_code))) { - return; - } - } +// if (StrUtil.isNotEmpty(dto.getTask_code())) { +// List instructionMybatis = instructionMapper.selectList(Wrappers.lambdaQuery(InstructionMybatis.class) +// .eq(InstructionMybatis::getTask_code, dto.getTask_code())); +// if (CollUtil.isNotEmpty(instructionMybatis) && instructionMybatis.stream().anyMatch(inst -> inst.getStart_device_code() +// .equals(start_device_code))) { +// return; +// } +// } String currentUsername = SecurityUtils.getCurrentNickName(); String now = DateUtil.now(); if (StrUtil.isEmpty(dto.getRoute_plan_code())) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvSystemTypeEnum.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvSystemTypeEnum.java index 6acfbbef1..abf9625ed 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvSystemTypeEnum.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvSystemTypeEnum.java @@ -11,14 +11,17 @@ import lombok.Getter; @AllArgsConstructor public enum AgvSystemTypeEnum { /** + * 二期一楼AGV任务 * 一期1楼叉车NDC系统 */ One_NDC_System_Type("1", "1", "一期1楼叉车NDC系统"), /** + * 二期二楼NDC系统 * 一期2楼NDC系统 */ Two_NDC_System_Type("2", "2", "一期2楼NDC系统"), /** + * 二期一楼叉车任务 * 仙工AGV系统 */ XG_System_Type("3", "3", "仙工AGV系统"); From 5b1c96f39f61e5c874814891b4e822fd1cd51a7e Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Thu, 27 Jun 2024 09:32:39 +0800 Subject: [PATCH 17/40] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E5=88=86=E9=85=8D=E9=A1=B6=E7=82=B9=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/acs/agv/AgvWaitUtil.java | 59 ++++++++---- .../server/impl/XianGongAgvServiceImpl.java | 90 ++++++++++--------- .../StandardOrdinarySiteDeviceDriver.java | 5 ++ .../BoxSubvolumesConveyorDeviceDriver.java | 3 +- ...ConveyorWithScannerWeightDeviceDriver.java | 3 + acs2/nladmin-ui/src/i18n/langs/task/en.js | 1 + acs2/nladmin-ui/src/i18n/langs/task/in.js | 1 + acs2/nladmin-ui/src/i18n/langs/task/zh.js | 1 + .../device/driver/standard_ordinary_site.vue | 2 +- acs2/nladmin-ui/src/views/acs/task/index.vue | 24 +++++ 10 files changed, 126 insertions(+), 63 deletions(-) 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 @@ /> + + + + + Date: Thu, 27 Jun 2024 09:35:47 +0800 Subject: [PATCH 18/40] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E5=88=86=E9=85=8D=E9=A1=B6=E7=82=B9=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 b43d9b9c0..15e8e2f1e 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 @@ -752,8 +752,10 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { //如果是放货二次分配,取放货二次分配需要重新追加动作块 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); +// deviceCodeNow = applyXGAgvTask(task_code, actionType, instructionDto); deviceCodeNow = "ZXQ_05"; + sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), deviceCodeNow, instructionDto); + return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); } return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); From 250280db085202ff9fbeb1ad1d3197c6ad2903c6 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Thu, 27 Jun 2024 09:43:20 +0800 Subject: [PATCH 19/40] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E5=88=86=E9=85=8D=E9=A1=B6=E7=82=B9=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/nl/acs/agv/AgvWaitUtil.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 79c2fa9e5..b2035a536 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 @@ -191,6 +191,12 @@ public class AgvWaitUtil { throw new BadRequestException("上位系统不允许取货"); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("允许放货"+ "点位" + endDeviceCode) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); JSONObject map = new JSONObject(); map.put("status", 200); map.put("message", "允许放货!"); From 2a92d9b11ef1dd76749c129e8c96a1e205794670 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Thu, 27 Jun 2024 14:05:57 +0800 Subject: [PATCH 20/40] =?UTF-8?q?fix:=20=E8=BF=BD=E5=8A=A0=E8=AF=BA?= =?UTF-8?q?=E5=AE=9D=E5=B0=81=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/impl/XianGongAgvServiceImpl.java | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) 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 15e8e2f1e..6f23d43ca 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 @@ -61,7 +61,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { @Autowired private LuceneExecuteLogService luceneExecuteLogService; -// DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); + @Autowired + private DeviceAppService deviceAppservice; @Autowired @@ -378,15 +379,7 @@ 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); - }}); - ja.add(jo1); - - + inspectInStocckSet(ja, pointCode, jo1); JSONObject jo2 = new JSONObject(); jo2.put("blockId", IdUtil.simpleUUID()); jo2.put("location", pointCode + "OUTGET"); @@ -407,6 +400,25 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } + private void inspectInStocckSet(JSONArray ja, String pointCode, JSONObject jo1) { + Device device = deviceAppservice.findDeviceByCode(pointCode); + StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + String inspectInStocck = (String)device.getExtraValue().get("inspect_in_stocck"); + if (StrUtil.isNotEmpty( inspectInStocck) && inspectInStocck.equals("true")){ + jo1.put("operationArgs", new JSONObject() {{ + put("recognize",false); + }}); + ja.add(jo1); + }else { + jo1.put("operationArgs", new JSONObject() {{ + put("recognize", true); + }}); + ja.add(jo1); + } + } + } + /** * 下发放货信号 * @@ -851,7 +863,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { jo.put("id", instructionCode); //动作块 jo.put("blocks", createBlocksDataTowCCStart(nextPoint)); - + //追加订单封口 + jo.put("complete", true); LuceneLogDto logDto = LuceneLogDto.builder() .device_code("追加叉车运单") .content("指令号:" + instructionCode + ",追加叉车运单参数:" + jo) @@ -1029,6 +1042,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { jo.put("blocks", createBlocksDataTowEnd(instructionCode, point, instructionDto)); } + //追加订单封口 + jo.put("complete", true); LuceneLogDto logDto = LuceneLogDto.builder() .device_code("追加诺宝运单") .content("指令号:" + instructionCode + ",追加诺宝运单参数:" + jo) @@ -1163,12 +1178,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { jo1.put("blockId", IdUtil.simpleUUID()); jo1.put("location", startPoint); jo1.put("operation", "JackLoad"); - jo1.put("operationArgs", new JSONObject() {{ - put("recognize", true); - }}); - ja.add(jo1); - - + inspectInStocckSet(ja, startPoint, jo1); JSONObject jo2 = new JSONObject(); jo2.put("blockId", IdUtil.simpleUUID()); jo2.put("location", startPoint + "OUTGET"); From 3d1bada4c9cad3e43254e59491add623b2c2348d Mon Sep 17 00:00:00 2001 From: yanps Date: Thu, 27 Jun 2024 17:01:01 +0800 Subject: [PATCH 21/40] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0AGV=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E7=A6=BB=E5=BC=80=E7=83=98=E7=AE=B1=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=8F=8D=E9=A6=88,=E4=B8=8B=E5=8F=91=E7=AE=A1=E8=8A=AF?= =?UTF-8?q?=E6=89=98=E7=9B=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../run/TwoNDCSocketConnectionAutoRun.java | 123 ++++++++++++++---- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 19 ++- .../oven_manipulator/ItemProtocol.java | 43 ++++++ .../OvenGantryManipulatorDeviceDriver.java | 23 ++++ .../acs/device/driver/standard_autodoor.vue | 48 ++++++- 5 files changed, 230 insertions(+), 26 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index 52656158c..70fd97c49 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -1,5 +1,6 @@ package org.nl.acs.auto.run; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; @@ -10,6 +11,8 @@ import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.agv.ndcone.AgvNdcOneDeviceDriver; import org.nl.acs.device_driver.agv.ndctwo.AgvNdcTwoDeviceDriver; import org.nl.acs.device_driver.autodoor.standard_autodoor.StandardAutodoorDeviceDriver; +import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.instruction.domain.Instruction; @@ -27,9 +30,13 @@ import org.springframework.stereotype.Component; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; +import java.lang.reflect.Field; import java.net.InetSocketAddress; import java.net.Socket; import java.util.Date; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; import static org.nl.acs.agv.server.impl.NDCAgvServiceImpl.Bytes2HexString; @@ -52,6 +59,11 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { boolean bConnected = true; boolean isReConnect = false; + int i = 1 ; + boolean requireSucessRegion = false; + boolean requireSucessTake = false; + boolean requireSucessPut = false; + @Autowired ISysParamService paramService; @@ -195,7 +207,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (agvDevice.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) { agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) agvDevice.getDeviceDriver(); agvNdcTwoDeviceDriver.setInstruction(null); - }else if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) { + } else if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) { agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver(); agvNdcOneDeviceDriver.setInstruction(null); } @@ -231,18 +243,47 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (ObjectUtil.isNotEmpty(device)) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - try { - standardAutodoorDeviceDriver.writing("to_open", "1"); - standardAutodoorDeviceDriver.writing("to_close", "0"); - } catch (Exception e) { - log.info("下发电气信号失败:" + e.getMessage()); - e.printStackTrace(); - } - if (standardAutodoorDeviceDriver.getOpen() == 1 && standardAutodoorDeviceDriver.getToOpen() == 1 ) { - log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - }else { - log.info("未下发NDC信号原因: 下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); + String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region"); + if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) { + String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code"); + Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode); + if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) { + OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver(); + String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ? + "two" : Integer.parseInt(region) == 3 ? "three" : null; + Class aClass = hxhj.getClass(); + String regionCode = "region_" + s; + String s1 = Integer.parseInt(region) == 1 ? "2" : Integer.parseInt(region) == 2 ? + "6" : Integer.parseInt(region) == 3 ? "8" : null; + if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) { + hxhj.writing("to_"+regionCode, s1); + log.info("下发AGV进入区域{}信号值为:{}", region, s1); + } else { + log.info("区域{}信号{}未清除,导致不满足下发AGV进入区域信号", region, regionCode); + } + if (hxhj.getMode() == 2 && StrUtil.isNotEmpty(s1) && ((Integer) aClass.getField(regionCode).get(hxhj) == 2)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + requireSucessRegion = true; + } else { + log.error("AGV进入区域{}信号{}行架未接收{},请检查;或行架正在执行中:{}", region, regionCode,s1, hxhj.getMode()); + } + } else { + log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode); + } + } else { + try { + standardAutodoorDeviceDriver.writing("to_open", "1"); + standardAutodoorDeviceDriver.writing("to_close", "0"); + } catch (Exception e) { + log.info("下发电气信号失败:" + e.getMessage()); + e.printStackTrace(); + } + if (standardAutodoorDeviceDriver.getOpen() == 1 && standardAutodoorDeviceDriver.getToOpen() == 1) { + log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + } else { + log.info("未下发NDC信号原因: 下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); + } } } } else { @@ -257,19 +298,50 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (ObjectUtil.isNotEmpty(device)) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - try { - standardAutodoorDeviceDriver.writing("to_close", "1"); - standardAutodoorDeviceDriver.writing("to_open", "0"); - } catch (Exception e) { - log.info("下发电气信号失败:" + e.getMessage()); - e.printStackTrace(); + String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region"); + if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) { + String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code"); + if(requireSucessTake || requireSucessPut){ + Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode); + if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) { + OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver(); + String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ? + "two" : Integer.parseInt(region) == 3 ? "three" : null; + Class aClass = hxhj.getClass(); + String regionCode = "region_" + s; + if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) != 0)) { + hxhj.writing("to_"+regionCode, "0"); + log.info("下发AGV离开区域{}信号值为:{}", region, 0); + } else { + log.info("区域{}信号{}为0,不需要下发AGV离开区域信号", region, regionCode); + } + if (hxhj.getMode() == 2 && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + requireSucessPut = false; + requireSucessTake = false; + } else { + log.error("AGV离开区域{}信号{}行架未接收0,请检查;或行架正在执行中:{}", region, regionCode, hxhj.getMode()); + } + } else { + log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode); + } + }else{ + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + } + } else { + try { + standardAutodoorDeviceDriver.writing("to_close", "1"); + standardAutodoorDeviceDriver.writing("to_open", "0"); + } catch (Exception e) { + log.info("下发电气信号失败:" + e.getMessage()); + e.printStackTrace(); + } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); } } else { log.info(device_code + "对应设备号为空!"); } - } else { //上报异常信息 //(不需要WCS反馈) @@ -283,6 +355,13 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) { agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver(); agvNdcTwoDeviceDriver.processSocket(arr); + if(phase == 0x05 && "3".equals(inst.getInstruction_type()) && requireSucessRegion){ + requireSucessPut = true; + requireSucessRegion = false; + }else if(phase == 0x0E && "8".equals(inst.getInstruction_type()) && requireSucessRegion){ + requireSucessTake = true; + requireSucessRegion = false; + } } else if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) { agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver(); agvNdcOneDeviceDriver.processSocket(arr); @@ -298,12 +377,10 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (!ObjectUtil.isEmpty(data)) { write(data); } - } else { System.out.println("agv上报不是0073类型动作,不处理"); } } - } catch (Exception e) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index e32322f49..0cb6bf4c2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -47,6 +47,7 @@ import org.nl.config.lucene.service.dto.LuceneLogDto; import org.nl.system.service.param.ISysParamService; import org.nl.config.SpringContextHolder; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; @@ -1543,7 +1544,23 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); try { - paperTubePickSiteDeviceDriver.writing(5); + TaskDto byTaskCode = taskService.findByTaskCode(inst.getTask_code()); + Map map = new HashMap(); + if(StrUtil.isNotEmpty(byTaskCode.getInteraction_json())){ + String interaction_json = byTaskCode.getInteraction_json(); + JSONObject jsonObject = JSONObject.parseObject(interaction_json); + String to_material = jsonObject.getString("to_material"); + String to_spec = jsonObject.getString("to_spec"); + String to_qty = jsonObject.getString("to_qty"); + map.put("to_command",5); + map.put("to_material",to_material); + map.put("to_spec",to_spec); + map.put("to_qty",to_qty); + paperTubePickSiteDeviceDriver.writing(map); + }else{ + map.put("to_command",5); + paperTubePickSiteDeviceDriver.writing(map); + } } catch (Exception e) { e.printStackTrace(); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/ItemProtocol.java index 463dafdda..a183f50c3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/ItemProtocol.java @@ -30,6 +30,13 @@ public class ItemProtocol { public static String item_x_position = "x"; //y轴坐标 public static String item_y_position = "y"; + //区域一 + public static String item_region_one = "region_one"; + //区域二 + public static String item_region_two = "region_two"; + //区域三 + public static String item_region_three = "region_three"; + //下发命令 public static String item_to_command = "to_command"; @@ -37,6 +44,12 @@ public class ItemProtocol { public static String item_to_onset = "to_onset"; //下发目标站 public static String item_to_target = "to_target"; + //下发区域一 + public static String item_to_region_one = "to_region_one"; + //下发区域二 + public static String item_to_region_two = "to_region_two"; + //下发区域三 + public static String item_to_region_three = "to_region_three"; //下发任务号 public static String item_to_task = "to_task"; @@ -82,6 +95,30 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_to_target); } + public int getTo_region_one() { + return this.getOpcIntegerValue(item_to_region_one); + } + + public int getTo_region_two() { + return this.getOpcIntegerValue(item_to_region_two); + } + + public int getTo_region_three() { + return this.getOpcIntegerValue(item_to_region_three); + } + + public int getRegion_one() { + return this.getOpcIntegerValue(item_region_one); + } + + public int getRegion_two() { + return this.getOpcIntegerValue(item_region_two); + } + + public int getRegion_three() { + return this.getOpcIntegerValue(item_region_three); + } + public int getTo_task() { return this.getOpcIntegerValue(item_to_task); } @@ -150,6 +187,9 @@ public class ItemProtocol { list.add(new ItemDto(item_task, "任务号", "DB1.D6")); list.add(new ItemDto(item_x_position, "x坐标", "DB1.REAL10")); list.add(new ItemDto(item_y_position, "y坐标", "DB1.REAL14")); + list.add(new ItemDto(item_region_one, "区域一", "DB1.REAL18")); + list.add(new ItemDto(item_region_two, "区域二", "DB1.REAL22")); + list.add(new ItemDto(item_region_three, "区域三", "DB1.REAL26")); return list; } @@ -159,6 +199,9 @@ public class ItemProtocol { list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2")); list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4")); list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6")); + list.add(new ItemDto(item_to_region_one, "下发区域一", "DB2.D6")); + list.add(new ItemDto(item_to_region_two, "下发区域二", "DB2.D6")); + list.add(new ItemDto(item_to_region_three, "下发区域三", "DB2.D6")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 40f1d5f91..92bb217fb 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -110,6 +110,19 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int last_heartbeat = 0; int to_command = 0; int last_to_command = 0; + public int region_one = 0; + public int last_region_one = 0; + public int region_two = 0; + public int last_region_two = 0; + public int region_three = 0; + public int last_region_three = 0; + public int to_region_one = 0; + public int last_to_region_one = 0; + public int to_region_two = 0; + public int last_to_region_two = 0; + public int to_region_three = 0; + public int last_to_region_three = 0; + int to_target = 0; int last_to_target = 0; @@ -183,6 +196,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i to_onset = this.itemProtocol.getTo_onset(); x_position = this.itemProtocol.getX_position(); y_position = this.itemProtocol.getY_position(); + region_one = this.itemProtocol.getRegion_one(); + region_two = this.itemProtocol.getRegion_two(); + region_three = this.itemProtocol.getRegion_three(); + to_region_one = this.itemProtocol.getTo_region_one(); + to_region_two = this.itemProtocol.getTo_region_two(); + to_region_three = this.itemProtocol.getTo_region_three(); iserror = this.itemProtocol.device_status; if (mode != last_mode) { @@ -262,6 +281,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i last_to_onset = to_onset; last_x_position = x_position; last_y_position = y_position; + last_region_one = region_one; + last_region_two = region_two; + last_region_three = region_three; + } public List sortTask(List taskDtos) { diff --git a/acs2/nladmin-ui/src/views/acs/device/driver/standard_autodoor.vue b/acs2/nladmin-ui/src/views/acs/device/driver/standard_autodoor.vue index c1fb0acc9..59c075a53 100644 --- a/acs2/nladmin-ui/src/views/acs/device/driver/standard_autodoor.vue +++ b/acs2/nladmin-ui/src/views/acs/device/driver/standard_autodoor.vue @@ -50,11 +50,45 @@ - + + + + + + + + + + + + + + + @@ -161,6 +195,7 @@ import { import { selectOpcList } from '@/api/acs/device/opc' import { selectPlcList } from '@/api/acs/device/opcPlc' import { selectListByOpcID } from '@/api/acs/device/opcPlc' +import deviceCrud from '@/api/acs/device/device' import crud from '@/mixins/crud' @@ -184,6 +219,7 @@ export default { configLoading: false, dataOpcservers: [], dataOpcPlcs: [], + deviceList: [], data1: [], data2: [], form: { @@ -195,7 +231,12 @@ export default { is_pickup: true, is_release: true }, - rules: {} + rules: {}, + region: [ + { region_name: '区域一', region_number: '1' }, + { region_name: '区域二', region_number: '2' }, + { region_name: '区域三', region_number: '3' } + ] } }, created() { @@ -234,6 +275,9 @@ export default { this.dataOpcservers = data this.opc_id = this.$props.parentForm.opc_server_id }) + deviceCrud.selectDeviceList().then(data => { + this.deviceList = data + }) }) }, methods: { From 81201f1bf8445c91df3b2d9d582a944d5dfb3627 Mon Sep 17 00:00:00 2001 From: yanps Date: Thu, 27 Jun 2024 17:15:14 +0800 Subject: [PATCH 22/40] =?UTF-8?q?opt:=20=E5=8F=96=E6=B6=88=E8=A1=8C?= =?UTF-8?q?=E6=9E=B6-agv=E5=AF=B9=E6=8E=A5=E4=BD=8D=E7=9A=84=E5=8F=96?= =?UTF-8?q?=E8=B4=A7=E6=94=BE=E8=B4=A7=E5=AE=8C=E6=88=90=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 195 +++++++----------- 1 file changed, 78 insertions(+), 117 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 0cb6bf4c2..5cfcc9823 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -133,12 +133,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // return; LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content("当前指令号为:"+ inst.getInstruction_code()) + .content("当前指令号为:" + inst.getInstruction_code()) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); task = taskService.findByTaskCode(inst.getTask_code()); - }else { + } else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("指令号为空!") @@ -388,7 +388,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() @@ -411,19 +411,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic len2 = Float.parseFloat(length2); } if (len1 * len2 < 0) { - if (ObjectUtil.isNotEmpty(device_code1) && (('A') == (device_code1.charAt(device_code1.length()-1)))) { + if (ObjectUtil.isNotEmpty(device_code1) && (('A') == (device_code1.charAt(device_code1.length() - 1)))) { String offSet_A = paramService.findByCode(AcsConfig.OFFSET_A).getValue(); if (ObjectUtil.isNotEmpty(offSet_A) && !"null".equals(offSet_A)) { Integer integer = Integer.valueOf(offSet_A); len1 = len1 - integer; } - } else if (ObjectUtil.isNotEmpty(device_code1) && (('B') == (device_code1.charAt(device_code1.length()-1)))) { + } else if (ObjectUtil.isNotEmpty(device_code1) && (('B') == (device_code1.charAt(device_code1.length() - 1)))) { String offSet_B = paramService.findByCode(AcsConfig.OFFSET_B).getValue(); if (ObjectUtil.isNotEmpty(offSet_B) && !"null".equals(offSet_B)) { Integer integer = Integer.valueOf(offSet_B); len1 = integer + len1; } - }else{ + } else { log.info("{}设备名不符合条件,指令号{}", device_code, ikey); } int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; @@ -435,7 +435,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } else if(roundedNumber > -50 || roundedNumber < 50){ + } else if (roundedNumber > -50 || roundedNumber < 50) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) @@ -443,22 +443,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - }else if(roundedNumber > 50 || roundedNumber < -50){ + } else if (roundedNumber > 50 || roundedNumber < -50) { log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(device_code+"设备,偏移数据超出范围导致未反馈"+ roundedNumber+"指令号"+ ikey) + .content(device_code + "设备,偏移数据超出范围导致未反馈" + roundedNumber + "指令号" + ikey) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } - }else{ - log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey); + } else { + log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } } else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); - if(wasteFoilWeighingStationDriver.getMove() == 1 && wasteFoilWeighingStationDriver.getAction() == 1 - && wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2){ + if (wasteFoilWeighingStationDriver.getMove() == 1 && wasteFoilWeighingStationDriver.getAction() == 1 + && wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2) { try { Map map = new LinkedHashMap<>(); map.put("to_command", "2"); @@ -473,7 +473,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - }else{ + } else { message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); @@ -576,18 +576,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); - } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { @@ -631,7 +626,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货完成反馈,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() @@ -670,8 +665,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } } else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); - if(wasteFoilWeighingStationDriver.getMove() == 0 && wasteFoilWeighingStationDriver.getAction() == 1 - && wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2){ + if (wasteFoilWeighingStationDriver.getMove() == 0 && wasteFoilWeighingStationDriver.getAction() == 1 + && wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2) { try { Map map = new LinkedHashMap<>(); map.put("to_command", "3"); @@ -686,7 +681,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - }else{ + } else { message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); @@ -817,7 +812,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(manipulatorAgvStationDeviceDriver.getDevice_code()+"动作信号不为1") + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -927,7 +922,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Integer integer = Integer.valueOf(offSet_B); len1 = integer + len1; } - }else{ + } else { log.info("{}设备名不符合条件,指令号{}", device_code, ikey); } int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; @@ -939,7 +934,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } else if(roundedNumber > -50 || roundedNumber < 50){ + } else if (roundedNumber > -50 || roundedNumber < 50) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) @@ -947,11 +942,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - }else if(roundedNumber > 50 || roundedNumber < -50){ + } else if (roundedNumber > 50 || roundedNumber < -50) { log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey); } - }else{ - log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey); + } else { + log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -1064,24 +1059,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); try { @@ -1099,7 +1083,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() @@ -1252,7 +1236,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足放货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() @@ -1361,7 +1345,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Integer integer = Integer.valueOf(offSet_B); len1 = integer + len1; } - }else{ + } else { log.info("{}设备名不符合条件,指令号{}", device_code, ikey); } int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; @@ -1373,7 +1357,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } else if(roundedNumber > -50 || roundedNumber < 50){ + } else if (roundedNumber > -50 || roundedNumber < 50) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) @@ -1381,16 +1365,16 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - }else if(roundedNumber > 50 || roundedNumber < -50){ + } else if (roundedNumber > 50 || roundedNumber < -50) { log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey); } - }else{ - log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey); + } else { + log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } } else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); - if(wasteFoilWeighingStationDriver.getMove() == 0 && wasteFoilWeighingStationDriver.getAction() == 1 - && wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2){ + if (wasteFoilWeighingStationDriver.getMove() == 0 && wasteFoilWeighingStationDriver.getAction() == 1 + && wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2) { try { Map map = new LinkedHashMap<>(); map.put("to_command", "4"); @@ -1405,7 +1389,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - }else{ + } else { message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); @@ -1497,24 +1481,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { @@ -1546,19 +1519,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic try { TaskDto byTaskCode = taskService.findByTaskCode(inst.getTask_code()); Map map = new HashMap(); - if(StrUtil.isNotEmpty(byTaskCode.getInteraction_json())){ + if (StrUtil.isNotEmpty(byTaskCode.getInteraction_json())) { String interaction_json = byTaskCode.getInteraction_json(); JSONObject jsonObject = JSONObject.parseObject(interaction_json); String to_material = jsonObject.getString("to_material"); String to_spec = jsonObject.getString("to_spec"); String to_qty = jsonObject.getString("to_qty"); - map.put("to_command",5); - map.put("to_material",to_material); - map.put("to_spec",to_spec); - map.put("to_qty",to_qty); + map.put("to_command", 5); + map.put("to_material", to_material); + map.put("to_spec", to_spec); + map.put("to_qty", to_qty); paperTubePickSiteDeviceDriver.writing(map); - }else{ - map.put("to_command",5); + } else { + map.put("to_command", 5); paperTubePickSiteDeviceDriver.writing(map); } } catch (Exception e) { @@ -1599,8 +1572,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } } else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); - if(wasteFoilWeighingStationDriver.getMove() == 1 && wasteFoilWeighingStationDriver.getAction() == 1 - && wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2){ + if (wasteFoilWeighingStationDriver.getMove() == 1 && wasteFoilWeighingStationDriver.getAction() == 1 + && wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2) { try { Map map = new LinkedHashMap<>(); map.put("to_command", "5"); @@ -1615,7 +1588,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - }else{ + } else { message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); @@ -1806,7 +1779,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Integer integer = Integer.valueOf(offSet_B); len1 = integer + len1; } - }else{ + } else { log.info("{}设备名不符合条件,指令号{}", device_code, ikey); } int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; @@ -1818,7 +1791,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } else if(roundedNumber > -50 || roundedNumber < 50){ + } else if (roundedNumber > -50 || roundedNumber < 50) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) @@ -1826,17 +1799,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - }else if(roundedNumber > 50 || roundedNumber < -50){ + } else if (roundedNumber > 50 || roundedNumber < -50) { log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content("设备"+device_code+"偏移数据超出范围导致未反馈"+roundedNumber+"指令号"+ikey) + .content("设备" + device_code + "偏移数据超出范围导致未反馈" + roundedNumber + "指令号" + ikey) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } - }else{ - log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey); + } else { + log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -1917,30 +1890,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - try { manipulatorAgvStationDeviceDriver.writing(5); } catch (Exception e) { e.printStackTrace(); } - if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); try { From 97a3bb970a388a83d5772ab7a3745504b4dbdd3c Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Thu, 27 Jun 2024 18:34:06 +0800 Subject: [PATCH 23/40] =?UTF-8?q?rev:=E4=BC=98=E5=8C=96=E5=88=86=E5=88=87?= =?UTF-8?q?=E8=A1=8C=E6=9E=B6=E4=BB=BB=E5=8A=A1=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardStackerDeviceDriver.java | 2 +- .../PlugPullDeviceSiteDeviceDriver.java | 2 +- .../SlitTwoManipulatorDeviceDriver.java | 68 +++++++++---------- 3 files changed, 33 insertions(+), 39 deletions(-) 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 e83d76910..ff26602fd 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 @@ -988,7 +988,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver(); if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() != 0) { notCreateInstMessage = "未下发电气信号原因->输送线-货架对接位:" + beltConveyorDeviceDriver.getDevice_code() + - "无货或未联机,无法下发指令!指令号:" + inst.getInstruction_code(); + "有货或未联机,无法下发指令!指令号:" + inst.getInstruction_code(); return false; } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 58eee3133..5bf38710b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -321,7 +321,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请套管成功:" + applyPlugPullSitResponse.getData()) + .content("申请套管任务,返回参数::" + applyPlugPullSitResponse.getData()) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 7aff9d4c3..0d6dfd394 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -39,6 +39,7 @@ import org.openscada.opc.lib.da.Server; import org.springframework.beans.factory.annotation.Autowired; import java.util.*; +import java.util.stream.Collectors; /** * 分切双工位行架机械手 @@ -313,7 +314,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl //正常申请任务 public synchronized boolean applyTask() { - boolean flag = false; Date date = new Date(); if (date.getTime() - this.instruction_head_time.getTime() < (long) this.instruction_require_time_out) { log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_head_time); @@ -330,14 +330,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl //如果禁用 if (slitTwoManipulatorDeviceDriver.getIs_disable() == 1) { //就去走关联设备异常取放货工位的任务 任务生成成功返回true 就不会走下面正常生成任务的逻辑 - try { - flag = instruction_require2(); - } catch (Exception e) { - flag = false; - } - if (flag) { - return false; - } + boolean flag = false; + flag = instruction_require2(); + return flag; } } //没有生成异常取放货工位的任务 就生成正常关联取放货工位的任务 @@ -352,41 +347,39 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl TaskDto task = null; for (int i = 0; i < getDeviceCodeList.size(); i++) { String startDeviceCode = getDeviceCodeList.get(i); - List taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode); + List taskDtos = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode); if (ObjectUtil.isNotEmpty(taskDtos)) { - //按照优先级排序 优先级相等按照创建时间排序 - taskDtos = this.sortTask(taskDtos); - TaskDto taskDto = taskDtos.get(0); - truss_type = taskDto.getTruss_type(); - //查询任务是行架任务 - if (!StrUtil.equals(taskDto.getTask_type(), "6")) { - taskDto = null; - continue; + //按照创建时间排序 + List taskDtoStream = taskDtos.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + if (ObjectUtil.isNotEmpty(taskDtoStream)) { + TaskDto taskDto = taskDtoStream.get(0); + this.executeReadyInst(taskDto); } - flag = this.executeReadyInst(taskDto); } else { - List taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); + List taskDtoList = taskserver.findByTrappedManipulatorReady(); if (ObjectUtil.isNotEmpty(taskDtoList)) { - //按照优先级排序 优先级相等按照创建时间排序 - taskDtoList = this.sortTask(taskDtoList); - for (int j = 0; j < taskDtoList.size(); j++) { - task = taskDtoList.get(j); - - // 9 行架任务 - if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) { - task = null; - continue; + List taskDtosReady = new ArrayList<>(); + for (TaskDto taskDto1 : taskDtoList) { + if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) { + taskDtosReady.add(taskDto1); } - if (ObjectUtil.isNotEmpty(task)) break; } + //按照优先级排序 优先级相等按照创建时间排序 + taskDtosReady = this.sortTask(taskDtosReady); + task = taskDtosReady.get(0); + } + if (!ObjectUtil.isEmpty(task)) { + break; } } } if (!ObjectUtil.isEmpty(task)) { - flag = this.executeReadyTask(task); + this.executeReadyTask(task); + } else { + notCreateInstMessage = "universal_notCreateInstMessage"; } + return true; } - return flag; } //关联设备异常申请任务 @@ -610,7 +603,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl public void isSetAddress(Device device) { if (ObjectUtil.isEmpty(device.getExtraValue().get("address"))) { logServer.deviceExecuteLog(device_code, "", "task:" + task, "设备:" + device.getDevice_code() + "未设置电气调度号!"); - notCreateInstMessage = "universal_notCreateInstMessage1";; + notCreateInstMessage = "universal_notCreateInstMessage1"; + ; throw new BadRequestException("设备:" + device.getDevice_code() + "未设置电气调度号!"); } } @@ -839,11 +833,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl if (this.requireSucess) { requireSucess = CommonFinalParam.ONE; } - if(error == 0){ - if(this.itemProtocol.isError){ + if (error == 0) { + if (this.itemProtocol.isError) { this.setMessage(LangProcess.msg("universal_message4")); iserror = true; - }else{ + } else { iserror = false; } } @@ -864,7 +858,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl jo.put("is_click", true); jo.put("driver_type", "slit_two_manipulator"); jo.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage)); - jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); + jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); jo.put("feedMessage", LangProcess.msg(feedMessage)); return jo; } From df318c8e458f22c97caca37e3ffc8ba68f2bbb72 Mon Sep 17 00:00:00 2001 From: yanps Date: Thu, 27 Jun 2024 18:47:46 +0800 Subject: [PATCH 24/40] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E8=A1=8C?= =?UTF-8?q?=E6=9E=B6-agv=E5=AF=B9=E6=8E=A5=E4=BD=8D=E5=8F=96=E8=B4=A7?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=8F=8D=E9=A6=88LMS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 14 +++++++++ .../acs/ext/wms/service/AcsToWmsService.java | 6 ++++ .../wms/service/impl/AcsToWmsServiceImpl.java | 29 +++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 5cfcc9823..6a99fb316 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -44,12 +44,14 @@ import org.nl.config.language.LangProcess; import org.nl.config.lucene.enums.LogTypeEnum; import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; +import org.nl.config.thread.ThreadPoolExecutorUtil; import org.nl.system.service.param.ISysParamService; import org.nl.config.SpringContextHolder; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ThreadPoolExecutor; /** @@ -70,6 +72,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); + final ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll(); TwoAgvPhase twoAgvPhase = new TwoAgvPhase(); String error_code = "0"; @@ -583,6 +586,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + String task_code = inst.getTask_code(); + EXECUTOR.submit(() -> { + boolean feedbackToLms = (boolean)manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"); + if(feedbackToLms){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + acsToWmsService.actionFinishRequest2(jsonObject); + } + }); + + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index db2a23625..faea6ca16 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -201,4 +201,10 @@ public interface AcsToWmsService { HttpResponse feedbackDies(JSONObject param); String secondaryAllocationPoint(JSONObject param); + + /** + * 行架-agv对接位取货完成反馈 + * @param jsonObject + */ + void actionFinishRequest2(JSONObject jsonObject); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 772d5ca7d..9dd4ef120 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -677,6 +677,35 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } } + @Override + public void actionFinishRequest2(JSONObject jsonObject) { + HttpResponse execute = null; + try { + String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); + AddressDto addressDto = addressService.findByCode("actionFinishRequest2"); + String url = wmsurl + addressDto.getMethods_url(); + log.info("feedbackDie - 反馈管芯请求路径{}", jsonObject); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", "", + String.valueOf(jsonObject), + "", jsonObject.getString("task_code") + "任务取货完成反馈"); + luceneLogService.interfaceExecuteLog(luceneLogDto); + try { + execute = HttpRequest.post(url) + .body(String.valueOf(jsonObject)) + .execute(); + } catch (Exception e) { + String msg = e.getMessage(); + log.info("feedbackDie-----输出参数{}", msg); + //网络不通 + } + } catch (Exception e) { + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", String.valueOf(execute.getStatus()), + JSON.toJSONString(execute.body()), + String.valueOf(execute.body()), jsonObject.getString("task_code") + "任务取货完成反馈失败"); + luceneLogService.interfaceExecuteLog(luceneLogDto); + } + } + @Override public HttpResponse feedbackDies(JSONObject param) { HttpResponse result2 = null; From 8762465bbabc087a37aa09630007d8706b5b81c1 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Thu, 27 Jun 2024 18:48:41 +0800 Subject: [PATCH 25/40] =?UTF-8?q?rev:=E4=BC=98=E5=8C=96=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=88=86=E5=88=87=E8=A1=8C=E6=9E=B6=E4=BB=BB=E5=8A=A1=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SlitTwoManipulatorDeviceDriver.java | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 0d6dfd394..083255ab0 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -403,41 +403,39 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl TaskDto task = null; for (int i = 0; i < getDeviceCodeList.size(); i++) { String startDeviceCode = getDeviceCodeList.get(i); - List taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode); + List taskDtos = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode); if (ObjectUtil.isNotEmpty(taskDtos)) { - //按照优先级排序 优先级相等按照创建时间排序 - taskDtos = this.sortTask(taskDtos); - TaskDto taskDto = taskDtos.get(0); - truss_type = taskDto.getTruss_type(); - //查询任务是行架任务 - if (!StrUtil.equals(taskDto.getTask_type(), "6")) { - taskDto = null; - continue; + //按照创建时间排序 + List taskDtoStream = taskDtos.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + if (ObjectUtil.isNotEmpty(taskDtoStream)) { + TaskDto taskDto = taskDtoStream.get(0); + this.executeReadyInst(taskDto); } - flag = this.executeReadyInst(taskDto); } else { - List taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); + List taskDtoList = taskserver.findByTrappedManipulatorReady(); if (ObjectUtil.isNotEmpty(taskDtoList)) { - //按照优先级排序 优先级相等按照创建时间排序 - taskDtoList = this.sortTask(taskDtoList); - for (int j = 0; j < taskDtoList.size(); j++) { - task = taskDtoList.get(j); - - // 6 行架任务 - if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) { - task = null; - continue; + List taskDtosReady = new ArrayList<>(); + for (TaskDto taskDto1 : taskDtoList) { + if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) { + taskDtosReady.add(taskDto1); } - if (ObjectUtil.isNotEmpty(task)) break; } + //按照优先级排序 优先级相等按照创建时间排序 + taskDtosReady = this.sortTask(taskDtosReady); + task = taskDtosReady.get(0); + } + if (!ObjectUtil.isEmpty(task)) { + break; } } } if (!ObjectUtil.isEmpty(task)) { - flag = this.executeReadyTask(task); + this.executeReadyTask(task); + } else { + notCreateInstMessage = "universal_notCreateInstMessage"; } + return true; } - return flag; } //执行已有就绪指令 From ce1d9377d5a14045769add15d4401a72e462ebd2 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Thu, 27 Jun 2024 18:50:58 +0800 Subject: [PATCH 26/40] opt --- .../slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java | 1 + 1 file changed, 1 insertion(+) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 083255ab0..a3399eeed 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -373,6 +373,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } } + if (!ObjectUtil.isEmpty(task)) { this.executeReadyTask(task); } else { From 2134dcfd33cfb6ce46cee33c873e9f19a6ce892a Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Thu, 27 Jun 2024 20:35:45 +0800 Subject: [PATCH 27/40] =?UTF-8?q?rev=20=20=E5=AF=B9=E6=8E=A5=E5=B7=A5?= =?UTF-8?q?=E4=BD=8D=E4=BF=A1=E5=8F=B7=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManipulatorAgvStationDeviceDriver.java | 55 ++++++++++++------- .../ToCommandControl.java | 31 +++++++++++ 2 files changed, 66 insertions(+), 20 deletions(-) create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java index 8cb62f565..9c3770c3d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java @@ -42,6 +42,9 @@ import java.util.Map; @RequiredArgsConstructor public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed { protected ItemProtocol itemProtocol = new ItemProtocol(this); + + protected ToCommandControl toCommandControl = new ToCommandControl(this); + @Autowired DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); @Autowired @@ -99,6 +102,10 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i return this.device; } + public ToCommandControl getToCommandControl() { + return this.toCommandControl; + } + /** * 请求成功标记 */ @@ -210,30 +217,38 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i this.setRequireSucess(false); } - public void writing(int command) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.ItemProtocol.item_to_command; - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("下发电气信号:" + itemMap) - .build(); - logDto.setLog_level(3); - luceneExecuteLogService.deviceExecuteLog(logDto); - try { - this.checkcontrol(itemMap); - } catch (Exception e) { + public void writing(int command){ +// String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() +// + "." + org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.ItemProtocol.item_to_command; +// Map itemMap = new HashMap(); +// itemMap.put(to_command, command); +// LuceneLogDto logDto = LuceneLogDto.builder() +// .device_code(device_code) +// .content("下发电气信号:" + itemMap) +// .build(); +// logDto.setLog_level(3); +// luceneExecuteLogService.deviceExecuteLog(logDto); +// try { +// this.checkcontrol(itemMap); +// } catch (Exception e) { +// e.printStackTrace(); +// try { +// this.checkcontrol(itemMap); +// } catch (Exception e1) { +// e1.printStackTrace(); +// } +// } + + try{ + this.toCommandControl.control(command); + } catch (Exception e){ e.printStackTrace(); - try { - this.checkcontrol(itemMap); - } catch (Exception e1) { - e1.printStackTrace(); - } } } - @Override + + + @Override public JSONObject getDeviceStatusName() { JSONObject jo = new JSONObject(); String mode = ""; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java new file mode 100644 index 000000000..92567876c --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java @@ -0,0 +1,31 @@ +package org.nl.acs.device_driver.two_conveyor.manipulator_agv_station; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import org.nl.acs.device_driver.driver.ItemValue; +import org.nl.acs.device_driver.stacker.standard_stacker.ItemProtocol; +import org.nl.acs.device_driver.stacker.standard_stacker.StandardStackerDeviceDriver; + +import java.util.HashMap; +import java.util.Map; + +public class ToCommandControl { + + private ManipulatorAgvStationDeviceDriver driver; + + public ToCommandControl(ManipulatorAgvStationDeviceDriver driver) { + this.driver = driver; + } + + public void control(int command) throws Exception { +// ItemValue[] itemValues = new ItemValue[]{new ItemValue(this.driver.getItem(ItemProtocol.item_to_command), command)}; + Map itemMap = new HashMap(); + String to_param = this.driver.getOpcServer() + "." + this.driver.getOpcPlc() + "." + this.driver.getDevice().getDevice_code() + + ".to_command"; + Object obj = command; + itemMap.put(to_param, obj); + this.driver.checkcontrol(itemMap); + } + +} From aa53ece8abed5a972db0e8b4ae61b771b6a2a347 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Fri, 28 Jun 2024 09:08:04 +0800 Subject: [PATCH 28/40] =?UTF-8?q?rev:=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlugPullDeviceSiteDeviceDriver.java | 13 ++++++++++-- .../SlitTwoManipulatorDeviceDriver.java | 2 +- .../src/views/monitor/lucene/index.vue | 21 ++++++++----------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 5bf38710b..12598ef8e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -361,12 +361,21 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl requireSucess = true; logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse); message = "申请套管成功"; - } else { + } + if (StrUtil.equals("2", is_bushing)){ + Map map = new LinkedHashMap<>(); + map.put("to_command", 97); + this.writing(map); + requireSucess = true; + message = "不套管,送空气轴"; + logServer.deviceExecuteLog(this.device_code, "", "", "不申请套管反馈,返回参数:" + applyPlugPullSitResponse); + } + if (StrUtil.equals("0", is_bushing)){ Map map = new LinkedHashMap<>(); map.put("to_command", 98); this.writing(map); requireSucess = true; - message = "不申请套管"; + message = "缺少纸管,人工确认"; logServer.deviceExecuteLog(this.device_code, "", "", "不申请套管反馈,返回参数:" + applyPlugPullSitResponse); } } else { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index a3399eeed..d98b4aa21 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -373,7 +373,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } } - + if (!ObjectUtil.isEmpty(task)) { this.executeReadyTask(task); } else { diff --git a/acs2/nladmin-ui/src/views/monitor/lucene/index.vue b/acs2/nladmin-ui/src/views/monitor/lucene/index.vue index 84f14c8c8..c9c20977d 100644 --- a/acs2/nladmin-ui/src/views/monitor/lucene/index.vue +++ b/acs2/nladmin-ui/src/views/monitor/lucene/index.vue @@ -14,18 +14,12 @@ > - - + - - - - - - - - - + + + + @@ -106,5 +100,8 @@ export default { From f614e469cbd854e8f1fc9a8d77ec4ddf47b3057b Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Fri, 28 Jun 2024 10:37:15 +0800 Subject: [PATCH 29/40] =?UTF-8?q?fix:=20=E6=97=A5=E5=BF=97=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/acs/agv/AgvWaitUtil.java | 110 ++++++++++-------- .../server/impl/XianGongAgvServiceImpl.java | 82 ++++++------- .../ManipulatorAgvStationDeviceDriver.java | 13 +-- .../wms/service/impl/AcsToWmsServiceImpl.java | 2 +- .../main/resources/log/NDCAgvServiceImpl.xml | 2 +- .../log/OneNDCSocketConnectionAutoRun.xml | 2 +- .../log/TwoNDCSocketConnectionAutoRun.xml | 2 +- .../main/resources/log/XgAgvDeviceDriver.xml | 2 +- .../resources/log/XianGongAgvServiceImpl.xml | 29 +++++ .../src/main/resources/logback-spring.xml | 1 + 10 files changed, 140 insertions(+), 105 deletions(-) create mode 100644 acs2/nladmin-system/nlsso-server/src/main/resources/log/XianGongAgvServiceImpl.xml 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 b2035a536..0207bb0cd 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 @@ -49,36 +49,38 @@ public class AgvWaitUtil { ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver; //agv诺宝对接位安全信号交互 - if(startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver){ + if (startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(2); - 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()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - throw new BadRequestException("行架不允许取货"); + if (manipulatorAgvStationDeviceDriver.getTo_command() != 2) { + manipulatorAgvStationDeviceDriver.writing(2); + 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()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + throw new BadRequestException("行架不允许取货"); + } } } //agv叉车对接位安全信号交互 - if(startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver){ + 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("叉车允许取货") @@ -90,10 +92,10 @@ public class AgvWaitUtil { map.put("message", "允许取货!"); log.info("允许仙工AGV取货,设备号 - {}", startDeviceCode); return map; - }else { + } else { LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("agv叉车对接位输送线不允许取货:" + inst.getCarno()+ "点位号"+ boxSubvolumesConveyorDeviceDriver.getDevice_code()) + .content("agv叉车对接位输送线不允许取货:" + inst.getCarno() + "点位号" + boxSubvolumesConveyorDeviceDriver.getDevice_code()) .build(); logDto1.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto1); @@ -115,19 +117,23 @@ public class AgvWaitUtil { //如果是叉车,取货完成给输送线完成信号 Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode); ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; - if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())){ - if(startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver) { + if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { + if (startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver) { BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver; boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) startDevice.getDeviceDriver(); - boxSubvolumesConveyorDeviceDriver.writing(3); + if (boxSubvolumesConveyorDeviceDriver.getTo_command() != 3) { + boxSubvolumesConveyorDeviceDriver.writing(3); + } } } //诺宝agv调lms更新点位 - if(inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())){ + if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { applyLmsGetOut(inst); - if(startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + if (startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(3); + if (manipulatorAgvStationDeviceDriver.getTo_command() != 3) { + manipulatorAgvStationDeviceDriver.writing(3); + } } } @@ -145,7 +151,7 @@ public class AgvWaitUtil { param.put("actionType", ActionTypeEnum.IN_FINISHING.getCode().toString()); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("诺宝取货完成:" + inst.getTask_code() + "--" + ActionTypeEnum.IN_FINISHING.getCode().toString()) + .content("诺宝取货完成请求lms:" + inst.getTask_code() + "--" + ActionTypeEnum.IN_FINISHING.getCode().toString()) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -154,7 +160,7 @@ public class AgvWaitUtil { if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("追加动诺宝作块,参数,接口返回:" + jo) + .content("诺宝取货完成请求lms,参数,接口返回:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -177,23 +183,25 @@ public class AgvWaitUtil { log.info("仙工AGV请求放货,设备号 - {}", endDeviceCode); Device endDevice = deviceAppService.findDeviceByCode(endDeviceCode); ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; - if(endDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver){ + if (endDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) endDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(4); - if(manipulatorAgvStationDeviceDriver.getAction() != 1){ - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(inst.getCarno()) - .content("agv诺宝对接位行架不允许放货:" + inst.getCarno()+ "点位号"+ manipulatorAgvStationDeviceDriver.getDevice_code()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", endDevice); - throw new BadRequestException("上位系统不允许取货"); + if (manipulatorAgvStationDeviceDriver.getTo_command() != 4) { + manipulatorAgvStationDeviceDriver.writing(4); + if (manipulatorAgvStationDeviceDriver.getAction() != 1) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("agv诺宝对接位行架不允许放货:" + inst.getCarno() + "点位号" + manipulatorAgvStationDeviceDriver.getDevice_code()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", endDevice); + throw new BadRequestException("上位系统不允许取货"); + } } } LuceneLogDto logDto = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("允许放货"+ "点位" + endDeviceCode) + .content("允许放货" + "点位" + endDeviceCode) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -207,12 +215,14 @@ public class AgvWaitUtil { //放货完成等待 public JSONObject waitOutPut(String endDeviceCode, Instruction inst) { - Device nextDevice = deviceAppService.findDeviceByCode(inst.getNext_device_code()); + Device nextDevice = deviceAppService.findDeviceByCode(endDeviceCode); ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; - if(inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())){ - if(nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { + if (nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) nextDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(5); + if (manipulatorAgvStationDeviceDriver.getTo_command() != 5) { + manipulatorAgvStationDeviceDriver.writing(5); + } } } 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 6f23d43ca..9b5c3533d 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 @@ -62,7 +62,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { @Autowired private LuceneExecuteLogService luceneExecuteLogService; @Autowired - private DeviceAppService deviceAppservice; + private DeviceAppService deviceAppservice; @Autowired @@ -379,7 +379,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { jo1.put("blockId", IdUtil.simpleUUID()); jo1.put("location", pointCode); jo1.put("operation", "JackLoad"); - inspectInStocckSet(ja, pointCode, jo1); + inspectInStocckSet(pointCode, jo1); + ja.add(jo1); JSONObject jo2 = new JSONObject(); jo2.put("blockId", IdUtil.simpleUUID()); jo2.put("location", pointCode + "OUTGET"); @@ -400,22 +401,24 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - private void inspectInStocckSet(JSONArray ja, String pointCode, JSONObject jo1) { + private void inspectInStocckSet( String pointCode, JSONObject jo1) { Device device = deviceAppservice.findDeviceByCode(pointCode); StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - String inspectInStocck = (String)device.getExtraValue().get("inspect_in_stocck"); - if (StrUtil.isNotEmpty( inspectInStocck) && inspectInStocck.equals("true")){ + String inspectInStocck = (String) device.getExtraValue().get("inspect_in_stocck"); + if (StrUtil.isNotEmpty(inspectInStocck) && inspectInStocck.equals("true")) { jo1.put("operationArgs", new JSONObject() {{ - put("recognize",false); + put("recognize", false); }}); - ja.add(jo1); - }else { + } else { jo1.put("operationArgs", new JSONObject() {{ put("recognize", true); }}); - ja.add(jo1); } + } else { + jo1.put("operationArgs", new JSONObject() {{ + put("recognize", true); + }}); } } @@ -752,26 +755,25 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } //一楼诺宝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(); - 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 (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); - deviceCodeNow = "ZXQ_05"; - sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), deviceCodeNow, instructionDto); - return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); - } + if (address.contains("GET")) { + return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); + } else if (address.contains("PUT")) { return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); } + //如果是取货二次分配,取放货二次分配需要重新追加动作块 + 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(); + String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); + return agvWaitUtil.waitInGet(newPointCode, instructionDto); + } + //如果是放货二次分配,取放货二次分配需要重新追加动作块 + 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(); + String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); +// sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), deviceCodeNow, instructionDto); + return agvWaitUtil.waitInPut(newPointCode, instructionDto); + } } //一楼叉车 if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { @@ -783,13 +785,13 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (address.contains("WAIT")) { String newPointCode = applyCCAgvTask(task_code, instructionDto); LuceneLogDto logDto = LuceneLogDto.builder() - .content("叉车允许放货"+"新点位:"+newPointCode) + .content("叉车允许放货" + "新点位:" + newPointCode) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); JSONObject map = new JSONObject(); map.put("status", 200); - map.put("message", "允许叉车放货!"+"点位"+newPointCode); + map.put("message", "允许叉车放货!" + "点位" + newPointCode); log.info("允许仙工AGV放货,设备号 - {}", newPointCode); return map; } @@ -824,7 +826,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { param.put("task_code", task_code); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动叉车作块,参数:" + task_code) + .content("叉车二次分配请求lms,参数:" + task_code) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -833,7 +835,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动叉车作块,参数,接口返回:" + jo) + .content("叉车二次分配请求lms,参数,接口返回:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -844,11 +846,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动叉车作块失败,返回参数:" + jo.getString("body")) + .content("叉车二次分配请求lms失败,返回参数:" + jo.getString("message")) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); - throw new BadRequestException("追加动叉车作块返回失败"); + throw new BadRequestException("叉车二次分配请求lms返回失败"); } } catch (Exception e) { e.printStackTrace(); @@ -939,7 +941,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { param.put("actionType", actionType.toString()); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动诺宝作块,参数:" + task_code + "--" + actionType) + .content("二次分配请求lms,参数:" + task_code + "--" + actionType) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -948,7 +950,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动诺宝作块,参数,接口返回:" + jo) + .content("二次分配请求lms,参数,接口返回:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -961,11 +963,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动诺宝作块失败,返回参数:" + jo.getString("body")) + .content("二次分配请求lms,返回参数:" + jo.getString("body")) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); - throw new BadRequestException("追加动诺宝作块返回失败"); + throw new BadRequestException("二次分配请求lms返回失败"); } } catch (Exception e) { e.printStackTrace(); @@ -1069,7 +1071,7 @@ 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()); @@ -1078,9 +1080,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { private Object createBlocksDataTowEnd(String instructionCode, String point, Instruction instructionDto) { JSONArray ja = new JSONArray(); - String nextDeviceCode = instructionDto.getNext_device_code(); //终点2 - sendEndDeviceOrder3(ja, nextDeviceCode, instructionCode, instructionDto); + sendEndDeviceOrder3(ja, point, instructionCode, instructionDto); return ja; } @@ -1178,7 +1179,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { jo1.put("blockId", IdUtil.simpleUUID()); jo1.put("location", startPoint); jo1.put("operation", "JackLoad"); - inspectInStocckSet(ja, startPoint, jo1); + inspectInStocckSet(startPoint, jo1); + ja.add(jo1); JSONObject jo2 = new JSONObject(); jo2.put("blockId", IdUtil.simpleUUID()); jo2.put("location", startPoint + "OUTGET"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java index 9c3770c3d..43c20aee4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java @@ -123,9 +123,6 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i if (mode != last_mode) { this.setRequireSucess(false); - if (mode == 2) { - this.writing(0); - } } } catch (Exception var17) { return; @@ -265,14 +262,10 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i } else if (this.getMode() == 3) { mode = LangProcess.msg("universal_operation"); } - if (this.getAction() == 1) { + if (this.getAction() == 0) { + action = LangProcess.msg("universal_actionMessage1"); + } else if (this.getAction() == 1) { action = LangProcess.msg("universal_delivery"); - } else if (this.getAction() == 2) { - action = LangProcess.msg("universal_completed"); - } else if (this.getAction() == 3) { - action = LangProcess.msg("universal_releasing"); - } else if (this.getAction() == 4) { - action = LangProcess.msg("universal_releasing_completed"); } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 9dd4ef120..36d3c397f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -641,7 +641,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String secondaryAllocationPoint(JSONObject param) { try { MDC.put(log_file_type, log_type); - log.info("applyTaskToWms-----输入参数{}", param); + log.info("secondaryAllocationPoint-----输入参数{}", param); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("secondaryAllocationPoint"); String url = wmsurl + addressDto.getMethods_url(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/NDCAgvServiceImpl.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/NDCAgvServiceImpl.xml index f13d96f5f..4ad8c2e02 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/log/NDCAgvServiceImpl.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/NDCAgvServiceImpl.xml @@ -10,7 +10,7 @@ 15 - 200MB + 50MB 2GB diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml index 8f4151a72..4d8d438ff 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml @@ -10,7 +10,7 @@ 15 - 200MB + 50MB 2GB diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml index 63517b12f..6f9b53f82 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml @@ -10,7 +10,7 @@ 15 - 200MB + 50MB 2GB diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/XgAgvDeviceDriver.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/XgAgvDeviceDriver.xml index d47c53012..885cf5920 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/log/XgAgvDeviceDriver.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/XgAgvDeviceDriver.xml @@ -10,7 +10,7 @@ 15 - 100MB + 50MB 2GB diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/XianGongAgvServiceImpl.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/XianGongAgvServiceImpl.xml new file mode 100644 index 000000000..02c3cf8f7 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/XianGongAgvServiceImpl.xml @@ -0,0 +1,29 @@ + + + + + + + + + ${LOG_HOME}/仙工agv请求/%d{yyyy-MM-dd}.%i.log + + 15 + + 50MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} + + + + + + + + + diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml index 158891bd8..a070661e3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml @@ -23,6 +23,7 @@ https://juejin.cn/post/6844903775631572999 + From 9d8e61c25935397e06b3c59085cf28ade2dc7826 Mon Sep 17 00:00:00 2001 From: yanps Date: Fri, 28 Jun 2024 11:27:19 +0800 Subject: [PATCH 30/40] =?UTF-8?q?add:=E6=B7=BB=E5=8A=A0=E8=A1=8C=E6=9E=B6-?= =?UTF-8?q?agv=E5=AF=B9=E6=8E=A5=E4=BD=8D=E5=8F=96=E8=B4=A7=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/acs/device/driver/manipulator_agv_station.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/acs2/nladmin-ui/src/views/acs/device/driver/manipulator_agv_station.vue b/acs2/nladmin-ui/src/views/acs/device/driver/manipulator_agv_station.vue index 08d9e2a80..e0c4a5037 100644 --- a/acs2/nladmin-ui/src/views/acs/device/driver/manipulator_agv_station.vue +++ b/acs2/nladmin-ui/src/views/acs/device/driver/manipulator_agv_station.vue @@ -80,6 +80,11 @@ + + + + + From 6955df3274bfcbd032acc717ea062d2568be1384 Mon Sep 17 00:00:00 2001 From: yanps Date: Fri, 28 Jun 2024 11:28:54 +0800 Subject: [PATCH 31/40] =?UTF-8?q?opt:=20=E5=8F=96=E8=B4=A7=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=8F=8D=E9=A6=88=E6=97=A5=E5=BF=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 9dd4ef120..307923931 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -684,10 +684,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("actionFinishRequest2"); String url = wmsurl + addressDto.getMethods_url(); - log.info("feedbackDie - 反馈管芯请求路径{}", jsonObject); + log.info("actionFinishRequest2 - 设备工位取货完成反馈{}", jsonObject); LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", "", String.valueOf(jsonObject), - "", jsonObject.getString("task_code") + "任务取货完成反馈"); + "", jsonObject.getString("task_code") + "设备工位取货完成反馈"); luceneLogService.interfaceExecuteLog(luceneLogDto); try { execute = HttpRequest.post(url) @@ -701,7 +701,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } catch (Exception e) { LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", String.valueOf(execute.getStatus()), JSON.toJSONString(execute.body()), - String.valueOf(execute.body()), jsonObject.getString("task_code") + "任务取货完成反馈失败"); + String.valueOf(execute.body()), jsonObject.getString("task_code") + "设备工位取货完成反馈失败"); luceneLogService.interfaceExecuteLog(luceneLogDto); } } From ed59096b164c14a56caa0bfcce481172262a417c Mon Sep 17 00:00:00 2001 From: yanps Date: Fri, 28 Jun 2024 16:04:18 +0800 Subject: [PATCH 32/40] =?UTF-8?q?opt:=20=E6=B7=BB=E5=8A=A0=E6=99=AE?= =?UTF-8?q?=E9=80=9A=E7=AB=99=E7=82=B9=E5=8F=96=E8=B4=A7=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 33 +++++++++++++++---- .../device/driver/standard_ordinary_site.vue | 5 +++ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 6a99fb316..8b2c1dfa8 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -570,15 +570,30 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } + String task_code = inst.getTask_code(); + EXECUTOR.submit(() -> { + if(ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDevice_code()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + acsToWmsService.actionFinishRequest2(jsonObject); + } + }); this.setPhase(phase); } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - try { - manipulatorAgvStationDeviceDriver.writing(3); + /*try { + // manipulatorAgvStationDeviceDriver.writing(3); } catch (Exception e) { e.printStackTrace(); - } + }*/ data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) @@ -588,15 +603,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); String task_code = inst.getTask_code(); EXECUTOR.submit(() -> { - boolean feedbackToLms = (boolean)manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"); - if(feedbackToLms){ + if(ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())){ JSONObject jsonObject = new JSONObject(); jsonObject.put("task_code", task_code); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDevice_code()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); acsToWmsService.actionFinishRequest2(jsonObject); } }); - - } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { 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 4c0e63e5c..1e0064849 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 @@ -38,6 +38,11 @@ + + + + + From a627c9c74caa3ea1f741ab4f23ef2b089a145897 Mon Sep 17 00:00:00 2001 From: yanps Date: Fri, 28 Jun 2024 16:06:14 +0800 Subject: [PATCH 33/40] =?UTF-8?q?opt:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 8b2c1dfa8..bc0e4b48f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -588,12 +588,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic this.setPhase(phase); } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - - /*try { - // manipulatorAgvStationDeviceDriver.writing(3); + try { + manipulatorAgvStationDeviceDriver.writing(3); } catch (Exception e) { e.printStackTrace(); - }*/ + } data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) From 47613fdbbc9fc19305e25fb6f133d5c8926625a9 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Sat, 29 Jun 2024 15:10:35 +0800 Subject: [PATCH 34/40] =?UTF-8?q?fix:=20=E4=BB=99=E5=AE=AB=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/acs/agv/AgvWaitUtil.java | 68 ++++++------- .../server/impl/XianGongAgvServiceImpl.java | 97 +++++++++++++++++-- acs2/nladmin-ui/src/i18n/langs/task/en.js | 1 + acs2/nladmin-ui/src/i18n/langs/task/in.js | 1 + acs2/nladmin-ui/src/i18n/langs/task/zh.js | 1 + acs2/nladmin-ui/src/views/acs/task/index.vue | 1 + 6 files changed, 127 insertions(+), 42 deletions(-) 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 0207bb0cd..ce04c7aef 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 @@ -53,28 +53,29 @@ public class AgvWaitUtil { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); if (manipulatorAgvStationDeviceDriver.getTo_command() != 2) { manipulatorAgvStationDeviceDriver.writing(2); - 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()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - throw new BadRequestException("行架不允许取货"); - } } + 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()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + throw new BadRequestException("行架不允许取货"); + } + } //agv叉车对接位安全信号交互 @@ -103,8 +104,8 @@ public class AgvWaitUtil { } } JSONObject map = new JSONObject(); - map.put("status", 400); - map.put("message", "取货点位信息不对!"); + map.put("status", 200); + map.put("message", "允许取货!"); log.info("允许仙工AGV取货,设备号 - {}", startDeviceCode); return map; } @@ -187,17 +188,18 @@ public class AgvWaitUtil { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) endDevice.getDeviceDriver(); if (manipulatorAgvStationDeviceDriver.getTo_command() != 4) { manipulatorAgvStationDeviceDriver.writing(4); - if (manipulatorAgvStationDeviceDriver.getAction() != 1) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(inst.getCarno()) - .content("agv诺宝对接位行架不允许放货:" + inst.getCarno() + "点位号" + manipulatorAgvStationDeviceDriver.getDevice_code()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", endDevice); - throw new BadRequestException("上位系统不允许取货"); - } } + if (manipulatorAgvStationDeviceDriver.getAction() != 1) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("agv诺宝对接位行架不允许放货:" + inst.getCarno() + "点位号" + manipulatorAgvStationDeviceDriver.getDevice_code()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", endDevice); + throw new BadRequestException("上位系统不允许取货"); + } + } LuceneLogDto logDto = LuceneLogDto.builder() .device_code(inst.getCarno()) 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 9b5c3533d..c4efa45c2 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 @@ -8,6 +8,7 @@ import cn.hutool.http.HttpResponse; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import jodd.util.StringUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.AcsConfig; @@ -18,7 +19,6 @@ 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; @@ -29,8 +29,9 @@ import org.nl.acs.device.enums.DeviceType; import org.nl.acs.task.enums.ActionTypeEnum; import org.nl.acs.task.enums.AgvActionTypeEnum; import org.nl.acs.task.enums.AgvSystemTypeEnum; +import org.nl.acs.task.service.TaskService; +import org.nl.acs.task.service.dto.TaskDto; 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; @@ -59,6 +60,9 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { @Autowired private InstructionService instructionService; + @Autowired + private TaskService taskserver; + @Autowired private LuceneExecuteLogService luceneExecuteLogService; @Autowired @@ -401,7 +405,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - private void inspectInStocckSet( String pointCode, JSONObject jo1) { + private void inspectInStocckSet(String pointCode, JSONObject jo1) { Device device = deviceAppservice.findDeviceByCode(pointCode); StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { @@ -765,14 +769,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { 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(); String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); - return agvWaitUtil.waitInGet(newPointCode, instructionDto); + log.info("取货二次分配追加诺宝成功,新点位 - {}", newPointCode); } //如果是放货二次分配,取放货二次分配需要重新追加动作块 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(); String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); // sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), deviceCodeNow, instructionDto); - return agvWaitUtil.waitInPut(newPointCode, instructionDto); + log.info("放货二次分配追加诺宝成功,新点位 - {}", newPointCode); } } //一楼叉车 @@ -810,10 +814,19 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (address.contains("GET")) { //取货完成 - return agvWaitUtil.waitOutGet(deviceCodeNow, instructionDto); + JSONObject jsonObject = agvWaitUtil.waitOutGet(deviceCodeNow, instructionDto); + if (StringUtil.equals("200",jsonObject.getString("status"))){ + log.info("允许仙工AGV取货完成后请求离开,设备号 - {}", deviceCodeNow); + return jsonObject; + } } else if (address.contains("PUT")) { //放货完成 - return agvWaitUtil.waitOutPut(deviceCodeNow, instructionDto); + JSONObject jsonObject = agvWaitUtil.waitOutPut(deviceCodeNow, instructionDto); + if (StringUtil.equals("200",jsonObject.getString("status"))){ + log.info("允许仙工AGV取货完成后请求离开,设备号 - {}", deviceCodeNow); + return jsonObject; + } + } } @@ -953,6 +966,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { .content("二次分配请求lms,参数,接口返回:" + jo) .build(); logDto2.setLog_level(4); + //二次分配更新点位 + updataTask(instructionDto, jo.getString("data")); luceneExecuteLogService.deviceExecuteLog(logDto2); if (!ActionTypeEnum.IN_FINISHING.getCode().equals(actionType)) { //请求成功调用诺宝追加动作块 @@ -976,6 +991,26 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { return null; } + private void updataTask(Instruction instructionDto, String newPoint) { + + TaskDto taskUpdate = new TaskDto(); + if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { + instructionDto.setStart_point_code(newPoint); + taskUpdate.setStart_point_code(newPoint); + instructionDto.setStart_device_code(newPoint); + taskUpdate.setStart_device_code(newPoint); + } + if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { + instructionDto.setNext_point_code(newPoint); + taskUpdate.setNext_point_code(newPoint); + instructionDto.setNext_device_code(newPoint); + taskUpdate.setNext_device_code(newPoint); + } + taskUpdate.setTask_id(instructionDto.getTask_id()); + instructionService.update(instructionDto); + taskserver.update(taskUpdate); + } + @Override public HttpResponse sendOrderSequencesToForklift(Instruction inst, InteractionJsonDTO interactionJsonDTO) { @@ -1087,6 +1122,25 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } private void sendEndDeviceOrder3(JSONArray ja, String nextDeviceCode, String instructionCode, Instruction instructionDto) { + JSONObject jo3 = new JSONObject(); + jo3.put("blockId", IdUtil.simpleUUID()); + jo3.put("location", nextDeviceCode + "INPUT"); + jo3.put("operation", "script"); + jo3.put("id", nextDeviceCode + "INPUT"); + jo3.put("script_name", "userpy/interact.py"); + JSONObject script_args3 = new JSONObject(); + script_args3.put("addr", addr); + JSONObject data3 = new JSONObject(); + JSONObject reach3 = new JSONObject(); + reach3.put("task_code", instructionCode); + reach3.put("address", nextDeviceCode + "INPUT"); + data3.put("reach", reach3); + script_args3.put("data", data3); + script_args3.put("protocol", "HTTP"); + jo3.put("script_args", script_args3); + ja.add(jo3); + + //将货物放下 com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject(); jo4.put("blockId", IdUtil.simpleUUID()); @@ -1119,7 +1173,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { JSONArray ja = new JSONArray(); String nextDeviceCode = instructionDto.getNext_device_code(); //起点2 - sendStartDeviceOrder2(ja, startPoint, instructionCode); + sendStartDeviceOrder2(ja, startPoint, instructionCode, instructionDto); //终点2 sendEndDeviceOrder2(ja, nextDeviceCode, instructionCode, instructionDto); return ja; @@ -1173,7 +1227,32 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - private void sendStartDeviceOrder2(JSONArray ja, String startPoint, String instructionCode) { + private void sendStartDeviceOrder2(JSONArray ja, String startPoint, String instructionCode, Instruction instructionDto) { + //取货前等待 + JSONObject jo = new JSONObject(); + //动作块id + jo.put("blockId", IdUtil.simpleUUID()); + //目的地名称 + jo.put("location", startPoint + "INGET"); + //执行脚本 + jo.put("operation", "script"); + jo.put("id", startPoint + "INGET"); + //通信脚本,动作前后与现场设备交互的场景 + jo.put("script_name", "userpy/interact.py"); + JSONObject script_args = new JSONObject(); + //更改为现场设备IP及PORT + script_args.put("addr", addr); + JSONObject data = new JSONObject(); + JSONObject reach = new JSONObject(); + reach.put("task_code", instructionCode); + reach.put("address", startPoint + "INGET"); + data.put("reach", reach); + script_args.put("data", data); + script_args.put("protocol", "HTTP"); + jo.put("script_args", script_args); + ja.add(jo); + + //将货物顶起来,机器识别提升高度 JSONObject jo1 = new JSONObject(); jo1.put("blockId", IdUtil.simpleUUID()); diff --git a/acs2/nladmin-ui/src/i18n/langs/task/en.js b/acs2/nladmin-ui/src/i18n/langs/task/en.js index 1a450c80f..9d7584ae9 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/en.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/en.js @@ -7,6 +7,7 @@ export default { 'Task_status': 'Task Status', 'Origin_or_destination': 'Origin Or Destination', 'Task_type': 'Task Type', + 'Action_type': 'Action Type', 'Warehouse_task_type': 'Warehouse Task Type', 'AGV_system': 'AGV System', 'Routing_scheme': 'Routing Scheme', diff --git a/acs2/nladmin-ui/src/i18n/langs/task/in.js b/acs2/nladmin-ui/src/i18n/langs/task/in.js index c64ecb3d2..44e14cb5b 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/in.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/in.js @@ -7,6 +7,7 @@ export default { 'Task_status': 'Status Tugas', 'Origin_or_destination': 'Asal Atau Tujuan', 'Task_type': 'Jenis Tugas', + 'Action_type': 'Tipe tugas sekunder', 'Warehouse_task_type': 'Jenis Tugas Gudang', 'AGV_system': 'Sistem AGV', 'Routing_scheme': 'Skema Routing', diff --git a/acs2/nladmin-ui/src/i18n/langs/task/zh.js b/acs2/nladmin-ui/src/i18n/langs/task/zh.js index a2d04657a..7a63d004b 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/zh.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/zh.js @@ -7,6 +7,7 @@ export default { 'Task_status': '任务状态', 'Origin_or_destination': '输入起点或终点', 'Task_type': '任务类型', + 'Action_type': '二次分配类型', 'Warehouse_task_type': '立库任务类型', 'AGV_system': 'agv系统', 'Routing_scheme': '路由方案', diff --git a/acs2/nladmin-ui/src/views/acs/task/index.vue b/acs2/nladmin-ui/src/views/acs/task/index.vue index 88c42db4c..591b09a86 100644 --- a/acs2/nladmin-ui/src/views/acs/task/index.vue +++ b/acs2/nladmin-ui/src/views/acs/task/index.vue @@ -505,6 +505,7 @@ + + + + diff --git a/acs2/nladmin-ui/src/views/acs/task/index.vue b/acs2/nladmin-ui/src/views/acs/task/index.vue index 591b09a86..28fe6037d 100644 --- a/acs2/nladmin-ui/src/views/acs/task/index.vue +++ b/acs2/nladmin-ui/src/views/acs/task/index.vue @@ -505,12 +505,20 @@ - + + + +