From d428fefcd9f25bc86de0c887f0273381e9a6bd09 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Fri, 16 Aug 2024 20:26:26 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=92=8C=E5=A0=86=E5=9E=9B=E6=9C=BA=E5=BC=82=E5=B8=B8=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...InspectionScannerConveyorDeviceDriver.java | 6 ++++++ .../enums/ErrorEnum.java | 19 ++++++++++++++++++- .../StripConveyorDeviceDriver.java | 13 ++++++++++++- .../StandardStackerDeviceDriver.java | 10 +++++----- .../java/org/nl/config/mqtt2/MqttService.java | 1 + .../resources/config/application-dev2.yml | 2 +- 6 files changed, 43 insertions(+), 8 deletions(-) diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java index 4ae2508..ff49041 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java @@ -343,6 +343,12 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut); } else { this.requireTime = currentTimeMillis; + TaskDto taskDto = taskService.findReadyByVehicleCode(this.barcode); + if (ObjectUtil.isNotEmpty(taskDto)) { + this.writing(ItemProtocol.TO_COMMAND.getKey(), CommandEnum.COMMAND_6.getValue()); + this.requireSuccess = true; + return; + } JSONObject param = new JSONObject(); param.put(this.barcode, this.currentDeviceCode); CommonRequest request = diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/enums/ErrorEnum.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/enums/ErrorEnum.java index dfc2553..a9c377e 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/enums/ErrorEnum.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/enums/ErrorEnum.java @@ -11,7 +11,24 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum ErrorEnum { - NO(0, "无报警"); + NO(0, "无报警"), + ERROR1(1, "输送驱动故障"), + ERROR2(2, "顶升驱动故障"), + ERROR3(3, "移栽驱动故障"), + ERROR4(4, "称重故障"), + ERROR5(5, "外形检测故障"), + ERROR6(6, "扫码失败"), + ERROR7(7, "前超差"), + ERROR8(8, "后超差"), + ERROR9(9, "高超差"), + ERROR10(10, "左超差"), + ERROR11(11, "右超差"), + ERROR12(12, "输送超时"), + ERROR13(13, "电动阻挡上升故障"), + ERROR14(14, "电动阻挡下降故障"), + ERROR15(15, "急停被触发"), + ERROR16(16, "提升机上限位被触发"), + ERROR17(17, "提升机下限位被触发"); private int value; private String label; diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/StripConveyorDeviceDriver.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/StripConveyorDeviceDriver.java index 0cc45d3..bbbc52c 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/StripConveyorDeviceDriver.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/StripConveyorDeviceDriver.java @@ -12,6 +12,9 @@ import org.nl.config.SpringContextHolder; import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; +import java.util.Arrays; +import java.util.List; + @Slf4j @Getter @Setter @@ -71,6 +74,12 @@ public class StripConveyorDeviceDriver extends AbstractOpcDeviceDriver implement */ private long requireTimeOut = 3000L; + /** + * 不需要记录日志的点位 + */ + private static final List No_SET_LOG_KEYS = Arrays.asList(org.nl.acs.device.driver.conveyor.appearance_inspection_scannner_conveyor.ItemProtocol.HEARTBEAT.getKey()); + + @Override public Device getDevice() { return this.device; @@ -83,7 +92,9 @@ public class StripConveyorDeviceDriver extends AbstractOpcDeviceDriver implement @Override public void setLog(String key, Object newValue, Object oldValue) { - logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "自动线程读取信号:" + key + ",由" + oldValue + "->" + newValue)); + if (!No_SET_LOG_KEYS.contains(key)) { + logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "自动线程读取信号:" + key + ",由" + oldValue + "->" + newValue)); + } } @Override diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java index cdc88f3..05b4c27 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java @@ -481,7 +481,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } if (this.front_Zerror == ErrorEnum.ZD.getCode() && this.back_Zerror == ErrorEnum.ZD.getCode() - && this.front_command == CommandEnum.PICKUP.getStatus() && this.back_command == CommandEnum.PICKUP.getStatus() + && this.front_forkCargo == 0 && this.back_forkCargo == 0 ) { if (!this.againRequireSuccess) { this.getzD(this.front_task); @@ -489,26 +489,26 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } } else if (this.front_Zerror == ErrorEnum.ZD.getCode()) { if (!this.againRequireSuccess) { - if (this.front_command == CommandEnum.PICKUP.getStatus()) { + if (this.front_forkCargo == 0) { this.getzD(this.front_task); Instruction back_inst = instructionService.findByCodeFromCache(String.valueOf(this.back_task)); if (ObjectUtil.isNotEmpty(back_inst)) { this.backWrite(back_inst); } - } else if (this.front_command == CommandEnum.RELEASE.getStatus()) { + } else if (this.front_forkCargo == 2) { this.putzD(this.front_task, ForkTypeEnum.FRONT.getCode()); } } return; } else if (this.back_Zerror == ErrorEnum.ZD.getCode()) { if (!this.againRequireSuccess) { - if (this.back_command == CommandEnum.PICKUP.getStatus()) { + if (this.back_forkCargo == 0) { this.getzD(this.back_task); Instruction front_inst = instructionService.findByCodeFromCache(String.valueOf(this.front_task)); if (ObjectUtil.isNotEmpty(front_inst)) { this.frontWrite(front_inst); } - } else if (this.back_command == CommandEnum.RELEASE.getStatus()) { + } else if (this.back_forkCargo == 2) { this.putzD(this.back_task, ForkTypeEnum.BACK.getCode()); } } diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/config/mqtt2/MqttService.java b/nladmin-system/nlsso-server/src/main/java/org/nl/config/mqtt2/MqttService.java index 14b9a2d..53a5d2f 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/config/mqtt2/MqttService.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/config/mqtt2/MqttService.java @@ -146,6 +146,7 @@ public class MqttService { @PostConstruct public void init() { + log.info("执行MQTT初始化"); initTopicMap(); loadTags(); initMqttClient(); diff --git a/nladmin-system/nlsso-server/src/main/resources/config/application-dev2.yml b/nladmin-system/nlsso-server/src/main/resources/config/application-dev2.yml index dd9fb8b..83f6420 100644 --- a/nladmin-system/nlsso-server/src/main/resources/config/application-dev2.yml +++ b/nladmin-system/nlsso-server/src/main/resources/config/application-dev2.yml @@ -80,7 +80,7 @@ spring: username: root password: 123456 cleanSession: true - url: 192.168.1.218 + url: 10.211.55.3 clientId: hs_mqtt21 topics: - HS/#