1.地址池管理增加 删除限制 2.策略分组管理去掉SNAT/DNAT IP类型
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.nis.web.controller.configuration.maintenance;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -16,6 +17,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
@@ -160,4 +162,24 @@ public class IpAddrPoolController extends BaseController{
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验地址池是否被策略引用
|
||||
* @param addrPoolIds
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/ajaxIsUsed"})
|
||||
public boolean ajaxIsUsed(String addrPoolIds, HttpServletRequest request, HttpServletResponse response){
|
||||
for (String addrPoolId : addrPoolIds.split(",")) {
|
||||
List<BaseIpCfg> ipList = ipCfgService.checkAddrPoolIsUsed(addrPoolId);
|
||||
if(ipList != null && ipList.size() > 0){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
<if test="groupType != null">
|
||||
AND r.group_type =#{groupType }
|
||||
</if>
|
||||
<if test="groupType == null">
|
||||
AND r.group_type != 2
|
||||
AND r.group_type != 3
|
||||
</if>
|
||||
<if test="asnNo != null">
|
||||
AND r.asn_no =#{asnNo }
|
||||
</if>
|
||||
|
||||
@@ -47,4 +47,7 @@ public interface IpCfgDao extends CrudDao<BaseIpCfg>{
|
||||
public void auditCfg(BaseCfg entity);
|
||||
public List<CfgIndexInfo> getIpCfgList(CfgIndexInfo entity);
|
||||
|
||||
// 校验地址池是否被策略引用
|
||||
public List<BaseIpCfg> checkAddrPoolIsUsed(@Param("addrPoolId")String addrPoolId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1142,4 +1142,15 @@
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="checkAddrPoolIsUsed" resultMap="BaseIpMap">
|
||||
SELECT
|
||||
<include refid="BaseIpCfg_Column_List_with_id" />
|
||||
FROM
|
||||
ip_port_cfg
|
||||
WHERE
|
||||
is_valid != -1 AND
|
||||
ir_type IS NOT NULL AND
|
||||
user_region2 = #{addrPoolId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -931,4 +931,13 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验地址池是否被策略引用
|
||||
* @param addrPoolId
|
||||
* @return
|
||||
*/
|
||||
public List<BaseIpCfg> checkAddrPoolIsUsed(String addrPoolId) {
|
||||
return ipCfgDao.checkAddrPoolIsUsed(addrPoolId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user