在取消maat配置时添加对不是公共组的判断

This commit is contained in:
renkaige
2019-01-14 20:13:51 +06:00
parent 55121ff91f
commit 660ba23c78

View File

@@ -1760,17 +1760,22 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
regionVal = keyMap.get(groupRegionStr);
}
String[] commonsplit = org.apache.commons.lang.StringUtils.split(regionVal, ";");
for (String regionKey : commonsplit) {
String maatKey = regionKey.substring(0, regionKey.indexOf("-"));
for (String db : Constants.COMMONGROUPDBARR) {
int everyDb = Integer.parseInt(db);
transaction.select(everyDb);
String obsoleteKey = maatKey.replace("EFFECTIVE_RULE", "OBSOLETE_RULE");
transaction.rename(maatKey, obsoleteKey);
Double maatVersion = dbVersionMap.get(everyDb);
updateMaatInfo(expressionList, obsoleteKey, transaction, maatVersion, everyDb, true);
if (regionVal != null && !regionVal.trim().equals("")) {
String[] commonsplit = org.apache.commons.lang.StringUtils.split(regionVal, ";");
for (String regionKey : commonsplit) {
String maatKey = regionKey.substring(0, regionKey.indexOf("-"));
for (String db : Constants.COMMONGROUPDBARR) {
int everyDb = Integer.parseInt(db);
transaction.select(everyDb);
String obsoleteKey = maatKey.replace("EFFECTIVE_RULE", "OBSOLETE_RULE");
transaction.rename(maatKey, obsoleteKey);
Double maatVersion = dbVersionMap.get(everyDb);
updateMaatInfo(expressionList, obsoleteKey, transaction, maatVersion, everyDb, true);
}
}
}else {
throw new ServiceRuntimeException("修改公共组域配置时,无法获取到groupid="+groupId+"的公共组,请检查配置参数是否正确",
RestBusinessCode.ConfigSourceIsNull.getValue());
}
}