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; +// } }