From f8da80317c79abf857335ffb75c91c0d4f1d8497 Mon Sep 17 00:00:00 2001 From: psh Date: Wed, 12 Jun 2024 13:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A9=B1=E5=8A=A8=E5=86=99=E5=85=A5fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/nl/acs/AcsConfig.java | 4 + .../agv/server/impl/ZheDaAgvServiceImpl.java | 11 +- .../agv/xg_agv/XgagvDeviceDriver.java | 4 +- .../driver/AbstractOpcDeviceDriver.java | 2 +- .../nl/acs/opc/DeviceOpcProtocolRunable.java | 127 ++++++++++-------- .../org/nl/acs/udw/UnifiedDataAccessor.java | 44 ++++++ .../service/impl/UnifiedDataAccessorImpl.java | 14 ++ .../service/lucene/dto/LuceneLogDto.java | 18 ++- .../src/main/resources/config/application.yml | 2 +- .../resources/config/application-prod.yml | 4 +- 10 files changed, 166 insertions(+), 64 deletions(-) diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/AcsConfig.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/AcsConfig.java index cd465bb..965a76a 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/AcsConfig.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/AcsConfig.java @@ -54,4 +54,8 @@ public interface AcsConfig { String MAXSENDTASKTIME = "maxSendTaskTime"; //指令下发立库 String INSTSENDLK = "instSendLk"; + /** + * 日志级别 + */ + String LOGLEVEL = "log_level"; } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java index d858be2..76dadc8 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java @@ -234,8 +234,15 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService { if (start_device.getDeviceDriver() instanceof SiteDeviceDriver) { SiteDeviceDriver siteDeviceDriver=(SiteDeviceDriver)start_device.getDeviceDriver(); if(siteDeviceDriver.getMode()!=10) { - siteDeviceDriver.writing(10); - siteDeviceDriver.writing(10); + try { + siteDeviceDriver.writing(10); + siteDeviceDriver.writing(10); + siteDeviceDriver.writing(10); + siteDeviceDriver.writing(10); + siteDeviceDriver.writing(10); + }catch(Exception e){ + log.error("写入信号失败:{}{}",e,e.getMessage()); + } } } } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/xg_agv/XgagvDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/xg_agv/XgagvDeviceDriver.java index 725301d..dd11d91 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/xg_agv/XgagvDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/xg_agv/XgagvDeviceDriver.java @@ -176,8 +176,8 @@ public class XgagvDeviceDriver extends AbstractOpcDeviceDriver implements Device // .content("信号" + this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.device_code + "." + ItemProtocol.to_home_relocation + "变更从" + this.last_home_relocation + "->" + this.home_relocation) // .build(); // luceneExecuteLogService.deviceExecuteLog(logDto); - luceneExecuteLogService.deviceExecuteLog( - new LuceneLogDto(this.getDevice().getOpc_server_code(),this.getDevice().getOpc_plc_code(),this.device_code,ItemProtocol.to_home_relocation,String.valueOf(this.last_home_relocation),String.valueOf(this.home_relocation))); +// luceneExecuteLogService.deviceExecuteLog( +// new LuceneLogDto(this.getDevice().getOpc_server_code(),this.getDevice().getOpc_plc_code(),this.device_code,ItemProtocol.to_home_relocation,String.valueOf(this.last_home_relocation),String.valueOf(this.home_relocation))); } if (stop != last_stop) { diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java index 1bc333a..dfd48d9 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java @@ -134,7 +134,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc if (!need_write && !UnifiedDataAppService.isEquals(udw_value, write_value)) { need_write = true; } else { - //log.warn("下发信号点位{} 当前写入值:{} 与系统内存值:{} 相同,不再写入 ", code, write_value, udw_value ); + log.info("下发信号点位{} 当前写入值:{} 与系统内存值:{} 相同,不再写入 ", code, write_value, udw_value ); } } // need_write = true; diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index 2028cc8..d6ba183 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -1,19 +1,25 @@ package org.nl.acs.opc; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; +import org.nl.acs.AcsConfig; +import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.opc.service.dto.OpcServerManageDto; import org.nl.acs.udw.UnifiedDataAccessor; import org.nl.acs.udw.UnifiedDataAccessorFactory; import org.nl.acs.udw.UnifiedDataAppService; import org.nl.common.enums.LogTypeEnum; import org.nl.config.SpringContextHolder; -import org.nl.system.service.lucene.LuceneExecuteLogService; import org.nl.system.service.lucene.dto.LuceneLogDto; +import org.nl.system.service.param.ISysParamService; import org.openscada.opc.lib.da.*; import java.util.*; +import java.util.regex.Pattern; + @Slf4j public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerConnectionStateListener { @@ -28,8 +34,6 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC private int all_null; private Map itemSearchCache; - LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class); - public DeviceOpcProtocolRunable() { this.error_num = 0; @@ -55,10 +59,12 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC this.OpcServer = opcServer; } + private OpcItemDto getItem(String item) { OpcItemDto x = (OpcItemDto) this.itemSearchCache.get(item); if (x == null) { Iterator var3 = this.protocols.iterator(); + while (var3.hasNext()) { OpcItemDto dto = (OpcItemDto) var3.next(); if (StrUtil.equals(item, dto.getItem_code())) { @@ -68,9 +74,11 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC } } } + return x; } + @Override public void run() { if (OpcConfig.opc_item_read_using_callback) { @@ -80,6 +88,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC } } + private void runOld() { OpcServerService opcServerService = SpringContextHolder.getBean(OpcServerService .class); while (true) { @@ -94,8 +103,6 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC server.disconnect(); log.trace("清理server..."); } - -// group =opcServerService.getServer(this.getOpcServer().getOpc_code()); this.server = OpcServerUtl.getServerWithOutException(this.OpcServer.getOpc_host(), this.OpcServer.getCls_id(), this.OpcServer.getUser(), this.OpcServer.getPassword(), this.OpcServer.getDomain()); this.server.addStateListener(this); group = this.server.addGroup(); @@ -119,7 +126,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC try { Item item = group.addItem(string); itemsMap.put(string, item); -// log.trace("添加成功 {}", string); + log.trace("添加成功 {}", string); } catch (Exception var26) { err_message.append(string + ":" + var26.getMessage()); if (!is_error) { @@ -131,14 +138,13 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC String tag; if (is_error) { tag = err_message.toString(); -// log.warn("{}:{}", OpcConfig.resource_code, tag); + log.warn("{}:{}", OpcConfig.resource_code, tag); } if (!OpcStartTag.is_run) { OpcStartTag.is_run = true; } - //线程名 tag = ""; if (log.isWarnEnabled()) { tag = Thread.currentThread().getName(); @@ -146,25 +152,26 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC tag = tag + this.getOpcGroupID(); } } + UnifiedDataAccessor accessor_value = UnifiedDataAccessorFactory.getAccessor(OpcConfig.udw_opc_value_key); boolean time_out = false; - label97: while (DeviceOpcSynchronizeAutoRun.isRun) { long begin = System.currentTimeMillis(); if (log.isTraceEnabled()) { -// log.trace("{} 开始记时{}", tag, DateUtil.now()); + log.trace("{} 开始记时{}", tag, DateUtil.now()); } Map itemStatus = group.read(true, (Item[]) itemsMap.values().toArray(new Item[0])); long end = System.currentTimeMillis(); long duration = end - begin; if (log.isTraceEnabled()) { -// log.trace("{} 读取耗时:{}", tag, duration); + log.trace("{} 读取耗时:{}", tag, duration); } + if (duration > 1000L) { if (!time_out) { -// log.warn("{} 读取超时 : {}", tag, duration); + log.warn("{} 读取超时 : {}", tag, duration); } time_out = true; @@ -187,7 +194,8 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC String itemId = item.getId(); Object his = accessor_value.getValue(itemId); if (!ObjectUtl.isEquals(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) { -// log.warn("opc 值不健康 item: {}, 状态: {}", itemId, itemState.getQuality()); + log.warn("opc 值不健康 item: {}, 状态: {}", itemId, itemState.getQuality()); + valueAllNotNull = false; } if (!UnifiedDataAppService.isEquals(value, his)) { @@ -195,8 +203,12 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC if (true) { this.logItemChanged(itemId, accessor_value, value, itemDto); } - - accessor_value.setValue(itemId, value); + if(!ObjectUtil.isEmpty(value) || "".equals(value)){ + accessor_value.setValue(itemId, value); + } + if(ObjectUtil.isEmpty(value) && !"".equals(value)){ + accessor_value.removeValue(itemId); + } } } @@ -217,31 +229,32 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC random *= 1000; if (this.all_null < 3) { if (log.isWarnEnabled()) { - log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null, 5000 + random); + log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,3); } - ThreadUtl.sleep((long) ((new Random()).nextInt(3) + 1) * 1000); + + ThreadUtl.sleep( 3000); break start; } else if (this.all_null < 6) { if (log.isWarnEnabled()) { log.warn(tag + "重新创建server"); - log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null, 30000 + random); + log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,3); } - ThreadUtl.sleep((long) ((new Random()).nextInt(3) + 1) * 1000); + ThreadUtl.sleep(3000); break start; } else if (this.all_null < 12) { if (log.isWarnEnabled()) { -// log.warn("{} 所有内容都为空, all_null:{} ,暂定{}ms", tag, all_null, '\uea60' + random); + log.warn(tag + "重新创建server"); + log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,3); } - ThreadUtl.sleep((long) ((new Random()).nextInt(3) + 1) * 1000); + ThreadUtl.sleep(3000); break start; - } else { if (log.isWarnEnabled()) { -// log.warn("{} 所有内容都为空, all_null:{} ,暂定{}ms", tag, all_null, 120000 + random); + log.warn("{} 所有内容都为空, all_null:{} ,暂定{}ms", tag, all_null, 5000); } -// ThreadUtl.sleep((long) ((new Random()).nextInt(3) + 1) * 1000); -// break start; + ThreadUtl.sleep((long) (5000)); } + ++this.all_null; } else { this.all_null = 0; @@ -257,9 +270,9 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC try { this.server.disconnect(); } catch (Exception var25) { - } } + this.server = null; if (!DeviceOpcSynchronizeAutoRun.isRun) { log.warn("opc线程停止2。。。"); @@ -281,6 +294,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC } + private void runNew() { Async20Access accessor = null; @@ -346,12 +360,14 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC } } + + @Override public void connectionStateChanged(boolean connected) { if (!connected) { this.server = null; } -// log.warn("opc server {} {}", this.getOpcGroupID(), connected ? "connected" : "disconnected"); + log.warn("opc server {} {}", this.getOpcGroupID(), connected ? "connected" : "disconnected"); } private String getOpcGroupID() { @@ -366,6 +382,9 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC long seconds = mss % 60000L / 1000L; return days + " days " + hours + " hours " + minutes + " minutes " + seconds + " seconds "; } + + + @Override public void changed(Item item, ItemState itemState) { String itemId = item.getId(); @@ -373,20 +392,8 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC Object value = OpcUtl.getValue(item, itemState); UnifiedDataAccessor accessor_value = UnifiedDataAccessorFactory.getAccessor(OpcConfig.udw_opc_value_key); accessor_value.setValue(itemId, value); - -// if (value != null) { -// if (log.isTraceEnabled()) { -// log.trace("Item {} new value: {}, Timestamp: {}", new Object[]{itemId, itemState.getValue(), itemState.getTimestamp().getTime()}); -// } -// } else if (log.isInfoEnabled()) { -// log.info("Item {} new value: {}, Timestamp: {}, Quality: {}", new Object[]{itemId, itemState.getValue(), itemState.getTimestamp().getTime(), itemState.getQuality()}); -// } -// log.trace("Item {} new value: {}, Timestamp: {}", new Object[]{itemId, itemState.getValue(), itemState.getTimestamp().getTime()}); - + log.trace("Item {} new value: {}, Timestamp: {}", new Object[]{itemId, itemState.getValue(), itemState.getTimestamp().getTime()}); OpcItemDto itemDto = this.getItem(itemId); -// if (Boolean.TRUE.equals(itemDto.getNeed_log())) { -// this.logItemChanged(itemId, accessor_value, value, itemDto); -// } this.logItemChanged(itemId, accessor_value, value, itemDto); } catch (Exception var7) { @@ -396,9 +403,8 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC } private void logItemChanged(String itemId, UnifiedDataAccessor accessor_value, Object value, OpcItemDto itemDto) { + ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class); Object his = accessor_value.getValue(itemId); - itemDto.setHis_item_value(his); - itemDto.setItem_value(value); List relate_items = itemDto.getRelate_items(); if (relate_items != null && !relate_items.isEmpty()) { StringBuilder sb = new StringBuilder(); @@ -409,24 +415,35 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC Object obj = accessor_value.getValue(relate); sb.append("key:" + relate + "value:" + obj + ";"); } - if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time")) { + if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time") && !itemDto.getItem_code().endsWith("consumption")) { // 存在上次点位值为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(itemDto.getItem_value())); - luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc()); - log.info("{}", JSON.toJSONString(luceneLogDto)); + if(!(his instanceof Float) && !(value instanceof Float)){ + LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(),4, itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), + String.valueOf(his), String.valueOf(value)); + luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc()); + String logLevel = paramService.findByCode(AcsConfig.LOGLEVEL).getValue(); + if(StrUtil.isNotEmpty(logLevel) && isNumeric(logLevel) && (luceneLogDto.getLog_level() >= Integer.parseInt(logLevel))){ + log.info("{}", JSON.toJSONString(luceneLogDto)); + } + } } } else { -// log.info("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); - // 存在上次点位值为null情况 则不记录日志 - 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(itemDto.getItem_value())); - luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc()); - log.info("{}", JSON.toJSONString(luceneLogDto)); - + if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time") && !itemDto.getItem_code().endsWith("consumption")) { + if(!(his instanceof Float) && !(value instanceof Float)){ + LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(),4, itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), + String.valueOf(his), String.valueOf(value)); + luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc()); + String logLevel = paramService.findByCode(AcsConfig.LOGLEVEL).getValue(); + if(StrUtil.isNotEmpty(logLevel) && isNumeric(logLevel) && (luceneLogDto.getLog_level() >= Integer.parseInt(logLevel))){ + log.info("{}", JSON.toJSONString(luceneLogDto)); + } + } } } } + public static boolean isNumeric(String str) { + return Pattern.compile("^[0-9]+$").matcher(str).matches(); + } + } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/udw/UnifiedDataAccessor.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/udw/UnifiedDataAccessor.java index 559373f..0a8d2ac 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/udw/UnifiedDataAccessor.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/udw/UnifiedDataAccessor.java @@ -2,16 +2,60 @@ package org.nl.acs.udw; import java.util.List; +/** + * @author 20220102CG\noblelift + */ public interface UnifiedDataAccessor { + /** + * 获取所有key + * + * @return List + */ List getAllKey(); + /** + * 获取值 + * + * @param key key + * @return Object + */ Object getValue(String key); + /** + * 设置值 + * + * @param key key + * @param value value + */ void setValue(String key, Object value); + /** + * 删除值 + * @param key + */ + void removeValue(String key); + + /** + * 获取统一数据 + * + * @param key key + * @return UnifiedData + */ UnifiedData getUnifiedData(String key); + /** + * 获取历史数据 + * + * @param key key + * @return List + */ List getHistoryUnifiedData(String key); + /** + * 设置值 + * + * @param key key + * @param value value + */ void setValueWithPersistence(String key, Object value); } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/udw/service/impl/UnifiedDataAccessorImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/udw/service/impl/UnifiedDataAccessorImpl.java index 995ab9a..c810105 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/udw/service/impl/UnifiedDataAccessorImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/udw/service/impl/UnifiedDataAccessorImpl.java @@ -6,6 +6,9 @@ import org.nl.acs.udw.UnifiedDataAppService; import java.util.List; +/** + * @author 20220102CG\noblelift + */ public class UnifiedDataAccessorImpl implements UnifiedDataAccessor { private String unified_key; private UnifiedDataAppService unifiedDataAppService; @@ -21,26 +24,37 @@ public class UnifiedDataAccessorImpl implements UnifiedDataAccessor { this.unifiedDataAppService = unifiedDataService; } + @Override public List getAllKey() { return this.unifiedDataAppService.getAllDataKey(this.unified_key); } + @Override public Object getValue(String key) { return this.unifiedDataAppService.getValue(this.unified_key, key); } + @Override public void setValue(String key, Object value) { this.unifiedDataAppService.setValue(this.unified_key, key, value); } + @Override + public void removeValue( String key) { + this.unifiedDataAppService.removeValue(this.unified_key, key); + } + + @Override public void setValueWithPersistence(String key, Object value) { this.unifiedDataAppService.setValueWithPersistence(this.unified_key, key, value); } + @Override public UnifiedData getUnifiedData(String key) { return this.unifiedDataAppService.getUnifiedData(this.unified_key, key); } + @Override public List getHistoryUnifiedData(String key) { return this.unifiedDataAppService.getHistoryUnifiedData(this.unified_key, key); } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/lucene/dto/LuceneLogDto.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/lucene/dto/LuceneLogDto.java index edacda4..f8f604d 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/lucene/dto/LuceneLogDto.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/lucene/dto/LuceneLogDto.java @@ -37,6 +37,10 @@ public class LuceneLogDto { /* 日志类型 */ private String log_type; + /** + * 日志级别 + */ + private Integer log_level; /* 方法 */ private String method; @@ -69,11 +73,12 @@ public class LuceneLogDto { private String update_time; - public LuceneLogDto(final String opc_server_code, final String opc_plc_code, + public LuceneLogDto(final String opc_server_code, final String opc_plc_code,final Integer log_level, final String device_code, final String to_home, final String last_home, final String home) { super(); this.device_code = device_code; + this.log_level = log_level; this.content = "信号 [" + opc_server_code + "." + opc_plc_code + "." @@ -83,6 +88,17 @@ public class LuceneLogDto { + home; } + public LuceneLogDto(final Integer log_level,final String method, final String status, + final String requestparam, final String responseparam, final String content) { + super(); + this.log_level = log_level; + this.method = method; + this.status_code = status; + this.requestparam = requestparam; + this.responseparam = responseparam; + this.content = content; + } + public LuceneLogDto(final String device_code, final String remark) { super(); this.device_code = device_code; diff --git a/acs/nladmin-system/nlsso-server/src/main/resources/config/application.yml b/acs/nladmin-system/nlsso-server/src/main/resources/config/application.yml index 2d1a89c..ac11b14 100644 --- a/acs/nladmin-system/nlsso-server/src/main/resources/config/application.yml +++ b/acs/nladmin-system/nlsso-server/src/main/resources/config/application.yml @@ -2,7 +2,7 @@ spring: freemarker: check-template-location: false profiles: - active: prod + active: dev jackson: time-zone: GMT+8 data: diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml b/lms/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml index 9e5a7a1..af7297c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml @@ -54,7 +54,7 @@ spring: multi-statement-allow: true redis: #数据库索引 - database: ${REDIS_DB:5} + database: ${REDIS_DB:2} host: ${REDIS_HOST:10.44.101.19} port: ${REDIS_PORT:6379} password: ${REDIS_PWD:} @@ -152,7 +152,7 @@ sa-token: token-session-check-login: false alone-redis: # Redis数据库索引(默认为0) - database: 5 + database: 2 # Redis服务器地址 host: 10.44.101.19 # Redis服务器连接端口