From 6ff9a44aa88b6dafdb46f8a148037230dfcad530 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 8 May 2024 20:18:57 +0800 Subject: [PATCH 1/4] =?UTF-8?q?1.=E5=8C=85=E5=90=8D=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/distribution/config/CustomMessageConverter.java | 2 +- .../com/logpm/factory/config/CustomMessageConverter.java | 2 +- .../com/logpm/factory/config/RabbitMqConfiguration.java | 6 ++---- .../com/logpm/trunkline/config/CustomMessageConverter.java | 2 +- .../com/logpm/warehouse/config/CustomMessageConverter.java | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/CustomMessageConverter.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/CustomMessageConverter.java index ffa9e4a7e..3f8703627 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/CustomMessageConverter.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/CustomMessageConverter.java @@ -1,4 +1,4 @@ -package com.logpm.factorydata.olo.config; +package com.logpm.distribution.config; import cn.hutool.json.JSONUtil; import org.springblade.core.secure.BladeUser; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/CustomMessageConverter.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/CustomMessageConverter.java index ffa9e4a7e..deb695b4c 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/CustomMessageConverter.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/CustomMessageConverter.java @@ -1,4 +1,4 @@ -package com.logpm.factorydata.olo.config; +package com.logpm.factory.config; import cn.hutool.json.JSONUtil; import org.springblade.core.secure.BladeUser; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java index c3bc207c4..89ce02430 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java @@ -1,8 +1,8 @@ package com.logpm.factory.config; import com.alibaba.nacos.shaded.com.google.common.collect.Maps; +import com.logpm.factorydata.olo.config.CustomMessageConverter; import lombok.extern.slf4j.Slf4j; -import org.springblade.common.constant.ModuleNameConstant; import org.springblade.common.constant.RabbitConstant; import org.springframework.amqp.core.*; import org.springframework.amqp.rabbit.connection.ConnectionFactory; @@ -15,8 +15,6 @@ import org.springframework.context.annotation.Configuration; import java.util.Map; -import static io.protostuff.MapSchema.MessageFactories.HashMap; - /** * RabbitMQ配置,主要是配置队列,如果提前存在该队列,可以省略本配置类 * @@ -27,7 +25,7 @@ import static io.protostuff.MapSchema.MessageFactories.HashMap; public class RabbitMqConfiguration { @Bean - public RabbitTemplate createRabbitTemplate(ConnectionFactory connectionFactory,CustomMessageConverter converter) { + public RabbitTemplate createRabbitTemplate(ConnectionFactory connectionFactory, CustomMessageConverter converter) { RabbitTemplate template = new RabbitTemplate(); template.setConnectionFactory(connectionFactory); template.setMandatory(true); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/CustomMessageConverter.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/CustomMessageConverter.java index ffa9e4a7e..420eaaaa9 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/CustomMessageConverter.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/CustomMessageConverter.java @@ -1,4 +1,4 @@ -package com.logpm.factorydata.olo.config; +package com.logpm.trunkline.config; import cn.hutool.json.JSONUtil; import org.springblade.core.secure.BladeUser; diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/CustomMessageConverter.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/CustomMessageConverter.java index ffa9e4a7e..bdba5446b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/CustomMessageConverter.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/CustomMessageConverter.java @@ -1,4 +1,4 @@ -package com.logpm.factorydata.olo.config; +package com.logpm.warehouse.config; import cn.hutool.json.JSONUtil; import org.springblade.core.secure.BladeUser; From af26697cf5fc7b71434f0227defa26d5a6beb18e Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 8 May 2024 20:24:45 +0800 Subject: [PATCH 2/4] =?UTF-8?q?1.=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/logpm/factory/config/RabbitMqConfiguration.java | 1 - 1 file changed, 1 deletion(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java index 89ce02430..365608336 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java @@ -1,7 +1,6 @@ package com.logpm.factory.config; import com.alibaba.nacos.shaded.com.google.common.collect.Maps; -import com.logpm.factorydata.olo.config.CustomMessageConverter; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.RabbitConstant; import org.springframework.amqp.core.*; From 943bb4996ccf102841f1c3513bb90c4a4b8e37ef Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 8 May 2024 20:38:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aftersales/AftersalesApplication.java | 2 +- .../factory/config/RabbitMqConfiguration.java | 3 ++ .../LocalServerLoginAccountsInterceptor.java | 2 +- .../src/main/resources/application.yml | 7 +-- .../src/main/resources/application.yml | 5 ++- .../logpm/supervise/SuperviseApplication.java | 1 - .../aspect/AsyncAnnotationAspect.java | 44 +++++++++---------- 7 files changed, 33 insertions(+), 31 deletions(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/AftersalesApplication.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/AftersalesApplication.java index ec7941caf..ed1163063 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/AftersalesApplication.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/AftersalesApplication.java @@ -27,7 +27,6 @@ import org.springblade.core.transaction.annotation.SeataCloudApplication; * @author Chill */ @BladeCloudApplication -@SeataCloudApplication //@EnableWebSocket public class AftersalesApplication { @@ -35,6 +34,7 @@ public class AftersalesApplication { BladeApplication.run(ModuleNameConstant.APPLICATION_AFTERSALES_NAME, AftersalesApplication.class, args); } + /** * 如果直接使用springboot的内置容器,而不是使用独立的servlet容器,就要注入ServerEndpointExporter,外部容器则不需要。 */ diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java index 365608336..8171a6d3c 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java @@ -2,6 +2,7 @@ package com.logpm.factory.config; import com.alibaba.nacos.shaded.com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.ModuleNameConstant; import org.springblade.common.constant.RabbitConstant; import org.springframework.amqp.core.*; import org.springframework.amqp.rabbit.connection.ConnectionFactory; @@ -14,6 +15,8 @@ import org.springframework.context.annotation.Configuration; import java.util.Map; +import static io.protostuff.MapSchema.MessageFactories.HashMap; + /** * RabbitMQ配置,主要是配置队列,如果提前存在该队列,可以省略本配置类 * diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/LocalServerLoginAccountsInterceptor.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/LocalServerLoginAccountsInterceptor.java index a0d700005..2c744732a 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/LocalServerLoginAccountsInterceptor.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/LocalServerLoginAccountsInterceptor.java @@ -43,7 +43,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt try { - JSONObject data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+"admin"); + JSONObject data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+"shujutongbu"); CustomHttpServletRequestWrapper wrappedRequest = new CustomHttpServletRequestWrapper(request); if(Objects.isNull(data)){ String url = "http://"+ LauncherConstant.loginAddr(AppConstant.DEV_CODE)+"/blade-auth/oauth/token"; diff --git a/blade-service/logpm-factory/src/main/resources/application.yml b/blade-service/logpm-factory/src/main/resources/application.yml index 245dc4cfd..6ccf9fc90 100644 --- a/blade-service/logpm-factory/src/main/resources/application.yml +++ b/blade-service/logpm-factory/src/main/resources/application.yml @@ -22,11 +22,8 @@ oss: #blade配置 blade: - #本地文件上传 - file: - remote-mode: true - upload-domain: http://localhost:8999 - remote-path: /usr/share/nginx/html + data-scope: + enabled: false logging: config: classpath:logback.xml diff --git a/blade-service/logpm-old-project/src/main/resources/application.yml b/blade-service/logpm-old-project/src/main/resources/application.yml index ab56f1cbd..54fc94c20 100644 --- a/blade-service/logpm-old-project/src/main/resources/application.yml +++ b/blade-service/logpm-old-project/src/main/resources/application.yml @@ -10,7 +10,10 @@ swagger: - org.springblade - com.logpm - +#blade配置 +blade: + data-scope: + enabled: false logging: config: classpath:logback.xml diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/SuperviseApplication.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/SuperviseApplication.java index 6447a3269..0dbf98df6 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/SuperviseApplication.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/SuperviseApplication.java @@ -13,7 +13,6 @@ import org.springblade.core.transaction.annotation.SeataCloudApplication; * @author lmy */ @BladeCloudApplication -@SeataCloudApplication public class SuperviseApplication { public static void main(String[] args) { diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/aspect/AsyncAnnotationAspect.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/aspect/AsyncAnnotationAspect.java index d85373d55..f5f0be02b 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/aspect/AsyncAnnotationAspect.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/aspect/AsyncAnnotationAspect.java @@ -54,28 +54,28 @@ public class AsyncAnnotationAspect { * @return 返回被拦截方法的执行结果。 * @throws Throwable 如果执行过程中发生异常,则抛出。 */ - @Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener)") - public Object rabbitMethods(ProceedingJoinPoint joinPoint) throws Throwable { - // 在方法执行前,获取当前租户ID并设置到数据源上下文中 - String tenantId = AuthUtil.getTenantId(); - DynamicDataSourceContextHolder.push(tenantId); - // 执行原方法 - Object result = joinPoint.proceed(); - // 在方法执行后,从数据源上下文中移除租户ID - DynamicDataSourceContextHolder.poll(); - return result; - } +// @Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener)") +// public Object rabbitMethods(ProceedingJoinPoint joinPoint) throws Throwable { +// // 在方法执行前,获取当前租户ID并设置到数据源上下文中 +// String tenantId = AuthUtil.getTenantId(); +// DynamicDataSourceContextHolder.push(tenantId); +// // 执行原方法 +// Object result = joinPoint.proceed(); +// // 在方法执行后,从数据源上下文中移除租户ID +// DynamicDataSourceContextHolder.poll(); +// return result; +// } - @Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitHandler)") - public Object rabbitHandlerMethods(ProceedingJoinPoint joinPoint) throws Throwable { - // 在方法执行前,获取当前租户ID并设置到数据源上下文中 - String tenantId = AuthUtil.getTenantId(); - DynamicDataSourceContextHolder.push(tenantId); - // 执行原方法 - Object result = joinPoint.proceed(); - // 在方法执行后,从数据源上下文中移除租户ID - DynamicDataSourceContextHolder.poll(); - return result; - } +// @Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitHandler)") +// public Object rabbitHandlerMethods(ProceedingJoinPoint joinPoint) throws Throwable { +// // 在方法执行前,获取当前租户ID并设置到数据源上下文中 +// String tenantId = AuthUtil.getTenantId(); +// DynamicDataSourceContextHolder.push(tenantId); +// // 执行原方法 +// Object result = joinPoint.proceed(); +// // 在方法执行后,从数据源上下文中移除租户ID +// DynamicDataSourceContextHolder.poll(); +// return result; +// } } From 9c69378cde005f8f82363ffe7d2a102ac94eb36d Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 8 May 2024 21:02:23 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aspect/AsyncAnnotationAspect.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/AsyncAnnotationAspect.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/AsyncAnnotationAspect.java index ab25d4441..4057ca293 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/AsyncAnnotationAspect.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/AsyncAnnotationAspect.java @@ -54,28 +54,28 @@ public class AsyncAnnotationAspect { * @return 返回被拦截方法的执行结果。 * @throws Throwable 如果执行过程中发生异常,则抛出。 */ - @Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener)") - public Object rabbitMethods(ProceedingJoinPoint joinPoint) throws Throwable { - // 在方法执行前,获取当前租户ID并设置到数据源上下文中 - String tenantId = AuthUtil.getTenantId(); - DynamicDataSourceContextHolder.push(tenantId); - // 执行原方法 - Object result = joinPoint.proceed(); - // 在方法执行后,从数据源上下文中移除租户ID - DynamicDataSourceContextHolder.poll(); - return result; - } - @Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitHandler)") - public Object rabbitHandlerMethods(ProceedingJoinPoint joinPoint) throws Throwable { - // 在方法执行前,获取当前租户ID并设置到数据源上下文中 - String tenantId = AuthUtil.getTenantId(); - DynamicDataSourceContextHolder.push(tenantId); - // 执行原方法 - Object result = joinPoint.proceed(); - // 在方法执行后,从数据源上下文中移除租户ID - DynamicDataSourceContextHolder.poll(); - return result; - } +// @Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener)") +// public Object rabbitMethods(ProceedingJoinPoint joinPoint) throws Throwable { +// // 在方法执行前,获取当前租户ID并设置到数据源上下文中 +// String tenantId = AuthUtil.getTenantId(); +// DynamicDataSourceContextHolder.push(tenantId); +// // 执行原方法 +// Object result = joinPoint.proceed(); +// // 在方法执行后,从数据源上下文中移除租户ID +// DynamicDataSourceContextHolder.poll(); +// return result; +// } +// @Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitHandler)") +// public Object rabbitHandlerMethods(ProceedingJoinPoint joinPoint) throws Throwable { +// // 在方法执行前,获取当前租户ID并设置到数据源上下文中 +// String tenantId = AuthUtil.getTenantId(); +// DynamicDataSourceContextHolder.push(tenantId); +// // 执行原方法 +// Object result = joinPoint.proceed(); +// // 在方法执行后,从数据源上下文中移除租户ID +// DynamicDataSourceContextHolder.poll(); +// return result; +// } }