From 6da0f596bcc6bda09878c1f3b85978c516a8e0af Mon Sep 17 00:00:00 2001 From: yanps Date: Wed, 20 Mar 2024 14:26:44 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E5=A2=9E=E5=8A=A0=E4=BA=8C=E6=A5=BCNDC?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../run/TwoNDCSocketConnectionAutoRun.java | 3 +- .../nl/acs/opc/DeviceOpcProtocolRunable.java | 4 +-- .../log/OneNDCSocketConnectionAutoRun.xml | 4 +-- .../log/TwoNDCSocketConnectionAutoRun.xml | 33 +++++++++++++++++++ .../src/main/resources/logback-spring.xml | 1 + 5 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml 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 f4c18fdda..17c83cd98 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 @@ -256,7 +256,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); try { - standardAutodoorDeviceDriver.writing("to_command", 2); + standardAutodoorDeviceDriver.writing("to_close", "1"); + standardAutodoorDeviceDriver.writing("to_open", "0"); } catch (Exception e) { log.info("下发电气信号失败:" + e.getMessage()); e.printStackTrace(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index 605b76565..c01690d14 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -414,7 +414,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time")) { // 存在上次点位值为null情况 则不记录日志 LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), - String.valueOf(itemDto.getHis_item_value()), String.valueOf(value)); + String.valueOf(his), String.valueOf(value)); luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc()); log.info("{}", JSON.toJSONString(luceneLogDto)); } @@ -434,7 +434,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC // log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time")) { LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), - String.valueOf(itemDto.getHis_item_value()), String.valueOf(value)); + String.valueOf(his), String.valueOf(value)); luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc()); log.info("{}", JSON.toJSONString(luceneLogDto)); } 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 ca3f78791..8f4151a72 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 @@ -3,7 +3,7 @@ - + ${LOG_HOME}/一楼NDC系统/%d{yyyy-MM-dd}.%i.log @@ -28,6 +28,6 @@ - + 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 new file mode 100644 index 000000000..63517b12f --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml @@ -0,0 +1,33 @@ + + + + + + + + + ${LOG_HOME}/二楼NDC系统/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 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 5e8238e7f..f53004205 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 @@ -20,6 +20,7 @@ https://juejin.cn/post/6844903775631572999 +