DNAT复用策略增加用户和用户类型
调整SNAT地址池管理 配置IP的格式为:IP sql提交
This commit is contained in:
@@ -40,7 +40,7 @@ public class IpReuseDnatPolicyCfg extends IpPortCfg{
|
||||
|
||||
@Expose
|
||||
@SerializedName("translatedDestIp")
|
||||
@ExcelField(title="translated_dest_ip",sort=6)
|
||||
//@ExcelField(title="translated_dest_ip",sort=6)
|
||||
private String destIpAddress;
|
||||
|
||||
@Expose
|
||||
@@ -54,8 +54,31 @@ public class IpReuseDnatPolicyCfg extends IpPortCfg{
|
||||
@Expose
|
||||
@SerializedName("effectiveRange")
|
||||
private String areaEffectiveIds;
|
||||
@ExcelField(title="user",sort=10)
|
||||
@Expose
|
||||
private String translatedUserId;
|
||||
@Expose
|
||||
@ExcelField(title="user_type",sort=9)
|
||||
private String translatedUserType;
|
||||
|
||||
|
||||
|
||||
public String getTranslatedUserId() {
|
||||
return translatedUserId;
|
||||
}
|
||||
|
||||
public void setTranslatedUserId(String translatedUserId) {
|
||||
this.translatedUserId = translatedUserId;
|
||||
}
|
||||
|
||||
public String getTranslatedUserType() {
|
||||
return translatedUserType;
|
||||
}
|
||||
|
||||
public void setTranslatedUserType(String translatedUserType) {
|
||||
this.translatedUserType = translatedUserType;
|
||||
}
|
||||
|
||||
public String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class IpReusePolicyCfg extends BaseCfg<IpReusePolicyCfg>{
|
||||
|
||||
private Integer ipType;
|
||||
private Integer ipPattern;
|
||||
@ExcelField(title="ip",sort=6)
|
||||
//@ExcelField(title="ip",sort=6)
|
||||
private String srcIpAddress;
|
||||
private String destIpAddress;
|
||||
@Expose
|
||||
|
||||
@@ -343,6 +343,10 @@ public class IpMultiplexController extends CommonController {
|
||||
|
||||
Page<BaseIpCfg> page = ipMultiplexService.findPageDnat(new Page<BaseIpCfg>(request, response, "r"), cfg);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
// 获取用户信息 地址池信息
|
||||
List<UserManage> users = userManageService.findUsers();
|
||||
model.addAttribute("users", users);
|
||||
initFormCondition(model, cfg);
|
||||
|
||||
return "/cfg/manipulation/ipmulitiplex/dnatPolicyList2";
|
||||
@@ -363,6 +367,10 @@ public class IpMultiplexController extends CommonController {
|
||||
} else {
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
|
||||
// 获取用户信息 地址池信息
|
||||
List<UserManage> users = userManageService.findUsers();
|
||||
model.addAttribute("users", users);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/manipulation/ipmulitiplex/dnatPolicyForm2";
|
||||
}
|
||||
@@ -581,7 +589,14 @@ public class IpMultiplexController extends CommonController {
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
IpReuseDnatPolicyCfg dnat=(IpReuseDnatPolicyCfg) cfg;
|
||||
if(dnat.getTranslatedUserType().equals("VPN")){
|
||||
dnat.setTranslatedUserType(msgProp.getProperty("policy_vpn_user","VPN"));
|
||||
}else if(dnat.getTranslatedUserType().equals("SIPv4")){
|
||||
dnat.setTranslatedUserType(msgProp.getProperty("policy_sipv4_user","SIPv4"));
|
||||
}else if(dnat.getTranslatedUserType().equals("SIPv6")){
|
||||
dnat.setTranslatedUserType(msgProp.getProperty("policy_sipv6_user","SIPv6"));
|
||||
}
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="translated_dest_ip" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<!-- <result column="translated_dest_ip" property="destIpAddress" jdbcType="VARCHAR" /> -->
|
||||
<result column="original_dest_ip" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="translated_dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
<result column="original_dest_port" property="srcPort" jdbcType="VARCHAR" />
|
||||
@@ -73,6 +73,9 @@
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
|
||||
<result column="translated_user_type" property="translatedUserType" jdbcType="VARCHAR" />
|
||||
<result column="translated_user_id" property="translatedUserId" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="policyColumns">
|
||||
@@ -86,11 +89,11 @@
|
||||
|
||||
<sql id="dnatPolicyColumns" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.original_dest_ip,a.ip_pattern,a.port_pattern,a.original_dest_port,
|
||||
a.protocol,a.protocol_id,a.cfg_type,a.action,a.translated_dest_port,a.translated_dest_ip,a.is_valid,
|
||||
a.protocol,a.protocol_id,a.cfg_type,a.action,a.translated_dest_port,a.is_valid,
|
||||
a.is_audit,a.creator_id,a.create_time,a.editor_id,a.edit_time,a.auditor_id,a.audit_time,
|
||||
a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
|
||||
a.area_effective_ids,a.function_id,a.cfg_region_code,a.user_region1,a.user_region2,
|
||||
a.user_region3,a.user_region4,a.user_region5
|
||||
a.user_region3,a.user_region4,a.user_region5,a.translated_user_type,a.translated_user_id
|
||||
</sql>
|
||||
|
||||
<select id="findPage" resultMap="policyMap">
|
||||
@@ -438,7 +441,7 @@
|
||||
port_pattern,
|
||||
original_dest_ip,
|
||||
original_dest_port,
|
||||
translated_dest_ip,
|
||||
<!-- translated_dest_ip, -->
|
||||
translated_dest_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
@@ -467,7 +470,9 @@
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
user_region5,
|
||||
translated_user_type,
|
||||
translated_user_id
|
||||
)VALUES (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
@@ -475,7 +480,7 @@
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
<!-- #{destIpAddress,jdbcType=VARCHAR}, -->
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
@@ -504,7 +509,9 @@
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
#{userRegion5,jdbcType=VARCHAR},
|
||||
#{translatedUserType,jdbcType=VARCHAR},
|
||||
#{translatedUserId,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -527,9 +534,9 @@
|
||||
<if test="srcIpAddress != null">
|
||||
original_dest_ip=#{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
<!-- <if test="destIpAddress != null and destIpAddress != ''">
|
||||
translated_dest_ip=#{destIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</if> -->
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
original_dest_port=#{srcPort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -587,6 +594,12 @@
|
||||
<if test="areaEffectiveIds != null" >
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="translatedUserType != null and translatedUserType != ''">
|
||||
translated_user_type=#{translatedUserType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="translatedUserId != null and translatedUserId != ''">
|
||||
translated_user_id=#{translatedUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
WHERE cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
@@ -628,9 +641,9 @@
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND a.original_dest_ip=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
<!-- <if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND a.translated_dest_ip=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</if> -->
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND a.original_dest_port=#{srcPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
@@ -657,7 +670,7 @@
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName != ''">
|
||||
AND a.AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
@@ -676,6 +689,9 @@
|
||||
<if test="lable != null and lable != ''">
|
||||
AND a.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="translatedUserId != null and translatedUserId != ''">
|
||||
AND a.translated_user_id LIKE concat(concat('%',#{translatedUserId,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND a.function_id=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user