diff --git a/mes/hd/nladmin-system/pom.xml b/mes/hd/nladmin-system/pom.xml
index 51be1f6a..aec8c46c 100644
--- a/mes/hd/nladmin-system/pom.xml
+++ b/mes/hd/nladmin-system/pom.xml
@@ -17,13 +17,13 @@
UTF-8
1.8
1.16
- 2.9.2
1.1.22
1.2.0.Final
1.31.0
5.7.14
0.11.1
1.2.83
+ 8.2.0
1.9
@@ -100,23 +100,23 @@
-
- org.springframework.boot
- spring-boot-starter-data-elasticsearch
- 2.7.5
-
-
-
-
+
+
+
+
+
+
+
+
-
-
- com.internetitem
- logback-elasticsearch-appender
- 1.6
-
+
+
+
+
+
+
@@ -180,7 +180,40 @@
${sa-token.version}
+
+
+ org.apache.lucene
+ lucene-core
+ ${lucene.version}
+
+
+ org.apache.lucene
+ lucene-highlighter
+ ${lucene.version}
+
+
+ org.apache.lucene
+ lucene-analyzers-common
+ ${lucene.version}
+
+
+ com.github.magese
+ ik-analyzer
+ ${lucene.version}
+
+
+
+ org.apache.lucene
+ lucene-analyzers-smartcn
+ ${lucene.version}
+
+
+
+ org.apache.lucene
+ lucene-queryparser
+ ${lucene.version}
+
org.springframework.boot
@@ -199,38 +232,6 @@
${log4jdbc.version}
-
-
- io.springfox
- springfox-swagger2
- ${swagger.version}
-
-
- io.swagger
- swagger-annotations
-
-
- io.swagger
- swagger-models
-
-
-
-
- io.springfox
- springfox-swagger-ui
- ${swagger.version}
-
-
- io.swagger
- swagger-annotations
- 1.5.21
-
-
- io.swagger
- swagger-models
- 1.5.21
-
-
mysql
@@ -357,7 +358,11 @@
jetcache-starter-redis
2.5.14
-
+
+ com.google.guava
+ guava
+ 29.0-jre
+
com.oracle.database.jdbc
ojdbc5
diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/AppRun.java b/mes/hd/nladmin-system/src/main/java/org/nl/AppRun.java
index d227b0a4..807d4d0f 100644
--- a/mes/hd/nladmin-system/src/main/java/org/nl/AppRun.java
+++ b/mes/hd/nladmin-system/src/main/java/org/nl/AppRun.java
@@ -4,7 +4,7 @@ import cn.dev33.satoken.annotation.SaIgnore;
import com.alicp.jetcache.Cache;
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
-import io.swagger.annotations.Api;
+
import org.mybatis.spring.annotation.MapperScan;
import org.nl.modules.wql.util.SpringContextHolder;
import org.springframework.boot.CommandLineRunner;
@@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@EnableAsync
@RestController
-@Api(hidden = true)
+
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
})
diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/domain/Property.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/domain/Property.java
new file mode 100644
index 00000000..5bfb46a6
--- /dev/null
+++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/domain/Property.java
@@ -0,0 +1,44 @@
+package org.nl.common.domain;
+
+/*
+ * @author ZZQ
+ * @Date 2023/12/26 15:30
+ */
+public class Property {
+ private String name;
+ private String value;
+ private boolean allowEmpty;
+
+ public Property() {
+ }
+
+ public Property(String name, String value, boolean allowEmpty) {
+ this.name = name;
+ this.value = value;
+ this.allowEmpty = allowEmpty;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public boolean isAllowEmpty() {
+ return allowEmpty;
+ }
+
+ public void setAllowEmpty(boolean allowEmpty) {
+ this.allowEmpty = allowEmpty;
+ }
+}
diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LogMessageConstant.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LogMessageConstant.java
new file mode 100644
index 00000000..89d06213
--- /dev/null
+++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LogMessageConstant.java
@@ -0,0 +1,46 @@
+package org.nl.common.lucene;
+
+/**
+ * @Author: lyd
+ * @Description: 定义lucene相关常量
+ * @Date: 2023/8/25
+ */
+public class LogMessageConstant {
+ /** */
+ public final static String SORT_NAME = "time";
+ /** 级别 */
+ public final static String FIELD_LEVEL = "level";
+ /** 时间 */
+ public final static String FIELD_TIMESTAMP = "timestamp";
+ /** 类的限定名 */
+ public final static String FIELD_CLASS_NAME = "logger";
+ /** 线程名 */
+ public final static String FIELD_THREAD = "thread";
+ /** 日志内容 */
+ public final static String FIELD_MESSAGE = "message";
+ public final static String FIELD_TRACEID = "tlogTraceId";
+ // 定义颜色值
+ /** 文本颜色:黑色 */
+ public final static String COLOR_BLACK = "\u001B[30m";
+ /** 文本颜色:红色 */
+ public final static String COLOR_RED = "\u001B[31m";
+ /** 文本颜色:绿色 */
+ public final static String COLOR_GREEN = "\u001B[32m";
+ /** 文本颜色:黄色 */
+ public final static String COLOR_YELLOW = "\u001B[33m";
+ /** 文本颜色:蓝色 */
+ public final static String COLOR_BLUE = "\u001B[34m";
+ /** 文本颜色:品红色 */
+ public final static String COLOR_MAGENTA = "\u001B[35m";
+ /** 文本颜色:青色 */
+ public final static String COLOR_CYAN = "\u001B[36m";
+ /** 文本颜色:白色 */
+ public final static String COLOR_WHITE = "\u001B[37m";
+ /** 文本颜色重置 */
+ public final static String COLOR_RESET = "\u001B[0m";
+ /** 背景颜色:黄色 */
+ public final static String BACKGROUND_YELLOW = "\u001B[43m";
+ /** 索引路径 */
+ public final static String INDEX_DIR = "E:\\lucene\\index";
+
+}
diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LuceneAppender.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LuceneAppender.java
new file mode 100644
index 00000000..4c059fa6
--- /dev/null
+++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LuceneAppender.java
@@ -0,0 +1,87 @@
+package org.nl.common.lucene;
+/**
+ * @author ldjun
+ * @version 1.0
+ * @date 2023年08月24日 13:00
+ * @desc desc
+ */
+
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.AppenderBase;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.document.*;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+import org.nl.common.domain.Property;
+import org.nl.common.utils.YmlConfigFileUtil;
+import org.wltea.analyzer.lucene.IKAnalyzer;
+
+import java.io.IOException;
+import java.nio.file.Paths;
+import java.util.List;
+import java.util.Properties;
+
+public class LuceneAppender extends AppenderBase {
+ public LuceneProperties properties;
+ public static Directory index;
+ private List encoders;
+ public static IndexWriter indexWriter;
+
+
+
+ @Override
+ public void start() {
+ super.start();
+ try {
+ // 读取配置文件
+ Properties properties = YmlConfigFileUtil.readConfig("config/application.yml");
+
+ // 获取配置值
+ String luceneDir = properties.getProperty("lucene.index.path");
+ index = FSDirectory.open(Paths.get(luceneDir));
+ // 初始化 Lucene 索引
+ Analyzer analyzer = new IKAnalyzer();
+ IndexWriterConfig config = new IndexWriterConfig(analyzer);
+ indexWriter = new IndexWriter(index, config);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ @Override
+ protected void append(ILoggingEvent event) {
+ Document doc = new Document();
+ for (Property property : this.properties.getProperties()) {
+ LucenePropertyAndEncoder encoder = new LucenePropertyAndEncoder(property, this.context);
+ doc.add(new StringField(property.getName(), encoder.encode(event), Field.Store.YES));
+ }
+ doc.add(new TextField(LogMessageConstant.FIELD_MESSAGE, event.getFormattedMessage(), Field.Store.YES));
+ doc.add(new StringField(LogMessageConstant.FIELD_TIMESTAMP, String.valueOf(event.getTimeStamp()),Field.Store.YES));
+ doc.add(new NumericDocValuesField(LogMessageConstant.SORT_NAME, event.getTimeStamp()));
+
+ try {
+ indexWriter.addDocument(doc);
+ indexWriter.commit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void stop() {
+ super.stop();
+ try {
+ indexWriter.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void setProperties(LuceneProperties properties) {
+ this.properties = properties;
+
+ }
+}
diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LuceneProperties.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LuceneProperties.java
new file mode 100644
index 00000000..60cbadd7
--- /dev/null
+++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LuceneProperties.java
@@ -0,0 +1,26 @@
+package org.nl.common.lucene;
+
+
+
+import org.nl.common.domain.Property;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class LuceneProperties {
+
+ private List properties;
+
+ public LuceneProperties() {
+ this.properties = new ArrayList();
+ }
+
+ public List getProperties() {
+ return properties;
+ }
+
+ public void addProperty(Property property) {
+ properties.add(property);
+ }
+
+}
diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LucenePropertyAndEncoder.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LucenePropertyAndEncoder.java
new file mode 100644
index 00000000..60baeea8
--- /dev/null
+++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/lucene/LucenePropertyAndEncoder.java
@@ -0,0 +1,39 @@
+package org.nl.common.lucene;
+
+import ch.qos.logback.classic.PatternLayout;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Context;
+import ch.qos.logback.core.pattern.PatternLayoutBase;
+import org.nl.common.domain.Property;
+
+/*
+ * @author ZZQ
+ * @Date 2023/12/22 18:11
+ */
+public class LucenePropertyAndEncoder {
+
+ private Property property;
+
+ private PatternLayoutBase layout = new PatternLayout();
+
+ public LucenePropertyAndEncoder(Property property, Context context) {
+ this.property = property;
+ this.layout.setContext(context);
+ this.layout.setPattern(String.valueOf(property.getValue()));
+ this.layout.setPostCompileProcessor(null);
+ this.layout.start();
+ }
+
+ public String encode(ILoggingEvent event) {
+ return layout.doLayout(event);
+ }
+
+ public String getName() {
+ return property.getName();
+ }
+
+ public boolean allowEmpty() {
+ return property.isAllowEmpty();
+ }
+}
+
diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/AsyncHttpRequest.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/AsyncHttpRequest.java
index 7de5debe..d0b9348d 100644
--- a/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/AsyncHttpRequest.java
+++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/AsyncHttpRequest.java
@@ -1,65 +1,65 @@
-package org.nl.common.utils;
-
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.methods.HttpRequestBase;
-import org.apache.http.concurrent.FutureCallback;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
-import org.apache.http.impl.nio.client.HttpAsyncClients;
-import org.nl.modules.wql.util.SpringContextHolder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.stereotype.Component;
-
-import java.util.concurrent.Future;
-
-/*
- * HTtp异步调用
- */
-public class AsyncHttpRequest {
-
- private StringEntity entity;
- public HttpRequestBase httpbase;
- private String url;
-
- public AsyncHttpRequest(String url) {
- this.url=url;
- }
-
- public static AsyncHttpRequest post(String url,String body){
- return new AsyncHttpRequest(url).body(body);
- };
-
- public static AsyncHttpRequest get(String url){
- return new AsyncHttpRequest(url).getEntity();
- };
- private AsyncHttpRequest getEntity(){
- HttpGet httpGet = new HttpGet(this.url);
- this.httpbase = httpGet;
- return this;
- };
- private AsyncHttpRequest body(String body){
- this.entity = new StringEntity(body, "UTF-8");
- this.entity.setContentType("application/json");
- HttpPost httpPost = new HttpPost(this.url);
- httpPost.setEntity(entity);
- this.httpbase = httpPost;
- return this;
- };
- public Future execute(FutureCallback callback){
- CloseableHttpAsyncClient client = SpringContextHolder.getBean(CloseableHttpAsyncClient.class);
- Future execute = client.execute(httpbase, callback);
- return execute;
- };
-}
-@Component
-class HttpAsyncClientInit{
-
- @Bean
- public CloseableHttpAsyncClient closeableHttpAsyncClient(){
- CloseableHttpAsyncClient aDefault = HttpAsyncClients.createDefault();
- aDefault.start();
- return aDefault;
- }
-}
+//package org.nl.common.utils;
+//
+//import org.apache.http.HttpResponse;
+//import org.apache.http.client.methods.HttpGet;
+//import org.apache.http.client.methods.HttpPost;
+//import org.apache.http.client.methods.HttpRequestBase;
+//import org.apache.http.concurrent.FutureCallback;
+//import org.apache.http.entity.StringEntity;
+//import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
+//import org.apache.http.impl.nio.client.HttpAsyncClients;
+//import org.nl.modules.wql.util.SpringContextHolder;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.stereotype.Component;
+//
+//import java.util.concurrent.Future;
+//
+///*
+// * HTtp异步调用
+// */
+//public class AsyncHttpRequest {
+//
+// private StringEntity entity;
+// public HttpRequestBase httpbase;
+// private String url;
+//
+// public AsyncHttpRequest(String url) {
+// this.url=url;
+// }
+//
+// public static AsyncHttpRequest post(String url,String body){
+// return new AsyncHttpRequest(url).body(body);
+// };
+//
+// public static AsyncHttpRequest get(String url){
+// return new AsyncHttpRequest(url).getEntity();
+// };
+// private AsyncHttpRequest getEntity(){
+// HttpGet httpGet = new HttpGet(this.url);
+// this.httpbase = httpGet;
+// return this;
+// };
+// private AsyncHttpRequest body(String body){
+// this.entity = new StringEntity(body, "UTF-8");
+// this.entity.setContentType("application/json");
+// HttpPost httpPost = new HttpPost(this.url);
+// httpPost.setEntity(entity);
+// this.httpbase = httpPost;
+// return this;
+// };
+// public Future execute(FutureCallback callback){
+// CloseableHttpAsyncClient client = SpringContextHolder.getBean(CloseableHttpAsyncClient.class);
+// Future execute = client.execute(httpbase, callback);
+// return execute;
+// };
+//}
+//@Component
+//class HttpAsyncClientInit{
+//
+// @Bean
+// public CloseableHttpAsyncClient closeableHttpAsyncClient(){
+// CloseableHttpAsyncClient aDefault = HttpAsyncClients.createDefault();
+// aDefault.start();
+// return aDefault;
+// }
+//}
diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/YmlConfigFileUtil.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/YmlConfigFileUtil.java
new file mode 100644
index 00000000..1c351b5b
--- /dev/null
+++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/YmlConfigFileUtil.java
@@ -0,0 +1,28 @@
+package org.nl.common.utils;
+
+import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+import java.util.Properties;
+
+/**
+ * @Author: lyd
+ * @Description: 配置文件获取方法
+ * @Date: 2023/12/6
+ */
+public class YmlConfigFileUtil {
+ public static Properties readConfig(String configFile) {
+ // 创建 Resource 对象
+ Resource resource = new ClassPathResource(configFile);
+
+ // 创建 YamlPropertiesFactoryBean
+ YamlPropertiesFactoryBean yamlPropertiesFactoryBean = new YamlPropertiesFactoryBean();
+ yamlPropertiesFactoryBean.setResources(resource);
+
+ // 获取 Properties 对象
+ Properties properties = yamlPropertiesFactoryBean.getObject();
+
+ return properties;
+ }
+}
diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/config/ApiDocScan.java b/mes/hd/nladmin-system/src/main/java/org/nl/config/ApiDocScan.java
index aca085f8..9fc22aec 100644
--- a/mes/hd/nladmin-system/src/main/java/org/nl/config/ApiDocScan.java
+++ b/mes/hd/nladmin-system/src/main/java/org/nl/config/ApiDocScan.java
@@ -1,119 +1,119 @@
-package org.nl.config;
-
-import cn.hutool.core.util.IdUtil;
-import cn.hutool.poi.excel.BigExcelWriter;
-import cn.hutool.poi.excel.ExcelUtil;
-import com.alibaba.druid.util.StringUtils;
-import io.swagger.annotations.Api;
-import org.apache.poi.xssf.streaming.SXSSFSheet;
-import org.nl.common.anno.Log;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.SmartLifecycle;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.method.HandlerMethod;
-import springfox.documentation.RequestHandler;
-import springfox.documentation.spi.service.RequestHandlerProvider;
-import springfox.documentation.spring.web.WebMvcRequestHandler;
-
-import java.io.File;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.*;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.function.Predicate;
-
-/*
- * @author ZZQ
- * @Date 2023/10/17 14:51
- * 接口文档工具
- */
-//@Component
-public class ApiDocScan implements SmartLifecycle {
- private final List handlerProviders;
-
- @Autowired
- public ApiDocScan(List handlerProviders) {
- this.handlerProviders = handlerProviders;
- }
-
- @Override
- public void start() {
- RequestHandlerProvider requestHandlerProvider = handlerProviders.get(0);
- List requestHandlers = requestHandlerProvider.requestHandlers();
- List