域清空时取消obj-group-list maat配置

This commit is contained in:
wangxin
2019-06-14 11:29:03 +08:00
parent 1c4308e536
commit f232a5b90a
5 changed files with 93 additions and 11 deletions

View File

@@ -605,7 +605,6 @@ public class ConfigConvertUtil {
if (!groupIdSet.contains(baseIpCfg.getGroupId())) {
GroupCfg group = new GroupCfg();
//groupId = ConfigServiceUtil.getId(2, 1).get(0);
groupIdSet.add(baseIpCfg.getGroupId());
group.setGroupId(baseIpCfg.getGroupId());
group.setCompileId(baseCfg.getCompileId());
group.setAuditTime(baseCfg.getAuditTime());
@@ -695,7 +694,7 @@ public class ConfigConvertUtil {
// List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
for (int i = 0; i < srcList.size(); i++) {
// 一条业务配置创建一个分组
com.nis.domain.maat.MaatCfg.NumBoundaryCfg cfg = new com.nis.domain.maat.MaatCfg.NumBoundaryCfg();
NumBoundaryCfg cfg = new NumBoundaryCfg();
BeanUtils.copyProperties(srcList.get(i), cfg);
if(!groupIdSet.contains(cfg.getGroupId())){
GroupCfg group = new GroupCfg();
@@ -741,6 +740,43 @@ public class ConfigConvertUtil {
map.put("dstList", dstList);
return map;
}
public static <T> Map<String, List> emptyGroupConvert(Integer cfgType, BaseCfg baseCfg,
List groupRelationList, Map<String,Object> maatTableMap, Set<Integer> groupIdSet) {
Map<String, List> map = new HashMap();
if (cfgType == 1) {
if(maatTableMap.containsKey("ipMaatTable")){
Map<String,String> groupMap=(Map<String,String>)maatTableMap.get("ipMaatTable");
for(Map.Entry<String,String> e:groupMap.entrySet()){
if(!groupIdSet.contains(Integer.parseInt(e.getKey()))){
GroupCfg group = new GroupCfg();
group.setGroupId(Integer.parseInt(e.getKey()));
group.setCompileId(baseCfg.getCompileId());
group.setAuditTime(baseCfg.getAuditTime());
group.setIsValid(baseCfg.getIsValid());
groupRelationList.add(group);
groupIdSet.add(Integer.parseInt(e.getKey()));
}
}
}
} else if (cfgType == 2 || cfgType == 3) {
if(maatTableMap.containsKey("stringMaatTable")){
Map<String,String> groupMap=(Map<String,String>)maatTableMap.get("stringMaatTable");
for(Map.Entry<String,String> e:groupMap.entrySet()){
if(!groupIdSet.contains(Integer.parseInt(e.getKey()))){
GroupCfg group = new GroupCfg();
group.setGroupId(Integer.parseInt(e.getKey()));
group.setCompileId(baseCfg.getCompileId());
group.setAuditTime(baseCfg.getAuditTime());
group.setIsValid(baseCfg.getIsValid());
groupRelationList.add(group);
groupIdSet.add(Integer.parseInt(e.getKey()));
}
}
}
}
map.put("groupList", groupRelationList);
return map;
}
/**
* 转换成字符串
*