diff --git a/pom.xml b/pom.xml
index b2e869e63..a2a38a724 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,7 +36,8 @@
1.44.0
1.18.40
7.4
- 3.0.0
+ 3.0.1
+ 7.17.28
9.3.0
1.80
1.5.0
@@ -279,6 +280,18 @@
${easy-es.version}
+
+ co.elastic.clients
+ elasticsearch-java
+ ${elasticsearch-client.version}
+
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-client
+ ${elasticsearch-client.version}
+
+
org.apache.skywalking
diff --git a/ruoyi-common/ruoyi-common-elasticsearch/src/main/java/org/dromara/easyes/spring/config/EasyEsConfiguration.java b/ruoyi-common/ruoyi-common-elasticsearch/src/main/java/org/dromara/easyes/spring/config/EasyEsConfiguration.java
deleted file mode 100644
index 4a2f89aca..000000000
--- a/ruoyi-common/ruoyi-common-elasticsearch/src/main/java/org/dromara/easyes/spring/config/EasyEsConfiguration.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package org.dromara.easyes.spring.config;
-
-import lombok.NonNull;
-import lombok.Setter;
-import org.dromara.easyes.common.constants.BaseEsConstants;
-import org.dromara.easyes.common.property.EasyEsDynamicProperties;
-import org.dromara.easyes.common.property.EasyEsProperties;
-import org.dromara.easyes.common.strategy.AutoProcessIndexStrategy;
-import org.dromara.easyes.common.utils.EsClientUtils;
-import org.dromara.easyes.core.index.AutoProcessIndexNotSmoothlyStrategy;
-import org.dromara.easyes.core.index.AutoProcessIndexSmoothlyStrategy;
-import org.dromara.easyes.spring.factory.IndexStrategyFactory;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.EnvironmentAware;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.env.Environment;
-import org.springframework.util.Assert;
-
-import java.util.Map;
-
-/**
- * Easy-Es Spring配置类
- * @author MoJie
- * @since 2.0
- */
-@ConditionalOnProperty(value = "easy-es.enable", havingValue = "true")
-@Configuration
-public class EasyEsConfiguration implements InitializingBean, EnvironmentAware {
-
- private Environment environment;
-
- @Setter
- @Autowired(required = false)
- private EasyEsProperties easyEsProperties;
-
- @Setter
- @Autowired(required = false)
- private EasyEsDynamicProperties easyEsDynamicProperties;
-
- @Override
- public void setEnvironment(@NonNull Environment environment) {
- this.environment = environment;
- }
-
- /**
- * 当当前配置类注册为bean完成后触发,校验easy-es配置是否存在,
- * 如果easy-es.enable: false, 那么不进行校验和抛出异常
- * 默认情况下引入了easy-es是需要配置的,即easy-es.enable:true
- * 如果不需要easy-es,那么自行配置为false
- * @author MoJie
- */
- @Override
- public void afterPropertiesSet() {
- Boolean enable = environment.getProperty(BaseEsConstants.ENABLE_PREFIX, Boolean.class, Boolean.TRUE);
- if (enable) {
- Assert.notNull(this.easyEsProperties, "easyEsProperties must is A bean. easy-es配置类必须给配置一个bean");
- }
- }
-
- @Bean
- public IndexStrategyFactory indexStrategyFactory() {
- return new IndexStrategyFactory();
- }
-
- @Bean
- public EsClientUtils esClientUtils() {
- EsClientUtils esClientUtils = new EsClientUtils();
- if (this.easyEsDynamicProperties == null) {
- this.easyEsDynamicProperties = new EasyEsDynamicProperties();
- }
- Map datasourceMap = this.easyEsDynamicProperties.getDatasource();
- if (datasourceMap.isEmpty()) {
- // 设置默认数据源,兼容不使用多数据源配置场景的老用户使用习惯
- datasourceMap.put(EsClientUtils.DEFAULT_DS, this.easyEsProperties);
- }
- for (String key : datasourceMap.keySet()) {
- EasyEsProperties easyEsConfigProperties = datasourceMap.get(key);
- EsClientUtils.registerClient(key, () -> EsClientUtils.buildClient(easyEsConfigProperties));
- }
- return esClientUtils;
- }
-
- /**
- * 索引策略注册
- *
- * @return {@link AutoProcessIndexStrategy}
- * @author MoJie
- */
- @Bean
- public AutoProcessIndexStrategy autoProcessIndexSmoothlyStrategy() {
- return new AutoProcessIndexSmoothlyStrategy();
- }
-
- @Bean
- public AutoProcessIndexStrategy autoProcessIndexNotSmoothlyStrategy() {
- return new AutoProcessIndexNotSmoothlyStrategy();
- }
-
-}
diff --git a/ruoyi-common/ruoyi-common-elasticsearch/src/main/java/org/dromara/easyes/starter/config/GeneratorConfiguration.java b/ruoyi-common/ruoyi-common-elasticsearch/src/main/java/org/dromara/easyes/starter/config/GeneratorConfiguration.java
deleted file mode 100644
index 3ab45eabb..000000000
--- a/ruoyi-common/ruoyi-common-elasticsearch/src/main/java/org/dromara/easyes/starter/config/GeneratorConfiguration.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.dromara.easyes.starter.config;
-
-import co.elastic.clients.elasticsearch.ElasticsearchClient;
-import org.dromara.easyes.core.config.GeneratorConfig;
-import org.dromara.easyes.core.toolkit.Generator;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.stereotype.Component;
-
-/**
- * 代码生成注册
- * @author MoJie
- * @since 2.0
- */
-@ConditionalOnProperty(value = "easy-es.enable", havingValue = "true")
-@Component
-public class GeneratorConfiguration extends Generator {
-
- @Autowired
- private ElasticsearchClient client;
-
- @Override
- public Boolean generate(GeneratorConfig config) {
- super.generateEntity(config, this.client);
- return Boolean.TRUE;
- }
-}
diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java
index d519b9d55..7a5d82c3e 100644
--- a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java
+++ b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java
@@ -14,6 +14,7 @@ import org.dromara.common.core.exception.SseException;
import org.dromara.common.core.exception.base.BaseException;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.json.utils.JsonUtils;
+import org.springframework.context.MessageSourceResolvable;
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.expression.ExpressionException;
import org.springframework.http.converter.HttpMessageNotReadableException;
@@ -25,6 +26,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.async.AsyncRequestTimeoutException;
+import org.springframework.web.method.annotation.HandlerMethodValidationException;
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
import org.springframework.web.servlet.NoHandlerFoundException;
@@ -191,6 +193,16 @@ public class GlobalExceptionHandler {
return R.fail(message);
}
+ /**
+ * 方法参数校验异常 用于处理 @Validated 注解
+ */
+ @ExceptionHandler(HandlerMethodValidationException.class)
+ public R handlerMethodValidationException(HandlerMethodValidationException e) {
+ log.error(e.getMessage());
+ String message = StreamUtils.join(e.getAllErrors(), MessageSourceResolvable::getDefaultMessage, ", ");
+ return R.fail(message);
+ }
+
/**
* JSON 解析异常(Jackson 在处理 JSON 格式出错时抛出)
* 可能是请求体格式非法,也可能是服务端反序列化失败
diff --git a/ruoyi-common/ruoyi-common-websocket/src/main/java/org/dromara/common/websocket/handler/PlusWebSocketHandler.java b/ruoyi-common/ruoyi-common-websocket/src/main/java/org/dromara/common/websocket/handler/PlusWebSocketHandler.java
index 557ed8eb4..5a1b9c5d3 100644
--- a/ruoyi-common/ruoyi-common-websocket/src/main/java/org/dromara/common/websocket/handler/PlusWebSocketHandler.java
+++ b/ruoyi-common/ruoyi-common-websocket/src/main/java/org/dromara/common/websocket/handler/PlusWebSocketHandler.java
@@ -8,6 +8,7 @@ import org.dromara.common.websocket.utils.WebSocketUtils;
import org.dromara.system.api.model.LoginUser;
import org.springframework.web.socket.*;
import org.springframework.web.socket.handler.AbstractWebSocketHandler;
+import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator;
import java.io.IOException;
import java.util.List;
@@ -33,7 +34,7 @@ public class PlusWebSocketHandler extends AbstractWebSocketHandler {
log.info("[connect] invalid token received. sessionId: {}", session.getId());
return;
}
- WebSocketSessionHolder.addSession(loginUser.getUserId(), session);
+ WebSocketSessionHolder.addSession(loginUser.getUserId(), new ConcurrentWebSocketSessionDecorator(session, 10 * 1000, 64000));
log.info("[connect] sessionId: {},userId:{},userType:{}", session.getId(), loginUser.getUserId(), loginUser.getUserType());
}
diff --git a/ruoyi-common/ruoyi-common-websocket/src/main/java/org/dromara/common/websocket/utils/WebSocketUtils.java b/ruoyi-common/ruoyi-common-websocket/src/main/java/org/dromara/common/websocket/utils/WebSocketUtils.java
index 35320c6e7..696ac3c50 100644
--- a/ruoyi-common/ruoyi-common-websocket/src/main/java/org/dromara/common/websocket/utils/WebSocketUtils.java
+++ b/ruoyi-common/ruoyi-common-websocket/src/main/java/org/dromara/common/websocket/utils/WebSocketUtils.java
@@ -113,7 +113,7 @@ public class WebSocketUtils {
* @param session WebSocket会话
* @param message 要发送的WebSocket消息对象
*/
- private synchronized static void sendMessage(WebSocketSession session, WebSocketMessage> message) {
+ private static void sendMessage(WebSocketSession session, WebSocketMessage> message) {
if (session == null || !session.isOpen()) {
log.warn("[send] session会话已经关闭");
} else {
diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/listener/WorkflowGlobalListener.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/listener/WorkflowGlobalListener.java
index fe7bbbcca..fd8e760aa 100644
--- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/listener/WorkflowGlobalListener.java
+++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/listener/WorkflowGlobalListener.java
@@ -77,7 +77,7 @@ public class WorkflowGlobalListener implements GlobalListener {
String ext = listenerVariable.getNode().getExt();
if (StringUtils.isNotBlank(ext)) {
Map variable = listenerVariable.getVariable();
- if (CollUtil.isNotEmpty(variable)) {
+ if (CollUtil.isEmpty(variable)) {
variable = new HashMap<>();
}
NodeExtVo nodeExt = nodeExtService.parseNodeExt(ext, variable);