不能删除ASN 组中的最后一个ASN IP,做了前台Ajax验证
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user