(1)审核修正userregion,定时userregion修正

(2)form表单monit修正,list group为空报错修复
(3)删除组下的域配置相关逻辑修正
This commit is contained in:
wangxin
2019-06-14 18:47:31 +08:00
parent 0f06c49b48
commit 1d64a1bc0f
11 changed files with 392 additions and 135 deletions

View File

@@ -3332,30 +3332,24 @@ public abstract class BaseService {
//遍历,获取需要下发配置的组
StringBuffer realGroupIds=new StringBuffer();
for(PolicyGroupInfo policyGroupInfo:policyGroupInfos){
//删除的时候
if(policyGroupInfo.getUdFlag().equals(2)){
//if(policyGroupInfo.getUdFlag().equals(2)){
realGroupIds.append(policyGroupInfo.getServiceGroupId()).append(",");
//}
//所有域都删除的时候
if(policyGroupInfo.getUdFlag().equals(0)){
if(policyGroupInfo.getGroupType().equals(Constants.IP_OBJ_GROUP_TYPE)){
if(policyGroupInfo.getIsValid().equals(0)){
ipDeletedGroups.add(policyGroupInfo.getServiceGroupId().toString());
}
ipDeletedGroups.add(policyGroupInfo.getServiceGroupId().toString());
}
if(policyGroupInfo.getGroupType().equals(Constants.URL_OBJ_GROUP_TYPE)){
if(policyGroupInfo.getIsValid().equals(0)){
urlDeletedGroups.add(policyGroupInfo.getServiceGroupId().toString());
}
urlDeletedGroups.add(policyGroupInfo.getServiceGroupId().toString());
}
if(policyGroupInfo.getGroupType().equals(Constants.SUBID_OBJ_GROUP_TYPE)){
if(policyGroupInfo.getIsValid().equals(0)){
subIdDeletedGroups.add(policyGroupInfo.getServiceGroupId().toString());
}
subIdDeletedGroups.add(policyGroupInfo.getServiceGroupId().toString());
}
if(policyGroupInfo.getGroupType().equals(Constants.DOMAIN_OBJ_GROUP_TYPE)){
if(policyGroupInfo.getIsValid().equals(0)){
domainDeletedGroups.add(policyGroupInfo.getServiceGroupId().toString());
}
domainDeletedGroups.add(policyGroupInfo.getServiceGroupId().toString());
}
}
}
if(realGroupIds.toString().endsWith(",")){
@@ -3363,6 +3357,10 @@ public abstract class BaseService {
}
List<CfgIndexInfo> toUpdateCfgIndexInfos=new ArrayList<>();
List<CfgIndexInfo> toCancelCfgIndexInfos=new ArrayList<>();
//没有
if(StringUtils.isBlank(realGroupIds.toString())){
return true;
}
//查询cfg_index_info表获取所有用到了这个group_id的非删除配置
List<CfgIndexInfo> cfgIndexInfos=commonPolicyDao.getObjGroupListByGroupIds(realGroupIds.toString(),null,null);
@@ -3404,10 +3402,14 @@ public abstract class BaseService {
if(CollectionUtils.isEmpty(cfgIndexInfo.getIpCommGroupCfgList())&&
CollectionUtils.isEmpty(cfgIndexInfo.getUrlCommGroupList())&&CollectionUtils.isEmpty(cfgIndexInfo.getScriberIdCommGroupList())&&
CollectionUtils.isEmpty(cfgIndexInfo.getDomainCommGroupList())){
cfgIndexInfo.setIsValid(Constants.VALID_NO);
cfgIndexInfo.setIsAudit(Constants.AUDIT_NOT_YES);
cfgIndexInfo.setCommonGroupIds("");
toCancelCfgIndexInfos.add(cfgIndexInfo);
if(cfgIndexInfo.getIsValid()==Constants.VALID_NO){//未生效
toUpdateCfgIndexInfos.add(cfgIndexInfo);
}else{//生效
cfgIndexInfo.setIsValid(Constants.VALID_NO);
cfgIndexInfo.setIsAudit(Constants.AUDIT_NOT_YES);
toCancelCfgIndexInfos.add(cfgIndexInfo);
}
}else if(!oldCommonGroupIds.equals(cfgIndexInfo.getCommonGroupIds())){
toUpdateCfgIndexInfos.add(cfgIndexInfo);
//commonPolicyDao.updateCfgIndexCommonGroupIds(cfgIndexInfo);
@@ -3454,14 +3456,8 @@ public abstract class BaseService {
if(service.containsKey("userRegionList")){
//Map<String,Object> userregionMap=new HashMap<>();
//userRegionList=(List<Map<String, Object>>) service.get("userRegionList");
if(serviceId.equals(576)){
String _userregion=ConfigConvertUtil.generateCommonGroupDefaultUserRegion(interceptUserRegionMap,serviceId);
userRegion.append(_userregion);
}else if(serviceId.equals(512)){
cfgIndexInfo.setAction(2);
String _userregion=ConfigConvertUtil.generateCommonGroupDefaultUserRegion(interceptUserRegionMap,serviceId);
userRegion.append(_userregion);
}
String _userregion=ConfigConvertUtil.generateCommonGroupDefaultUserRegion(interceptUserRegionMap,serviceId);
userRegion.append(_userregion);
}
}
compileIds.add(cfgIndexInfo.getCompileId());
@@ -3539,7 +3535,7 @@ public abstract class BaseService {
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
}
}else if(cfgIndexInfo.getIsValid().equals(Constants.VALID_NO)){//生效的配置置为了失效
}else if(cfgIndexInfo.getIsValid().equals(Constants.VALID_NO)&&cfgIndexInfo.getIsAudit().equals(Constants.AUDIT_NOT_YES)){//生效的配置 置为了失效
maatCfg.setCompileId(cfgIndexInfo.getCompileId());
maatCfg.setServiceId(cfgIndexInfo.getServiceId());
maatCfg.setIsValid(0);//无效