From 04e35d5b3c4b3bf37e4737f284b0fcafcb39188e Mon Sep 17 00:00:00 2001 From: zhangwq Date: Thu, 6 Dec 2018 15:00:05 +0800 Subject: [PATCH] =?UTF-8?q?snat=E7=AD=96=E7=95=A5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=B1=BB=E5=9E=8B=E9=80=89=E9=A1=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/IpReusePolicyCfg.java | 29 ++++ .../web/dao/configuration/IpMultiplexDao.java | 2 + .../web/dao/configuration/IpMultiplexDao.xml | 57 +++++-- .../configuration/IpAddrPoolCfgService.java | 16 +- .../configuration/IpMultiplexService.java | 17 ++- .../resources/messages/message_en.properties | 6 +- .../resources/messages/message_ru.properties | 4 + .../messages/message_zh_CN.properties | 6 +- .../ipmulitiplex/snatPolicyForm2.jsp | 140 ++++++++++++++++-- .../ipmulitiplex/snatPolicyList2.jsp | 19 ++- 10 files changed, 257 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java b/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java index a43dae6f0..461b8feea 100644 --- a/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java +++ b/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java @@ -18,6 +18,11 @@ public class IpReusePolicyCfg extends BaseCfg{ private String userName; private String addrPoolName; // 仅用于列表条件检索 + private Integer ipType; + private Integer ipPattern; + private String srcIpAddress; + private String destIpAddress; + public Integer getUserId() { return userId; } @@ -60,5 +65,29 @@ public class IpReusePolicyCfg extends BaseCfg{ public void setAddrPoolName(String addrPoolName) { this.addrPoolName = addrPoolName; } + public Integer getIpType() { + return ipType; + } + public void setIpType(Integer ipType) { + this.ipType = ipType; + } + public String getSrcIpAddress() { + return srcIpAddress; + } + public void setSrcIpAddress(String srcIpAddress) { + this.srcIpAddress = srcIpAddress; + } + public Integer getIpPattern() { + return ipPattern; + } + public void setIpPattern(Integer ipPattern) { + this.ipPattern = ipPattern; + } + public String getDestIpAddress() { + return destIpAddress; + } + public void setDestIpAddress(String destIpAddress) { + this.destIpAddress = destIpAddress; + } } diff --git a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java index 21aeb7b6c..29d1f222f 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java +++ b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java @@ -25,4 +25,6 @@ public interface IpMultiplexDao extends CrudDao{ // 校验地址池是否被引用 List checkAddrPoolIsUsed(@Param("addrPoolId")String addrPoolId); + void updatePolicyAuditStatus(IpReusePolicyCfg cfg); + } diff --git a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml index be141427b..bff96a928 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml @@ -8,7 +8,10 @@ - + + + + @@ -38,7 +41,7 @@ - r.CFG_ID,r.CFG_DESC,r.ADDR_POOL_ID,r.USER_NAME,r.USER_TYPE, + r.CFG_ID,r.CFG_DESC,r.ADDR_POOL_ID,r.USER_NAME,r.USER_TYPE,r.IP_TYPE,r.IP_PATTERN,r.SRC_IP_ADDRESS, r.ACTION,r.DO_LOG,r.IS_VALID,r.IS_AUDIT,r.CFG_REGION_CODE,r.CFG_TYPE,r.FUNCTION_ID, r.SERVICE_ID,r.COMPILE_ID,r.REQUEST_ID,r.CLASSIFY,r.ATTRIBUTE,r.LABLE, r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, @@ -75,13 +78,12 @@ AND r.compile_id=#{compileId,jdbcType=BIGINT} - - AND r.user_id in (SELECT u.id FROM user_manage u - - u.user_name LIKE concat(concat('%',#{userName,jdbcType=VARCHAR}),'%') - - ) + + AND r.src_ip_address=#{srcIpAddress,jdbcType=VARCHAR} + + AND r.user_name LIKE concat(concat('%',#{userName,jdbcType=VARCHAR}),'%') + AND r.addr_pool_id in (SELECT i.cfg_id FROM ip_reuse_addr_pool i @@ -173,6 +175,9 @@ addr_pool_id, user_name, user_type, + ip_type, + ip_pattern, + src_ip_address, action, do_log, is_valid, @@ -204,6 +209,9 @@ #{addrPoolId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{userType,jdbcType=VARCHAR}, + #{ipType,jdbcType=INTEGER}, + #{ipPattern,jdbcType=INTEGER}, + #{srcIpAddress,jdbcType=VARCHAR}, #{action,jdbcType=INTEGER}, #{doLog,jdbcType=INTEGER}, 0, @@ -246,7 +254,7 @@ update ip_reuse_policy_cfg - + user_name = #{userName,jdbcType=VARCHAR}, @@ -258,6 +266,15 @@ addr_pool_id = #{addrPoolId,jdbcType=INTEGER}, + + ip_type = #{ipType,jdbcType=INTEGER}, + + ip_pattern=#{ipPattern,jdbcType=INTEGER}, + + + src_ip_address=#{srcIpAddress,jdbcType=VARCHAR}, + translate_param = #{translateParam,jdbcType=VARCHAR}, @@ -312,6 +329,28 @@ + + update ip_reuse_policy_cfg + + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + + WHERE cfg_id = #{cfgId,jdbcType=BIGINT} + + + + + -
+
- +
@@ -174,18 +209,90 @@ $(function(){
+
-
- +
+
- +
-
+
-
+
+ + +
+ +
+ + +
+ +
+
+
+ +
+ +
+
+
+
@@ -204,6 +311,7 @@ $(function(){
+ <%--
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%> --%>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %> diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp index c391c8551..a64838f9d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp @@ -13,6 +13,8 @@ $("#intype").val("${cfg.addrPoolName}"); }else if("${cfg.userName}"){ $("#intype").val("${cfg.userName}"); + }else if("${cfg.srcIpAddress}"){ + $("#intype").val("${cfg.srcIpAddress}"); }else if("${cfg.compileId}"){ $("#intype").val("${cfg.compileId}"); }else{ @@ -97,8 +99,9 @@ - + + @@ -281,7 +284,9 @@ + + <%-- --%> @@ -315,6 +320,17 @@ + + + + + + + + + + + @@ -322,6 +338,7 @@ + ${indexCfg.srcIpAddress } <%--