From ac7fc2032b0e526e3d6061008463fc092c5d11d5 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 8 Aug 2022 14:36:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8A=A5=E8=A1=A8=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0AOP=E6=8B=A6=E6=88=AA=E5=99=A8=EF=BC=8C=E5=92=8C?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84=E6=B3=A8=E8=A7=A3=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E6=8B=A6=E6=88=AAurl=E5=8F=82=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E7=BB=99=E5=85=B7=E6=9C=89@RequestBody=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=E7=9A=84=E5=85=A5=E5=8F=82=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/aspect/ReportRequestAspect.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ReportRequestAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ReportRequestAspect.java index 81dc4facf1..2c7dc898d9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ReportRequestAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ReportRequestAspect.java @@ -1,7 +1,10 @@ package com.epmet.commons.tools.aspect; import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.redis.RedisUtils; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; @@ -25,6 +28,7 @@ import java.util.Map; @Aspect @Component @Order(20) +@Slf4j public class ReportRequestAspect { /** @@ -46,6 +50,11 @@ public class ReportRequestAspect { } Map cachedParams = redisUtils.hGetAll(paramKey); + if (cachedParams == null || cachedParams.size() == 0) { + log.warn("【报表服务】根据paramKey:{}未获取到有效的参数缓存。", paramKey); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "参数失效", "参数失效"); + // redis中没有此参数 + } // 使用方法签名获取出参数class列表 Object[] args = point.getArgs();