不能删除ASN 组中的最后一个ASN IP,做了前台Ajax验证

This commit is contained in:
wangxin
2018-09-03 13:02:24 +08:00
parent ff449143e6
commit ba295706f3
7 changed files with 63 additions and 9 deletions

View File

@@ -171,4 +171,22 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
// TODO Auto-generated method stub
return asnIpCfgDao.findPolicyGroupInfosByType(groupId);
}
/**
* 选中组中是否含有只剩一个未删除IP的组
* @param serviceGroupIds
* @return
*/
public boolean hasLastIp(String serviceGroupIds) {
// TODO Auto-generated method stub
for(String groupId:serviceGroupIds.split(",")) {
Long.parseLong(groupId);
}
List<Integer> countList=asnIpCfgDao.countValidIPs(serviceGroupIds);
for(Integer count:countList) {
if(count==1) {
return true;
}
}
return false;
}
}