From 6129a3860e7971f5a327882b10039e0ab2cc05af Mon Sep 17 00:00:00 2001 From: renkaige Date: Tue, 15 Jan 2019 12:04:20 +0600 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=99=AE=E9=80=9A=E7=B1=BB?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8F=96=E6=B6=88=E6=97=B6,=E4=B8=8D?= =?UTF-8?q?=E4=BF=9D=E7=95=99groupid=E6=97=B6,=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/restful/ConfigJedisServiceimpl.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/nis/web/service/restful/ConfigJedisServiceimpl.java b/src/main/java/com/nis/web/service/restful/ConfigJedisServiceimpl.java index 1662339..38af07a 100644 --- a/src/main/java/com/nis/web/service/restful/ConfigJedisServiceimpl.java +++ b/src/main/java/com/nis/web/service/restful/ConfigJedisServiceimpl.java @@ -1507,7 +1507,8 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { groupId = Long.parseLong( groupRegion.replace("GROUPREGION:", ""));// 获取真实的groupid } - if (!keepGroupIdList.contains(groupId)) {// 如果不是需要保留的groupid则失效(公共组不失效[如需失效使用公共组失效接口],非公共组则失效) + if (keepGroupIdList == null || keepGroupIdList.size() == 0 + || !keepGroupIdList.contains(groupId)) {// 如果不是需要保留的groupid则失效(公共组不失效[如需失效使用公共组失效接口],非公共组则失效) groupRegionVal = groupRegionVal .replace("EFFECTIVE_RULE", "OBSOLETE_RULE"); String[] split = org.apache.commons.lang.StringUtils @@ -1536,10 +1537,10 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { } } catch (Exception e) { - throw new ServiceRuntimeException("从" + idRelaRedisDBIndex - + "号redis库中删除" + groupRegion - + "失败,redis中不存在该值,请联系开发人员检查删除逻辑是否正确或redis数据是否出现了异常", - RestBusinessCode.KeyNotExistsInRedis.getValue()); + throw new ServiceRuntimeException( + "从" + idRelaRedisDBIndex + "号redis库中删除" + groupRegion + + "失败,失败原因:" + ExceptionUtil.getExceptionMsg(e), + RestBusinessCode.DeleteDataInError.getValue()); } } // @@ -1773,9 +1774,9 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { updateMaatInfo(expressionList, obsoleteKey, transaction, maatVersion, everyDb, true); } } - }else { - throw new ServiceRuntimeException("修改公共组域配置时,无法获取到groupid="+groupId+"的公共组,请检查配置参数是否正确", - RestBusinessCode.ConfigSourceIsNull.getValue()); + } else { + throw new ServiceRuntimeException("修改公共组域配置时,无法获取到groupid=" + groupId + "的公共组,请检查配置参数是否正确", + RestBusinessCode.ConfigSourceIsNull.getValue()); } }