修改公共组管理删除校验

This commit is contained in:
zhangwenqing
2019-06-05 18:33:30 +08:00
parent 94e764f97e
commit d0499163b3
4 changed files with 8 additions and 65 deletions

View File

@@ -108,49 +108,6 @@ public class CommonGroupManageService extends BaseService{
return list;
}
/**
* 删除时校验分组是否被引用,未被引用可删除
* @param groupIds
* @return false未被引用 / true已被引用
*/
public boolean checkIsIssued(String groupIds) {
// 组织格式
Map<Integer,Set<Integer>> map = new HashMap<Integer,Set<Integer>>();
for(String str : groupIds.split(",")) {
Integer id = Integer.valueOf(str.substring(0, str.indexOf("_")));
Integer type = Integer.valueOf(str.substring(str.indexOf("_")+1));
if(map.containsKey(type)) {
Set<Integer> set = map.get(type);
set.add(id);
map.put(type, set);
}else {
Set<Integer> set = new HashSet<Integer>();
set.add(id);
map.put(type, set);
}
}
// 根据类型去相应配置查询,若存在被引用的则限制操作
Set<Integer> keySet = map.keySet();
for (Integer type : keySet) {
Set<Integer> set = map.get(type);
String str = set.toString();
String ids = str.substring(1, str.indexOf("]"));
if(type == 5) {
List<IpCommCfg> list = ipCommGroupCfgDao.getCfgInfoByGroupIds(ids);
if(list.size() > 0) {
return true;
}
}else if(type == 7) {
List<UrlCommCfg> list = urlCommGroupDao.getCfgInfoByGroupIds(ids);
if(list.size() > 0) {
return true;
}
}
}
return false;
}
/**
* 更新分组状态 policy_group_info ud_flag0无有效的域配置 1存在有效的域配置
* @param serviceGroupId