From 9844445fbaaf5a799f4ce2d0243c899275411ad4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 15 Nov 2022 14:48:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=BC=93=E5=AD=98=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/common/CustomerOrgRedis.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java index 23a7f1dd3c..bf8425222a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java @@ -1,7 +1,6 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.dto.form.CustomerGridFormDTO; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.CommonAggFeignClient; @@ -13,6 +12,7 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -55,6 +55,10 @@ public class CustomerOrgRedis { * @date 2021/11/5 3:12 下午 */ public static GridInfoCache getGridInfo(String gridId){ + if (StringUtils.isBlank(gridId)) { + log.warn("查询网格缓存,gridId is null"); + return null; + } String key = RedisKeys.getGridInfoKey(gridId); Map grid = customerOrgRedis.redisUtils.hGetAll(key); if (!CollectionUtils.isEmpty(grid)) {