diff --git a/src/main/java/com/nis/domain/configuration/IpReuseDnatPolicyCfg.java b/src/main/java/com/nis/domain/configuration/IpReuseDnatPolicyCfg.java new file mode 100644 index 000000000..a3747e6fc --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/IpReuseDnatPolicyCfg.java @@ -0,0 +1,133 @@ +package com.nis.domain.configuration; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.nis.util.Constants; + +/** + * IP复用DNAT策略实体 + * @author dell + * + */ +public class IpReuseDnatPolicyCfg extends IpPortCfg{ + + private static final long serialVersionUID = 3965263675989864475L; + private String indexTable="ip_reuse_dnat_policy"; + + @Expose + @SerializedName("configId") + private Long cfgId; + + @Expose + @SerializedName("originalAddrType") + private Integer ipType; + + @Expose + @SerializedName("originalDestIp") + private String srcIpAddress; + + @Expose + @SerializedName("originalDestPort") + private String srcPort; + + @Expose + @SerializedName("originalProtocol") + private Integer protocol; + + @Expose + @SerializedName("translatedDestIp") + private String destIpAddress; + + @Expose + @SerializedName("translatedDestPort") + private String destPort; + + @Expose + private Integer doLog = Constants.MAAT_CFG_DOLOG_DEFAULT; + + @Expose + @SerializedName("effectiveRange") + private String areaEffectiveIds; + + + public String getIndexTable() { + return indexTable; + } + + public void setIndexTable(String indexTable) { + this.indexTable = indexTable; + } + + public Integer getIpType() { + return ipType; + } + + public void setIpType(Integer ipType) { + this.ipType = ipType; + } + + public Integer getProtocol() { + return protocol; + } + + public void setProtocol(Integer protocol) { + this.protocol = protocol; + } + + public Long getCfgId() { + return cfgId; + } + + public void setCfgId(Long cfgId) { + this.cfgId = cfgId; + } + + public String getSrcIpAddress() { + return srcIpAddress; + } + + public void setSrcIpAddress(String srcIpAddress) { + this.srcIpAddress = srcIpAddress; + } + + public String getSrcPort() { + return srcPort; + } + + public void setSrcPort(String srcPort) { + this.srcPort = srcPort; + } + + public String getDestIpAddress() { + return destIpAddress; + } + + public void setDestIpAddress(String destIpAddress) { + this.destIpAddress = destIpAddress; + } + + public String getDestPort() { + return destPort; + } + + public void setDestPort(String destPort) { + this.destPort = destPort; + } + + public Integer getDoLog() { + return doLog; + } + + public void setDoLog(Integer doLog) { + this.doLog = doLog; + } + + public String getAreaEffectiveIds() { + return areaEffectiveIds; + } + + public void setAreaEffectiveIds(String areaEffectiveIds) { + this.areaEffectiveIds = areaEffectiveIds; + } + +} diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java index 75b52708b..24833bb54 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java @@ -33,6 +33,7 @@ import com.nis.domain.basics.PolicyGroupInfo; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.IpAddrPoolCfg; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.IpReuseDnatPolicyCfg; import com.nis.domain.configuration.IpReusePolicyCfg; import com.nis.domain.configuration.UserManage; import com.nis.domain.configuration.template.IpMultiplexPolicyTemplate; @@ -280,42 +281,95 @@ public class IpMultiplexController extends CommonController { @RequestMapping(value = {"/dnatPolicyList"}) - public String dnatPolicyList(String cfgName,Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) { - this._ipList(cfgName,model, cfg, request, response); - return "/cfg/manipulation/ipmulitiplex/dnatPolicyList"; + public String dnatPolicyList(String cfgName,Model model,@ModelAttribute("cfg")IpReuseDnatPolicyCfg cfg, + HttpServletRequest request,HttpServletResponse response) { + //this._ipList(cfgName,model, cfg, request, response); + + Page page = ipMultiplexService.findPageDnat(new Page(request, response,"r"), cfg); + model.addAttribute("page", page); + initFormCondition(model,cfg); + + return "/cfg/manipulation/ipmulitiplex/dnatPolicyList2"; } @RequestMapping(value = {"/dnatPolicyForm"}) @RequiresPermissions(value={"dnat_policy:config"}) - public String dnatPolicyForm(String cfgName,Model model,String ids,Integer functionId,BaseIpCfg entity) { - this._ipForm(cfgName,model, ids, functionId, entity); - // 获取拥有区域信息的策略分组 - List policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(3); - model.addAttribute("policyGroups", policyGroups); - model.addAttribute("urlPrefix","/manipulation/ipmulitiplex"); - return "/cfg/manipulation/ipmulitiplex/dnatPolicyForm"; + public String dnatPolicyForm(String cfgName,Model model,String ids,Integer functionId,IpReuseDnatPolicyCfg cfg) { + //this._ipForm(cfgName,model, ids, functionId, entity); + + if(cfg == null){ + cfg=new IpReuseDnatPolicyCfg(); + } + if(!StringUtil.isEmpty(ids)){ + cfg = ipMultiplexService.getDnatPolicyCfg(Long.valueOf(ids),null); + initUpdateFormCondition(model, cfg); + }else{ + initFormCondition(model, cfg); + } + model.addAttribute("_cfg", cfg); + return "/cfg/manipulation/ipmulitiplex/dnatPolicyForm2"; } @RequestMapping(value = {"/saveOrUpdateDnat"}) - public String saveOrUpdateDnat(String cfgName,RedirectAttributes model, IpPortCfg cfg) { - // 设置生效区域信息 - groupAreaService.setAreaCodeByGroupId(cfg); - this._saveOrUpdateIp(cfgName,model, cfg); + public String saveOrUpdateDnat(Model model, RedirectAttributes redirectAttributes, IpReuseDnatPolicyCfg cfg, + HttpServletRequest request,HttpServletResponse response) { + try{ + // 添加策略配置信息 + ipMultiplexService.saveOrUpdateDnat(cfg, request, response); + addMessage(redirectAttributes,"success","save_success"); + }catch(Exception e) { + e.printStackTrace(); + if(e instanceof MaatConvertException) { + addMessage(redirectAttributes,"error", "request_service_failed"); + }else { + addMessage(redirectAttributes,"error", "save_failed"); + } + } return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+cfg.getFunctionId(); } @RequestMapping(value = {"/dnatDelete"}) @RequiresPermissions("dnat_policy:config") - public String dnatDelete(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) { - this._deleteIp(cfgName,ids, compileIds, functionId, model); + public String dnatDelete(String ids, Integer isValid, Integer functionId,RedirectAttributes redirectAttributes) { + //this._deleteIp(cfgName,ids, compileIds, functionId, model); + + try{ + if(!StringUtil.isEmpty(ids)){ + ipMultiplexService.deleteDnat(isValid,ids,functionId); + } + addMessage(redirectAttributes,"success","delete_success"); + }catch(Exception e){ + logger.error(e); + addMessage(redirectAttributes,"error","delete_failed"); + } + return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+functionId; } @RequestMapping(value = {"/auditDnat"}) @RequiresPermissions("dnat_policy:confirm") - public String auditDnat(String cfgName,String ids,IpPortCfg cfg,RedirectAttributes redirectAttributes) { - this._auditIp(cfgName,ids, cfg, redirectAttributes); - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+cfg.getFunctionId(); + public String auditDnat(String ids,Integer isAudit,Integer isValid,Integer functionId,RedirectAttributes redirectAttributes) { + //this._auditIp(cfgName,ids, cfg, redirectAttributes); + + if(!StringUtil.isEmpty(ids)){ + String[] idArray = ids.split(","); + Date auditTime=new Date(); + for(String id :idArray){ + try { + ipMultiplexService.auditDnatPolicy(isAudit,isValid,functionId,id,auditTime); + } catch (Exception e) { + e.printStackTrace(); + logger.error("DNAT策略配置下发失败:"+e.getMessage()); + if(e instanceof MaatConvertException) { + addMessage(redirectAttributes,"error", "request_service_failed"); + }else { + addMessage(redirectAttributes,"error", "audit_failed"); + } + } + } + + } + return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+functionId; } //snat配置导出 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 29d1f222f..6abe1e159 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java +++ b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java @@ -4,6 +4,8 @@ import java.util.List; import org.apache.ibatis.annotations.Param; +import com.nis.domain.configuration.BaseIpCfg; +import com.nis.domain.configuration.IpReuseDnatPolicyCfg; import com.nis.domain.configuration.IpReusePolicyCfg; import com.nis.web.dao.CrudDao; import com.nis.web.dao.MyBatisDao; @@ -24,7 +26,19 @@ public interface IpMultiplexDao extends CrudDao{ // 校验地址池是否被引用 List checkAddrPoolIsUsed(@Param("addrPoolId")String addrPoolId); - + + // SNAT策略更新审核状态 void updatePolicyAuditStatus(IpReusePolicyCfg cfg); + + // DNAT策略更新审核状态 + void updateDnatPolicyStatus(IpReuseDnatPolicyCfg cfg); + + void saveDnatPolicyCfg(IpReuseDnatPolicyCfg entity); + + void updateDnatPolicyCfg(IpReuseDnatPolicyCfg entity); + + List findPageDnat(IpReuseDnatPolicyCfg entity); + + List findDnatList(@Param("cfgId")Long cfgId, @Param("isValid")Integer isValid); } 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 6e39f9f08..c665965b2 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml @@ -40,6 +40,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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, @@ -49,6 +84,15 @@ r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.USER_REGION5 + + 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.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 + + + + + update ip_reuse_dnat_policy + + + + 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} + + + + INSERT INTO ip_reuse_dnat_policy ( + cfg_desc, + ip_type, + ip_pattern, + port_pattern, + original_dest_ip, + original_dest_port, + translated_dest_ip, + translated_dest_port, + protocol, + protocol_id, + is_valid, + is_audit, + do_log, + action, + service_id, + function_id, + compile_id, + is_area_effective, + area_effective_ids, + creator_id, + create_time, + editor_id, + edit_time, + auditor_id, + audit_time, + request_id, + classify, + attribute, + lable, + cfg_region_code, + cfg_type, + user_region1, + user_region2, + user_region3, + user_region4, + user_region5 + )VALUES ( + #{cfgDesc,jdbcType=VARCHAR}, + #{ipType,jdbcType=INTEGER}, + #{ipPattern,jdbcType=INTEGER}, + #{portPattern,jdbcType=INTEGER}, + #{srcIpAddress,jdbcType=VARCHAR}, + #{srcPort,jdbcType=VARCHAR}, + #{destIpAddress,jdbcType=VARCHAR}, + #{destPort,jdbcType=VARCHAR}, + #{protocol,jdbcType=INTEGER}, + #{protocolId,jdbcType=INTEGER}, + #{isValid,jdbcType=INTEGER}, + #{isAudit,jdbcType=INTEGER}, + #{doLog,jdbcType=INTEGER}, + #{action,jdbcType=INTEGER}, + #{serviceId,jdbcType=INTEGER}, + #{functionId,jdbcType=INTEGER}, + #{compileId,jdbcType=INTEGER}, + #{isAreaEffective,jdbcType=INTEGER}, + #{areaEffectiveIds,jdbcType=VARCHAR}, + #{creatorId,jdbcType=INTEGER}, + #{createTime,jdbcType=TIMESTAMP}, + #{editorId,jdbcType=INTEGER}, + #{editTime,jdbcType=TIMESTAMP}, + #{auditorId,jdbcType=INTEGER}, + #{auditTime,jdbcType=TIMESTAMP}, + #{requestId,jdbcType=INTEGER}, + #{classify,jdbcType=VARCHAR}, + #{attribute,jdbcType=VARCHAR}, + #{lable,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER}, + #{cfgType,jdbcType=VARCHAR}, + #{userRegion1,jdbcType=VARCHAR}, + #{userRegion2,jdbcType=VARCHAR}, + #{userRegion3,jdbcType=VARCHAR}, + #{userRegion4,jdbcType=VARCHAR}, + #{userRegion5,jdbcType=VARCHAR} + ) + + + + update ip_reuse_dnat_policy + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + ip_type = #{ipType,jdbcType=INTEGER}, + + + ip_pattern=#{ipPattern,jdbcType=INTEGER}, + + + port_pattern=#{portPattern,jdbcType=INTEGER}, + + + original_dest_ip=#{srcIpAddress,jdbcType=VARCHAR}, + + + translated_dest_ip=#{destIpAddress,jdbcType=VARCHAR}, + + + original_dest_port=#{srcPort,jdbcType=VARCHAR}, + + + translated_dest_port=#{destPort,jdbcType=VARCHAR}, + + + protocol = #{protocol,jdbcType=INTEGER}, + + + protocol_id = #{protocolId,jdbcType=INTEGER}, + + + do_log = #{doLog,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + creator_id = #{creatorId,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + + WHERE cfg_id = #{cfgId,jdbcType=BIGINT} + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/configuration/IpMultiplexService.java b/src/main/java/com/nis/web/service/configuration/IpMultiplexService.java index 922aeb745..36c0558c0 100644 --- a/src/main/java/com/nis/web/service/configuration/IpMultiplexService.java +++ b/src/main/java/com/nis/web/service/configuration/IpMultiplexService.java @@ -8,12 +8,15 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.beust.jcommander.internal.Lists; import com.nis.domain.Page; +import com.nis.domain.configuration.BaseIpCfg; +import com.nis.domain.configuration.IpReuseDnatPolicyCfg; import com.nis.domain.configuration.IpReusePolicyCfg; import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException; @@ -201,4 +204,134 @@ public class IpMultiplexService extends BaseService{ return ipMultiplexDao.checkAddrPoolIsUsed(addrPoolId); } + /** + * DNAT策略配置审核 + * @param isAudit + * @param isValid + * @param functionId + * @param id + * @param auditTime + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void auditDnatPolicy(Integer isAudit, Integer isValid, Integer functionId, String id, Date auditTime) { + // 更新配置审核状态 + IpReuseDnatPolicyCfg cfg = new IpReuseDnatPolicyCfg(); + cfg.setCfgId(Long.valueOf(id)); + cfg.setIsValid(isValid); + cfg.setIsAudit(isAudit); + cfg.setAuditorId(UserUtils.getUser().getId()); + cfg.setAuditTime(auditTime); + ipMultiplexDao.updateDnatPolicyStatus(cfg); + + // 获取配置信息 + cfg = this.getDnatPolicyCfg(cfg.getCfgId(), null); + + SysDictInfoService sysDictInfoService = SpringContextHolder.getBean(SysDictInfoService.class); + cfg.setAreaEffectiveIds(cfg.getIsAreaEffective() == 1?sysDictInfoService.setEffectiveRange(cfg.getAreaEffectiveIds()):"0"); + + String json=""; + if(cfg.getIsAudit() == Constants.AUDIT_YES){ + List list = Lists.newArrayList(); + list.add(cfg); + json=gsonToJson(list); + logger.info("DNAT策略配置下发参数:"+json); + //调用服务接口下发配置 + try { + ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); + if(result!=null){ + logger.info("DNAT策略配置下发响应信息:"+result.getMsg()); + } + } catch (Exception e) { + logger.error("DNAT策略配置下发失败",e); + throw e; + } + + }else if(cfg.getIsAudit() == Constants.AUDIT_NOT_YES){ + List list = Lists.newArrayList(); + list.add(cfg); + json=gsonToJson(list); + logger.info("DNAT策略配置下发参数:"+json); + //调用服务接口取消配置 + try { + ToMaatResult result = ConfigServiceUtil.put(json, 2); + logger.info("DNAT策略配置响应信息:"+result.getMsg()); + } catch (Exception e) { + e.printStackTrace(); + logger.info("DNAT策略配置配置失败"); + throw e; + } + + } + } + + /** + * DNAT策略新增 + * @param entity + * @param request + * @param response + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdateDnat(IpReuseDnatPolicyCfg entity, HttpServletRequest request, HttpServletResponse response) { + Date time = new Date(); + entity.setIsValid(0); + entity.setIsAudit(0); + setAreaEffectiveIds(entity); + + if(entity.getCfgId() == null){ + entity.initDefaultValue(); + entity.setCreateTime(time); + entity.setCreatorId(UserUtils.getUser().getId()); + //调用服务接口获取compileId + try { + List compileIds = ConfigServiceUtil.getId(1,1); + if(compileIds != null && compileIds.size() > 0 ){ + entity.setCompileId(compileIds.get(0)); + } + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + ipMultiplexDao.saveDnatPolicyCfg(entity); + + }else{ + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(time); + ipMultiplexDao.updateDnatPolicyCfg(entity); + + } + } + + public Page findPageDnat(Page page, IpReuseDnatPolicyCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list=ipMultiplexDao.findPageDnat(entity); + page.setList(list); + return page; + } + + public IpReuseDnatPolicyCfg getDnatPolicyCfg(Long cfgId, Integer isValid) { + List list=ipMultiplexDao.findDnatList(cfgId,isValid); + IpReuseDnatPolicyCfg policyCfg=null; + if(list != null && list.size()>0){ + policyCfg=list.get(0); + } + return policyCfg; + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void deleteDnat(Integer isValid, String ids, Integer functionId) { + String[] idArray = ids.split(","); + for(String id :idArray){ + IpReuseDnatPolicyCfg entity = new IpReuseDnatPolicyCfg(); + entity.setCfgId(Long.valueOf(id)); + entity.setFunctionId(functionId); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + ipMultiplexDao.updateDnatPolicyCfg(entity); + + } + } + } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 7e0487daf..aa652ee6e 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1348,4 +1348,8 @@ creat_time=Creat Time close_time=Close Time nat_ip=Multiplexed IP Address traffic=Traffic -ip_info=IP Info \ No newline at end of file +ip_info=IP Info +original_dest_ip=Original destination address +original_dest_port=Original destination port +translated_dest_ip=Post-translational destination address +translated_dest_port=Post-translational destination port \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index dc8cd04bd..0304afb23 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1349,4 +1349,8 @@ policy_vpn_user=VPN access user name policy_sipv4_user=Three tier access to IP(IPv4) policy_sipv6_user=Three tier access to IP(IPv6) traffic=\u0422\u0440\u0430\u0444\u0438\u043A -ip_info=IP Info \ No newline at end of file +ip_info=IP Info +original_dest_ip=Original destination address +original_dest_port=Original destination port +translated_dest_ip=Post-translational destination address +translated_dest_port=Post-translational destination port \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index afd987d4f..cbcfdbeb6 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1346,4 +1346,8 @@ creat_time=\u94FE\u63A5\u5EFA\u7ACB\u65F6\u95F4 close_time=\u94FE\u63A5\u7ED3\u675F\u65F6\u95F4 nat_ip=\u590D\u7528\u7684IP\u5730\u5740 traffic=Traffic -ip_info=IP\u5730\u5740\u4FE1\u606F \ No newline at end of file +ip_info=IP\u5730\u5740\u4FE1\u606F +original_dest_ip=\u539F\u59CB\u76EE\u7684\u5730\u5740 +original_dest_port=\u539F\u59CB\u76EE\u7684\u7AEF\u53E3 +translated_dest_ip=\u7FFB\u8BD1\u540E\u76EE\u7684\u5730\u5740 +translated_dest_port=\u7FFB\u8BD1\u540E\u76EE\u7684\u7AEF\u53E3 \ No newline at end of file diff --git a/src/main/resources/sql/20181207/add_ip_reuse_dnat_policy.sql b/src/main/resources/sql/20181207/add_ip_reuse_dnat_policy.sql new file mode 100644 index 000000000..5808cf434 --- /dev/null +++ b/src/main/resources/sql/20181207/add_ip_reuse_dnat_policy.sql @@ -0,0 +1,45 @@ +-- ---------------------------- +-- Table structure for ip_reuse_dnat_policy +-- ---------------------------- +DROP TABLE IF EXISTS `ip_reuse_dnat_policy`; +CREATE TABLE `ip_reuse_dnat_policy` ( + `cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `cfg_desc` varchar(128) DEFAULT NULL, + `ip_type` int(11) NOT NULL COMMENT 'IPV4=4,IPV6=6', + `ip_pattern` int(11) NOT NULL, + `port_pattern` int(11) NOT NULL, + `original_dest_ip` varchar(128) NOT NULL, + `original_dest_port` varchar(16) NOT NULL, + `translated_dest_ip` varchar(128) NOT NULL, + `translated_dest_port` varchar(16) NOT NULL, + `protocol` int(11) NOT NULL, + `protocol_id` int(11) NOT NULL COMMENT '非0时,maat规范需写入通用IP配置表与通用协议类型配置表 此表固定写0', + `is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除\r\n1) 未审核时配置可删除\r\n2) 审核通过,此字段置1\r\n3) 取消审核通过,此字段置0', + `is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过\r\n1) 审核未通过,配置可修改\r\n2) 审核通过,配置不可删除,只能取消审核通过', + `do_log` int(11) DEFAULT NULL COMMENT '是否记录结构化日志:1是 2否', + `action` int(11) NOT NULL COMMENT '1:阻断,2:监测, 5: FD 白名单,6:监测白名单,7: FD 监测都白名单,应与业务ID所代表的逻辑相匹配,8-灰名单', + `service_id` int(11) NOT NULL COMMENT '参考系统业务类型管理表', + `function_id` int(11) NOT NULL, + `compile_id` int(11) NOT NULL COMMENT '取自服务接口返回的maat配置的编译id,配置初始入库时获取。', + `is_area_effective` int(11) NOT NULL COMMENT '0否,1是', + `area_effective_ids` varchar(1024) DEFAULT NULL, + `creator_id` int(11) NOT NULL COMMENT '取自sys_user.id', + `create_time` datetime NOT NULL, + `editor_id` int(11) DEFAULT NULL COMMENT '取自sys_user.id', + `edit_time` datetime DEFAULT NULL, + `auditor_id` int(11) DEFAULT NULL COMMENT '取自sys_user.id', + `audit_time` datetime DEFAULT NULL, + `request_id` int(11) NOT NULL COMMENT '取自request_info.id', + `classify` varchar(128) DEFAULT NULL COMMENT '分类id,多个用英文逗号分隔', + `attribute` varchar(128) DEFAULT NULL COMMENT '性质id,多个用英文逗号分隔', + `lable` varchar(128) DEFAULT NULL COMMENT '标签id,多个用英文逗号分隔', + `cfg_region_code` int(11) DEFAULT NULL, + `cfg_type` varchar(64) DEFAULT NULL, + `user_region1` varchar(1024) DEFAULT NULL COMMENT '预留自定义域1', + `user_region2` varchar(1024) DEFAULT NULL COMMENT '预留自定义域2', + `user_region3` varchar(1024) DEFAULT NULL COMMENT '预留自定义域3', + `user_region4` varchar(1024) DEFAULT NULL COMMENT '预留自定义域4', + `user_region5` varchar(1024) DEFAULT NULL COMMENT '预留自定义域5', + `cancel_request_id` int(11) DEFAULT NULL COMMENT '取消审核来函', + PRIMARY KEY (`cfg_id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4; diff --git a/src/main/resources/sql/20181207/update_function_region_dict.sql b/src/main/resources/sql/20181207/update_function_region_dict.sql new file mode 100644 index 000000000..e2d2ac88a --- /dev/null +++ b/src/main/resources/sql/20181207/update_function_region_dict.sql @@ -0,0 +1,8 @@ +UPDATE + function_region_dict +SET + config_ip_port_show = '1,2,3,4', + config_ip_pattern = '3', + config_port_pattern = '1' +WHERE + dict_id = 232 AND function_id = 304; \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyForm2.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyForm2.jsp new file mode 100644 index 000000000..b96f0f8d3 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyForm2.jsp @@ -0,0 +1,312 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + +
+

+ +

+
+
+
+
+
+ + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +
+ + + +
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ <%--
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
--%> +
+
+ +
+
+
+
+
+ +
+ + <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList2.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList2.jsp new file mode 100644 index 000000000..24d3317d7 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList2.jsp @@ -0,0 +1,452 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="dnat_policy"></spring:message> + + + + + + +
+ + +

+ +

+ +
+
+
+
+ + + + + + + + + + + +
+
+ + + + + + + +
+ +
+ +
+
+ + + + + + + + + <%-- --%> + + + +
+ + +
+ <%-- + + + + + --%> + + + + + +
+
+
+
+ + + +
+
+ + + + <%-- --%> + + +
+ + +
+
+ href="javascript:;"> + + +
+
+ + + +
+
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+
+
+ + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+ + +
+ + +
+
+ +
+ + + + + + + <%-- --%> + + + + + + + + <%-- --%> + <%-- --%> + + + + + <%-- --%> + + + + + + + + + + + + + + + <%-- --%> + + + + + + + <%-- --%> + <%-- --%> + + + + + + + <%-- --%> + + + + + + + + + +
+ + ${indexCfg.compileId }${indexCfg.cfgDesc } + + + + + + ${indexCfg.srcIpAddress }${indexCfg.srcPort }${indexCfg.destIpAddress }${indexCfg.destPort } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${indexCfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + +
${indexCfg.creatorName }${indexCfg.editorName }${indexCfg.auditorName }
+
${page}
+
+
+
+
+
+ + + \ No newline at end of file