diff --git a/src/main/java/com/nis/domain/callback/NtcDnsResStrategy.java b/src/main/java/com/nis/domain/callback/NtcDnsResStrategy.java new file mode 100644 index 000000000..f03db350c --- /dev/null +++ b/src/main/java/com/nis/domain/callback/NtcDnsResStrategy.java @@ -0,0 +1,202 @@ +package com.nis.domain.callback; + +import java.util.Date; + +import com.google.gson.annotations.Expose; +public class NtcDnsResStrategy { + @Expose + private Long id; //compileId + @Expose + private Integer cfgId; //compileId + @Expose + private Long reqStrateId; + @Expose + private String strateName; + @Expose + private Integer action; + @Expose + private Integer service; + @Expose + private Integer isValid; + @Expose + private Date opTime; + @Expose + private Integer resGroup1Id; + @Expose + private Integer resGroup1Num; + @Expose + private Integer resGroup2Id; + @Expose + private Integer resGroup2Num; + @Expose + private Integer resGroup3Id; + @Expose + private Integer resGroup3Num; + @Expose + private Integer resGroup4Id; + @Expose + private Integer resGroup4Num; + @Expose + private Integer resGroup5Id; + @Expose + private Integer resGroup5Num; + @Expose + private Integer minTtl; + @Expose + private Integer maxTtl; + + + /** + * action + * @return action + */ + + public Integer getAction() { + return action; + } + /** + * @param action the action to set + */ + public void setAction(Integer action) { + this.action = action; + } + /** + * isValid + * @return isValid + */ + + public Integer getIsValid() { + return isValid; + } + /** + * @param isValid the isValid to set + */ + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + /** + * opTime + * @return opTime + */ + + public Date getOpTime() { + return opTime; + } + /** + * @param opTime the opTime to set + */ + public void setOpTime(Date opTime) { + this.opTime = opTime; + } + public Long getReqStrateId() { + return reqStrateId; + } + public void setReqStrateId(Long reqStrateId) { + this.reqStrateId = reqStrateId; + } + + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public String getStrateName() { + return strateName; + } + public void setStrateName(String strateName) { + this.strateName = strateName; + } + /** + * service + * @return service + */ + + public Integer getService() { + return service; + } + /** + * @param service the service to set + */ + public void setService(Integer service) { + this.service = service; + } + public Integer getResGroup1Id() { + return resGroup1Id; + } + public void setResGroup1Id(Integer resGroup1Id) { + this.resGroup1Id = resGroup1Id; + } + public Integer getResGroup1Num() { + return resGroup1Num; + } + public void setResGroup1Num(Integer resGroup1Num) { + this.resGroup1Num = resGroup1Num; + } + public Integer getResGroup2Id() { + return resGroup2Id; + } + public void setResGroup2Id(Integer resGroup2Id) { + this.resGroup2Id = resGroup2Id; + } + public Integer getResGroup2Num() { + return resGroup2Num; + } + public void setResGroup2Num(Integer resGroup2Num) { + this.resGroup2Num = resGroup2Num; + } + public Integer getResGroup3Id() { + return resGroup3Id; + } + public void setResGroup3Id(Integer resGroup3Id) { + this.resGroup3Id = resGroup3Id; + } + public Integer getResGroup3Num() { + return resGroup3Num; + } + public void setResGroup3Num(Integer resGroup3Num) { + this.resGroup3Num = resGroup3Num; + } + public Integer getResGroup4Id() { + return resGroup4Id; + } + public void setResGroup4Id(Integer resGroup4Id) { + this.resGroup4Id = resGroup4Id; + } + public Integer getResGroup4Num() { + return resGroup4Num; + } + public void setResGroup4Num(Integer resGroup4Num) { + this.resGroup4Num = resGroup4Num; + } + public Integer getResGroup5Id() { + return resGroup5Id; + } + public void setResGroup5Id(Integer resGroup5Id) { + this.resGroup5Id = resGroup5Id; + } + public Integer getResGroup5Num() { + return resGroup5Num; + } + public void setResGroup5Num(Integer resGroup5Num) { + this.resGroup5Num = resGroup5Num; + } + public Integer getMinTtl() { + return minTtl; + } + public void setMinTtl(Integer minTtl) { + this.minTtl = minTtl; + } + public Integer getMaxTtl() { + return maxTtl; + } + public void setMaxTtl(Integer maxTtl) { + this.maxTtl = maxTtl; + } + public Integer getCfgId() { + return cfgId; + } + public void setCfgId(Integer cfgId) { + this.cfgId = cfgId; + } +} diff --git a/src/main/java/com/nis/domain/configuration/DnsIpCfg.java b/src/main/java/com/nis/domain/configuration/DnsIpCfg.java index 75ebdae13..f08c5146f 100644 --- a/src/main/java/com/nis/domain/configuration/DnsIpCfg.java +++ b/src/main/java/com/nis/domain/configuration/DnsIpCfg.java @@ -20,348 +20,26 @@ import com.nis.domain.SysUser; * @date 2018年2月5日 下午2:57:17 * @version V1.0 */ -public class DnsIpCfg extends BaseEntity { +public class DnsIpCfg extends BaseIpCfg { - private static final long serialVersionUID = -4476190616323264876L; /** - * 配置ID + * */ - @Expose - private Long cfgId; - /** - * 配置描述 - */ - private String cfgDesc; - /** - * ip类型 - */ - @Expose - private Integer ipType; - /** - * 源IP地址 - */ - @Expose - private String srcIp; - /** - * 源地址掩码 - */ - @Expose - private String srcIpMask ; - /** - * 源端口 - */ - @Expose - private String srcPort ; - /** - * 源端口掩码 - */ - @Expose - private String srcPortMask ; - /** - * 目的IP地址 - */ - @Expose - private String dstIp ; - /** - * 目的地址掩码 - */ - @Expose - private String dstIpMask ; - /** - * 目的端口 - */ - @Expose - private String dstPort ; - /** - * 目的端口掩码 - */ - @Expose - private String dstPortMask ; - /** - * 方向 - */ - @Expose - private Integer direction ; - /** - * 方向 - */ - @Expose - private Integer protocol ; - /** - * 有效标识 - */ - private Integer isValid; - /** - * 是否审核 - */ - private Integer isAudit; - /** - * 创建人 - */ - private SysUser creator; - /** - * 创建时间 - */ - private Date createTime; - /** - * 最后修改人 - */ - private SysUser editor; - /** - * 最后修改时间 - */ - private Date editTime; - /** - * 审核人 - */ - private SysUser auditor; - /** - * 审核时间 - */ - private Date auditTime; - /** - * 来函 - */ - private RequestInfo request; - /** - * 欺骗id - */ - private Integer fakeId; - /** - * 分类 - */ - private String classify; - /** - * 性质 - */ - private String attribute; - /** - * 标签 - */ - private String lable; + private static final long serialVersionUID = 8149437730819674317L; + private String dnsStrategyName; + private Long dnsStrategyId; - private String cfgIds; - private String fakeIds; - - public String getCfgIds() { - return cfgIds; + public Long getDnsStrategyId() { + return dnsStrategyId; } - public void setCfgIds(String cfgIds) { - this.cfgIds = cfgIds; + public void setDnsStrategyId(Long dnsStrategyId) { + this.dnsStrategyId = dnsStrategyId; } - public Long getCfgId() { - return cfgId; + public String getDnsStrategyName() { + return dnsStrategyName; } - public void setCfgId(Long cfgId) { - this.cfgId = cfgId; - } - public String getCfgDesc() { - return cfgDesc; - } - public void setCfgDesc(String cfgDesc) { - this.cfgDesc = cfgDesc; - } - public Integer getIpType() { - return ipType; - } - public void setIpType(Integer ipType) { - this.ipType = ipType; - } - public String getSrcIp() { - return srcIp; - } - public void setSrcIp(String srcIp) { - this.srcIp = srcIp; - } - public String getSrcIpMask() { - return srcIpMask; - } - public void setSrcIpMask(String srcIpMask) { - this.srcIpMask = srcIpMask; - } - public String getSrcPort() { - return srcPort; - } - public void setSrcPort(String srcPort) { - this.srcPort = srcPort; - } - public String getSrcPortMask() { - return srcPortMask; - } - public void setSrcPortMask(String srcPortMask) { - this.srcPortMask = srcPortMask; - } - public String getDstIp() { - return dstIp; - } - public void setDstIp(String dstIp) { - this.dstIp = dstIp; - } - public String getDstIpMask() { - return dstIpMask; - } - public void setDstIpMask(String dstIpMask) { - this.dstIpMask = dstIpMask; - } - public String getDstPort() { - return dstPort; - } - public void setDstPort(String dstPort) { - this.dstPort = dstPort; - } - public String getDstPortMask() { - return dstPortMask; - } - public void setDstPortMask(String dstPortMask) { - this.dstPortMask = dstPortMask; - } - public Integer getDirection() { - return direction; - } - public void setDirection(Integer direction) { - this.direction = direction; - } - public Integer getProtocol() { - return protocol; - } - public void setProtocol(Integer protocol) { - this.protocol = protocol; - } - public Integer getIsValid() { - return isValid; - } - public void setIsValid(Integer isValid) { - this.isValid = isValid; - } - public Integer getIsAudit() { - return isAudit; - } - public void setIsAudit(Integer isAudit) { - this.isAudit = isAudit; - } - public SysUser getCreator() { - return creator; - } - public void setCreator(SysUser creator) { - this.creator = creator; - } - public Date getCreateTime() { - return createTime; - } - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - public SysUser getEditor() { - return editor; - } - public void setEditor(SysUser editor) { - this.editor = editor; - } - public Date getEditTime() { - return editTime; - } - public void setEditTime(Date editTime) { - this.editTime = editTime; - } - public SysUser getAuditor() { - return auditor; - } - public void setAuditor(SysUser auditor) { - this.auditor = auditor; - } - public Date getAuditTime() { - return auditTime; - } - public void setAuditTime(Date auditTime) { - this.auditTime = auditTime; - } - public RequestInfo getRequest() { - return request; - } - public void setRequest(RequestInfo request) { - this.request = request; - } - public Integer getFakeId() { - return fakeId; - } - public void setFakeId(Integer fakeId) { - this.fakeId = fakeId; - } - public String getClassify() { - return classify; - } - public void setClassify(String classify) { - this.classify = classify; - } - public String getAttribute() { - return attribute; - } - public void setAttribute(String attribute) { - this.attribute = attribute; - } - public String getLable() { - return lable; - } - public void setLable(String lable) { - this.lable = lable; - } - - private Date searchCreateTimeStart; - private Date searchCreateTimeEnd; - private Date searchEditTimeStart; - private Date searchEditTimeEnd; - private Date searchAuditTimeStart; - private Date searchAuditTimeEnd; - - public Date getSearchCreateTimeStart() { - return searchCreateTimeStart; - } - public void setSearchCreateTimeStart(Date searchCreateTimeStart) { - this.searchCreateTimeStart = searchCreateTimeStart; - } - public Date getSearchCreateTimeEnd() { - return searchCreateTimeEnd; - } - public void setSearchCreateTimeEnd(Date searchCreateTimeEnd) { - this.searchCreateTimeEnd = searchCreateTimeEnd; - } - public Date getSearchEditTimeStart() { - return searchEditTimeStart; - } - public void setSearchEditTimeStart(Date searchEditTimeStart) { - this.searchEditTimeStart = searchEditTimeStart; - } - public Date getSearchEditTimeEnd() { - return searchEditTimeEnd; - } - public void setSearchEditTimeEnd(Date searchEditTimeEnd) { - this.searchEditTimeEnd = searchEditTimeEnd; - } - public Date getSearchAuditTimeStart() { - return searchAuditTimeStart; - } - public void setSearchAuditTimeStart(Date searchAuditTimeStart) { - this.searchAuditTimeStart = searchAuditTimeStart; - } - public Date getSearchAuditTimeEnd() { - return searchAuditTimeEnd; - } - public void setSearchAuditTimeEnd(Date searchAuditTimeEnd) { - this.searchAuditTimeEnd = searchAuditTimeEnd; - } - /** - * fakeIds - * @return fakeIds - */ - - public String getFakeIds() { - return fakeIds; - } - /** - * @param fakeIds the fakeIds to set - */ - public void setFakeIds(String fakeIds) { - this.fakeIds = fakeIds; + public void setDnsStrategyName(String dnsStrategyName) { + this.dnsStrategyName = dnsStrategyName; } } diff --git a/src/main/java/com/nis/domain/configuration/DnsResStrategy.java b/src/main/java/com/nis/domain/configuration/DnsResStrategy.java new file mode 100644 index 000000000..f9337612b --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/DnsResStrategy.java @@ -0,0 +1,118 @@ +package com.nis.domain.configuration; + +/** + * dns响应策略配置 + * @author dell + * + */ +public class DnsResStrategy extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = -2720862431960415564L; + private Integer resGroup1Id; + private Integer resGroup1Num; + private Integer resGroup2Id; + private Integer resGroup2Num; + private Integer resGroup3Id; + private Integer resGroup3Num; + private Integer resGroup4Id; + private Integer resGroup4Num; + private Integer resGroup5Id; + private Integer resGroup5Num; + private Integer minTtl; + private Integer maxTtl; + private String group1Name; + @Override + public void initDefaultValue() { + this.resGroup1Num=0; + this.resGroup1Num=0; + this.resGroup2Id=0; + this.resGroup2Num=0; + this.resGroup3Id=0; + this.resGroup3Num=0; + this.resGroup4Id=0; + this.resGroup4Num=0; + this.resGroup5Id=0; + this.resGroup5Num=0; + } + public Integer getResGroup1Id() { + return resGroup1Id; + } + public void setResGroup1Id(Integer resGroup1Id) { + this.resGroup1Id = resGroup1Id; + } + public Integer getResGroup1Num() { + return resGroup1Num; + } + public void setResGroup1Num(Integer resGroup1Num) { + this.resGroup1Num = resGroup1Num; + } + public Integer getResGroup2Id() { + return resGroup2Id; + } + public void setResGroup2Id(Integer resGroup2Id) { + this.resGroup2Id = resGroup2Id; + } + public Integer getResGroup2Num() { + return resGroup2Num; + } + public void setResGroup2Num(Integer resGroup2Num) { + this.resGroup2Num = resGroup2Num; + } + public Integer getResGroup3Id() { + return resGroup3Id; + } + public void setResGroup3Id(Integer resGroup3Id) { + this.resGroup3Id = resGroup3Id; + } + public Integer getResGroup3Num() { + return resGroup3Num; + } + public void setResGroup3Num(Integer resGroup3Num) { + this.resGroup3Num = resGroup3Num; + } + public Integer getResGroup4Id() { + return resGroup4Id; + } + public void setResGroup4Id(Integer resGroup4Id) { + this.resGroup4Id = resGroup4Id; + } + public Integer getResGroup4Num() { + return resGroup4Num; + } + public void setResGroup4Num(Integer resGroup4Num) { + this.resGroup4Num = resGroup4Num; + } + public Integer getResGroup5Id() { + return resGroup5Id; + } + public void setResGroup5Id(Integer resGroup5Id) { + this.resGroup5Id = resGroup5Id; + } + public Integer getResGroup5Num() { + return resGroup5Num; + } + public void setResGroup5Num(Integer resGroup5Num) { + this.resGroup5Num = resGroup5Num; + } + public Integer getMinTtl() { + return minTtl; + } + public void setMinTtl(Integer minTtl) { + this.minTtl = minTtl; + } + public Integer getMaxTtl() { + return maxTtl; + } + public void setMaxTtl(Integer maxTtl) { + this.maxTtl = maxTtl; + } + public String getGroup1Name() { + return group1Name; + } + public void setGroup1Name(String group1Name) { + this.group1Name = group1Name; + } +} diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index e39216d52..782ebd05b 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -61,6 +61,7 @@ import com.nis.web.service.configuration.AvContentCfgService; import com.nis.web.service.configuration.BgpCfgService; import com.nis.web.service.configuration.ComplexStringCfgService; import com.nis.web.service.configuration.DnsIpCfgService; +import com.nis.web.service.configuration.DnsResStrategyService; import com.nis.web.service.configuration.FileTransferCfgService; import com.nis.web.service.configuration.IpCfgService; import com.nis.web.service.configuration.MailCfgService; @@ -153,6 +154,8 @@ public class BaseController { protected XmppCfgService xmppCfgService; @Autowired protected PolicyGroupInfoService policyGroupInfoService; + @Autowired + protected DnsResStrategyService dnsResStrategyService; /** * 管理基础路径 */ diff --git a/src/main/java/com/nis/web/controller/configuration/DnsIpCfgController.java b/src/main/java/com/nis/web/controller/configuration/DnsIpCfgController.java index e27d45746..8c5b788f6 100644 --- a/src/main/java/com/nis/web/controller/configuration/DnsIpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/DnsIpCfgController.java @@ -16,101 +16,85 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.configuration.BaseIpCfg; +import com.nis.domain.configuration.DnsIpCfg; +import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.configuration.DnsIpCfg; import com.nis.domain.configuration.RequestInfo; +import com.nis.exceptions.MaatConvertException; import com.nis.util.StringUtil; import com.nis.web.controller.BaseController; import com.nis.web.security.UserUtils; +import com.nis.web.service.configuration.DnsIpCfgService; @Controller @RequestMapping("${adminPath}/cfg/dnsIp") public class DnsIpCfgController extends BaseController { - @ModelAttribute - public DnsIpCfg get(Long cfgId) { - if (!StringUtil.isEmpty(cfgId)){ - return dnsIpCfgService.get(cfgId); - }else{ - return new DnsIpCfg(); - } - } - - @RequiresPermissions("cfg:ip:view") - @RequestMapping("list") - public String list(Model model, HttpServletRequest request, HttpServletResponse response, DnsIpCfg dnsIpCfg) { - Page page = dnsIpCfgService.findPage(new Page(request, response, 30), dnsIpCfg); + @RequestMapping(value = {"/list"}) + public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")DnsIpCfg entity){ + Page page = dnsIpCfgService.findPage(new Page(request, response,"r"), entity); model.addAttribute("page", page); - - addRequestAndServiceDictToModel(model); + initPageCondition(model); return "/cfg/dnsIpCfgList"; } - - @RequiresPermissions("cfg:ip:edit") - @RequestMapping("form") - public String form(Model model, DnsIpCfg dnsIpCfg) { - addRequestAndServiceDictToModel(model); + @RequestMapping(value = {"/form"}) + @RequiresPermissions(value={"dns:fake:ip:config"}) + public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")DnsIpCfg cfg){ + if(!StringUtil.isEmpty(ids)){ + cfg = dnsIpCfgService.getDnsIpCfg(Long.parseLong(ids)); + initUpdateFormCondition(model, cfg); + }else{ + initFormCondition(model,cfg); + } + //获取所有响应策略信息 + List resStrategys=dnsResStrategyService.findDnsResStrategys(null, -1); + model.addAttribute("dnsResStrategys", resStrategys); + model.addAttribute("_cfg", cfg); return "/cfg/dnsIpCfgForm"; } - @RequiresPermissions("cfg:ip:edit") - @RequestMapping("save") - public String save(Model model, DnsIpCfg dnsIpCfg, RedirectAttributes redirectAttributes) { - Date now = new Date(); - - if (dnsIpCfg.getCfgId() == null) {//新增 - dnsIpCfg.setFakeId(0); - dnsIpCfg.setIsValid(1); - dnsIpCfg.setCreateTime(now); - dnsIpCfg.setCreator(UserUtils.getUser()); - dnsIpCfg.setIsAudit(1); - } else {//修改 - dnsIpCfg.setEditor(UserUtils.getUser()); - dnsIpCfg.setEditTime(now); - } - - try { - dnsIpCfgService.save(dnsIpCfg); - addMessage(redirectAttributes, "save_success"); - } catch (Exception e) { + @RequestMapping(value = {"/saveOrUpdate"}) + @RequiresPermissions(value={"dns:fake:ip:config"}) + public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")DnsIpCfg cfg){ + try{ + dnsIpCfgService.saveOrUpdate(cfg); + addMessage(model,"save_success"); + }catch(Exception e){ + logger.error("信息保存失败",e); e.printStackTrace(); - addMessage(redirectAttributes, "save_failed"); + addMessage(model,"save_failed"); } - return "redirect:" + adminPath + "/cfg/dnsIp/list"; + return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+cfg.getFunctionId(); } - @RequiresPermissions("cfg:ip:edit") - @RequestMapping("delete") - public String delete(Model model, HttpServletRequest request, - HttpServletResponse response, DnsIpCfg dnsIpCfg) { - String fakeIds = dnsIpCfg.getFakeIds(); - if (!StringUtils.isEmpty(fakeIds)) { - try { - dnsIpCfgService.delete(fakeIds); - addMessage(model, "delete_success"); - } catch (Exception e) { - logger.error("删除失败", e); - addMessage(model, "delete_failed"); + @RequestMapping(value = {"/delete"}) + @RequiresPermissions(value={"dns:fake:ip:config"}) + public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId){ + dnsIpCfgService.delete(isAudit,isValid,ids,functionId); + return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId; + } + @RequestMapping(value = {"/audit"}) + @RequiresPermissions(value={"dns:fake:ip:audit"}) + public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + String[] idArray = ids.split(","); + Date auditTime=new Date(); + for(String id :idArray){ + try { + dnsIpCfgService.audit(isAudit,isValid,functionId,id,auditTime); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("dns fake ip配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } - } else { - addMessage(model, "delete_failed"); + } - - Page page = dnsIpCfgService.findPage(new Page(request, response, 30), dnsIpCfg); - model.addAttribute("page", page); - - addRequestAndServiceDictToModel(model); - return "/cfg/dnsIpCfgList"; + return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId; } - private void addRequestAndServiceDictToModel(Model model) { - List requestInfos = requestInfoService.getAllRequestInfo(); - model.addAttribute("requestInfos", requestInfos); - List fls = serviceDictInfoService.findAllFlDict(); - model.addAttribute("fls", fls); - List xzs = serviceDictInfoService.findAllXzDict(); - model.addAttribute("xzs", xzs); - List lables = serviceDictInfoService.findAllLableDict(); - model.addAttribute("lables", lables); - } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/DnsResStrategyController.java b/src/main/java/com/nis/web/controller/configuration/ntc/DnsResStrategyController.java new file mode 100644 index 000000000..c0371704e --- /dev/null +++ b/src/main/java/com/nis/web/controller/configuration/ntc/DnsResStrategyController.java @@ -0,0 +1,158 @@ +package com.nis.web.controller.configuration.ntc; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +import com.nis.domain.Page; +import com.nis.domain.SysUser; +import com.nis.domain.basics.PolicyGroupInfo; +import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.basics.SysDictInfo; +import com.nis.domain.configuration.AreaBean; +import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.AvContIpCfg; +import com.nis.domain.configuration.AvVoipAccountCfg; +import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.DnsResStrategy; +import com.nis.exceptions.MaatConvertException; +import com.nis.domain.configuration.AvVoipIpCfg; +import com.nis.domain.configuration.BaseIpCfg; +import com.nis.domain.configuration.BaseStringCfg; +import com.nis.util.Configurations; +import com.nis.util.Constants; +import com.nis.util.DateUtils; +import com.nis.util.StringUtil; +import com.nis.util.excel.ExportExcel; +import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; + +/** + * dns响应策略 + * @author ddm + * + */ +@Controller +@RequestMapping("${adminPath}/maintenance/dnsResStrategy") +public class DnsResStrategyController extends BaseController { + + @RequestMapping(value = {"/form"}) + @RequiresPermissions(value={"dns:res:strategy:config"}) + public String from(Model model, + HttpServletRequest request, + HttpServletResponse response, + String ids, + @ModelAttribute("cfg")DnsResStrategy cfg){ + if(cfg == null){ + cfg=new DnsResStrategy(); + } + if(!StringUtil.isEmpty(ids)){ + cfg = dnsResStrategyService.getDnsResStrategy(Long.valueOf(ids),-1); + initFormCondition(model, cfg); + model.addAttribute("isAdd", false); + }else{ + //不存在响应策略为0的配置,则新策略时,cfgId默认为0 + DnsResStrategy dns0=dnsResStrategyService.getDnsResStrategy(0l,null); + if(dns0 == null){ + cfg.setCfgId(0l); + } + initFormCondition(model, cfg); + model.addAttribute("isAdd", true); + } + + //查询policyGroup列表,供响应策略选择 + List policyGroups=policyGroupInfoService.findPolicyGroupInfos(); + model.addAttribute("policyGroups", policyGroups); + + model.addAttribute("_cfg", cfg); + return "/cfg/maintenance/dnsResStrategy/form"; + } + + @RequestMapping(value = {"/saveOrUpdate"}) + @RequiresPermissions(value={"dns:res:strategy:config"}) + public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")DnsResStrategy cfg){ + try{ + + dnsResStrategyService.saveOrUpdate(cfg); + + addMessage(model,"save_success"); + }catch(Exception e){ + e.printStackTrace(); + addMessage(model,"save_failed"); + } + + return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+cfg.getFunctionId(); + } + + @RequestMapping(value = {"/list"}) + public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")DnsResStrategy entity){ + //查询时left join policyGroup + Page page = dnsResStrategyService.findPage(new Page(request, response,"r"), entity); + model.addAttribute("page", page); + initPageCondition(model); + return "/cfg/maintenance/dnsResStrategy/list"; + } + + @RequestMapping(value = {"/delete"}) + @RequiresPermissions(value={"dns:res:strategy:config"}) + public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,HttpServletRequest request,HttpServletResponse response){ + try{ + if(!StringUtil.isEmpty(ids)){ + dnsResStrategyService.delete(isAudit,isValid,ids,functionId); + } + addMessage(model,"delete_success"); + }catch(Exception e){ + addMessage(model,"delete_failed"); + } + + return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+functionId; + } + + @RequestMapping(value = {"/audit"}) + //@RequiresPermissions(value={"dns:res:strategy:audit"}) + public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + String[] idArray = ids.split(","); + Date auditTime=new Date(); + for(String id :idArray){ + try { + dnsResStrategyService.audit(isAudit,isValid,functionId,id,auditTime); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("VOIP配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + + } + return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+functionId; + } + @ResponseBody + @RequestMapping(value = "/validCfgId") + public boolean validCfgId(Long cfgId) { + DnsResStrategy dns=dnsResStrategyService.getDnsResStrategy(cfgId,null); + if(dns == null ){ + return false; + }else{ + return true; + } + } +} diff --git a/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.java b/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.java index 1ab29ce6a..767b08a9e 100644 --- a/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.java +++ b/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.java @@ -10,6 +10,7 @@ import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface PolicyGroupInfoDao extends CrudDao { List findPolicyGroupInfoList(PolicyGroupInfo policyGroupInfo); + List findPolicyGroupInfos(); PolicyGroupInfo getById(int id); } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.xml b/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.xml index 700b33383..4733ac807 100644 --- a/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.xml +++ b/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.xml @@ -59,6 +59,13 @@ + + insert into policy_group_info( IS_VALID, diff --git a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java index 62c9de453..35d2f7221 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java @@ -1,5 +1,7 @@ package com.nis.web.dao.configuration; +import java.util.List; + import org.apache.ibatis.annotations.Param; import com.nis.domain.configuration.DnsIpCfg; @@ -8,5 +10,6 @@ import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface DnsIpCfgDao extends CrudDao { - public int deleteByFakeId(@Param("fakeId") String fakeIds); + List findPage(DnsIpCfg dnsIpCfg); + DnsIpCfg getDnsIpCfg(Long cfgId); } diff --git a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml index a3dfb045d..6cb21d12d 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml @@ -2,151 +2,346 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - dic.CFG_ID, dic.CFG_DESC, dic.IP_TYPE, dic.SRC_IP, dic.SRC_IP_MASK, dic.SRC_PORT, - dic.SRC_PORT_MASK, dic.DST_IP, dic.DST_IP_MASK, dic.DST_PORT, dic.DST_PORT_MASK, - dic.DIRECTION, dic.PROTOCOL, dic.IS_VALID, dic.IS_AUDIT, dic.CREATOR_ID, - dic.CREATE_TIME, dic.EDITOR_ID, dic.EDIT_TIME, dic.AUDITOR_ID, dic.AUDIT_TIME, - dic.REQUEST_ID, dic.FAKE_ID, dic.CLASSIFY, dic.ATTRIBUTE, dic.LABLE + r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port + ,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address + ,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id + ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id, + r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable + ,r.area_effective_ids,r.function_id,r.cfg_region_code,r.dns_strategy_id - select - , - c.name as "creator.name", - e.name as "editor.name", - a.name as "auditor.name", - ri.request_title as "request.requestTitle" - from dns_ip_cfg dic - left join sys_user c on dic.creator_id=c.id - left join sys_user e on dic.creator_id=e.id - left join sys_user a on dic.creator_id=a.id - left join request_info ri on dic.request_id=ri.id - where dic.is_valid=1 - - and dic.create_time >= #{searchCreateTimeStart} - - - and dic.create_time <= #{searchCreateTimeEnd} - - - - and dic.request_id = #{request.id} - - - and concat(",", dic.classify, ",") like concat("%,", #{classify}, ",%") - - - and concat(",", dic.attribute, ",") like concat("%,", #{attribute}, ",%") - - - and concat(",", dic.lable, ",") like concat("%,", #{lable}, ",%") - - - and dic.cfg_desc like concat("%", #{cfgDesc}, "%") - + + + ,s.name as creator_name,e.name as editor_name,u.name as auditor_name + ,ri.request_title as requestName,dns.cfg_Desc as dns_strategy_name + + from dns_ip_cfg r + left join dns_res_strategy dns on dns.cfg_Id=r.dns_strategy_id + left join sys_user s on r.creator_id=s.id + left join sys_user e on r.editor_id=e.id + left join sys_user u on r.auditor_id=u.id + left join request_info ri on r.request_id=ri.id + + + AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} + + + AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') + + + AND dns.cfg_desc like concat(concat('%',#{dnsStrategyName,jdbcType=VARCHAR}),'%') + + + AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER} + + + AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%') + + + AND r.IP_TYPE=#{ipType,jdbcType=INTEGER} + + + AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER} + + + AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR} + + + AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR} + + + AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER} + + + AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR} + + + AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR} + + + AND r.DIRECTION=#{direction,jdbcType=INTEGER} + + + AND r.PROTOCOL=#{protocol,jdbcType=INTEGER} + + + AND r.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER} + + + AND r.ACTION=#{action,jdbcType=INTEGER} + + + AND r.IS_VALID=#{isValid,jdbcType=INTEGER} + + + AND r.IS_VALID != -1 + + + AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER} + + + AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%') + + + AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP} + + + AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%') + + + AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP} + + + AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%') + + + AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP} + + + AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER} + + + AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER} + + + AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER} + + + AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER} + + + AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%') + + + AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%') + + + AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%') + + + AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%') + + + AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER} + + - select , - c.name as "creator.name", - e.name as "editor.name", - a.name as "auditor.name", - ri.request_title as "request.requestTitle" from dns_ip_cfg dic - left join sys_user c on dic.creator_id=c.id - left join sys_user e on dic.creator_id=e.id - left join sys_user a on dic.creator_id=a.id - left join request_info ri on dic.request_id=ri.id - where dic.cfg_id=#{id} + where dic.cfg_id=#{cfgId} - - insert into dns_ip_cfg ( - cfg_desc, ip_type, src_ip, src_ip_mask, src_port, - src_port_mask, dst_ip, dst_ip_mask, dst_port, dst_port_mask, - direction, protocol, is_valid, is_audit, creator_id, - create_time, request_id, fake_id, classify, attribute, lable - ) values ( - #{cfgDesc}, #{ipType}, #{srcIp}, #{srcIpMask}, #{srcPort}, #{srcPortMask}, - #{dstIp}, #{dstIpMask}, #{dstPort}, #{dstPortMask}, #{direction}, #{protocol}, - #{isValid}, #{isAudit}, #{creator.id}, #{createTime}, #{request.id}, #{fakeId}, - #{classify}, #{attribute}, #{lable} - ) - - select LAST_INSERT_ID() as cfg_id - - + + insert into dns_ip_cfg ( + CFG_DESC, + ACTION, + IS_VALID, + IS_AUDIT, + CREATOR_ID, + CREATE_TIME, + EDITOR_ID, + EDIT_TIME, + AUDITOR_ID, + AUDIT_TIME, + SERVICE_ID, + REQUEST_ID, + COMPILE_ID, + IS_AREA_EFFECTIVE, + CLASSIFY, + ATTRIBUTE, + LABLE, + AREA_EFFECTIVE_IDS, + function_id, + ip_type, + src_ip_address, + ip_pattern, + port_pattern, + src_port, + protocol, + protocol_id, + direction, + dest_port, + dest_ip_address, + cfg_type, + cfg_region_code, + dns_strategy_id + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + 0, + 0, + #{creatorId,jdbcType=INTEGER}, + #{createTime,jdbcType=TIMESTAMP}, + #{editorId,jdbcType=INTEGER}, + #{editTime,jdbcType=TIMESTAMP}, + #{auditorId,jdbcType=INTEGER}, + #{auditTime,jdbcType=TIMESTAMP}, + #{serviceId,jdbcType=INTEGER}, + #{requestId,jdbcType=INTEGER}, + #{compileId,jdbcType=INTEGER}, + #{isAreaEffective,jdbcType=INTEGER}, + #{classify,jdbcType=VARCHAR}, + #{attribute,jdbcType=VARCHAR}, + #{lable,jdbcType=VARCHAR}, + #{areaEffectiveIds,jdbcType=VARCHAR}, + #{functionId,jdbcType=INTEGER}, + #{ipType,jdbcType=INTEGER}, + #{srcIpAddress,jdbcType=VARCHAR}, + #{ipPattern,jdbcType=INTEGER}, + #{portPattern,jdbcType=INTEGER}, + #{srcPort,jdbcType=VARCHAR}, + #{protocol,jdbcType=INTEGER}, + #{protocolId,jdbcType=INTEGER}, + #{direction,jdbcType=INTEGER}, + #{destPort,jdbcType=VARCHAR}, + #{destIpAddress,jdbcType=VARCHAR}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER}, + #{dnsStrategyId,jdbcType=INTEGER} + ) + - - update - dns_ip_cfg - set - cfg_desc=#{cfgDesc}, ip_type=#{ipType}, src_ip=#{srcIp}, src_ip_mask=#{srcIpMask}, - src_port=#{srcPort}, src_port_mask=#{srcPortMask}, dst_ip=#{dstIp}, - dst_ip_mask=#{dstIpMask}, dst_port=#{dstPort}, dst_port_mask=#{dstPortMask}, - direction=#{direction}, protocol=#{protocol}, request_id=#{request.id}, - fake_id=#{fakeId}, classify=#{classify}, attribute=#{attribute}, lable=#{lable}, - editor_id=#{editor.id}, edit_time=#{editTime} - where cfg_id=#{cfgId} - - - - update - dns_ip_cfg - set - is_valid=0 - where cfg_id=#{cfgId} - - - update - dns_ip_cfg - set - is_valid=0 - where fake_id =#{fakeId} - + + update dns_ip_cfg + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + + AUDITOR_ID = #{auditorId,jdbcType=INTEGER}, + + + AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP}, + + + COMPILE_ID = #{compileId,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}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + ip_type = #{ipType,jdbcType=INTEGER}, + + + src_ip_address = #{srcIpAddress,jdbcType=VARCHAR}, + + + ip_pattern = #{ipPattern,jdbcType=INTEGER}, + + + port_pattern = #{portPattern,jdbcType=INTEGER}, + + + src_port = #{srcPort,jdbcType=VARCHAR}, + + + protocol = #{protocol,jdbcType=INTEGER}, + + + protocol_id = #{protocolId,jdbcType=INTEGER}, + + + direction = #{direction,jdbcType=INTEGER}, + + + dest_port = #{destPort,jdbcType=VARCHAR}, + + + dest_ip_address = #{destIpAddress,jdbcType=VARCHAR}, + + + cfg_type = #{cfgType,jdbcType=VARCHAR}, + + + cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER}, + + + dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER}, + + + + + and cfg_id = #{cfgId,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.java b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.java new file mode 100644 index 000000000..c3e34131c --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.java @@ -0,0 +1,16 @@ +package com.nis.web.dao.configuration; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.nis.domain.configuration.DnsResStrategy; +import com.nis.web.dao.CrudDao; +import com.nis.web.dao.MyBatisDao; + +@MyBatisDao +public interface DnsResStrategyDao extends CrudDao { + List findPage(DnsResStrategy dnsResStrategy); + List findList(@Param("cfgId")Long cfgId,@Param("isValid")Integer isValid); + +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml new file mode 100644 index 000000000..5357362a6 --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + r.cfg_id,r.cfg_desc,r.res_group_1_id, + r.res_group_1_num,r.res_group_2_id,r.res_group_2_num,r.res_group_3_id + ,r.res_group_3_num,r.res_group_4_id,r.res_group_4_num + ,r.res_group_5_id,r.res_group_5_num,r.min_ttl + ,r.max_ttl,r.cfg_type,r.action + ,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id + ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id + ,r.is_area_effective,r.classify,r.attribute,r.lable + ,r.area_effective_ids,r.function_id,r.cfg_region_code,r.compile_id + + + + + + + + insert into dns_res_strategy ( + CFG_ID, + CFG_DESC, + ACTION, + IS_VALID, + IS_AUDIT, + CREATOR_ID, + CREATE_TIME, + EDITOR_ID, + EDIT_TIME, + AUDITOR_ID, + AUDIT_TIME, + SERVICE_ID, + REQUEST_ID, + IS_AREA_EFFECTIVE, + CLASSIFY, + ATTRIBUTE, + LABLE, + AREA_EFFECTIVE_IDS, + function_id, + res_group_1_id, + res_group_1_num, + res_group_2_id, + res_group_2_num, + res_group_3_id, + res_group_3_num, + res_group_4_id, + res_group_4_num, + res_group_5_id, + res_group_5_num, + min_ttl, + max_ttl, + cfg_type, + compile_Id, + cfg_region_code + )values ( + #{cfgId,jdbcType=VARCHAR}, + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + 0, + 0, + #{creatorId,jdbcType=INTEGER}, + #{createTime,jdbcType=TIMESTAMP}, + #{editorId,jdbcType=INTEGER}, + #{editTime,jdbcType=TIMESTAMP}, + #{auditorId,jdbcType=INTEGER}, + #{auditTime,jdbcType=TIMESTAMP}, + #{serviceId,jdbcType=INTEGER}, + #{requestId,jdbcType=INTEGER}, + #{isAreaEffective,jdbcType=INTEGER}, + #{classify,jdbcType=VARCHAR}, + #{attribute,jdbcType=VARCHAR}, + #{lable,jdbcType=VARCHAR}, + #{areaEffectiveIds,jdbcType=VARCHAR}, + #{functionId,jdbcType=INTEGER}, + #{resGroup1Id,jdbcType=INTEGER}, + #{resGroup1Num,jdbcType=INTEGER}, + #{resGroup2Id,jdbcType=INTEGER}, + #{resGroup2Num,jdbcType=INTEGER}, + #{resGroup3Id,jdbcType=INTEGER}, + #{resGroup3Num,jdbcType=INTEGER}, + #{resGroup4Id,jdbcType=INTEGER}, + #{resGroup4Num,jdbcType=INTEGER}, + #{resGroup5Id,jdbcType=INTEGER}, + #{resGroup5Num,jdbcType=INTEGER}, + #{minTtl,jdbcType=INTEGER}, + #{maxTtl,jdbcType=INTEGER}, + #{cfgType,jdbcType=VARCHAR}, + #{compileId,jdbcType=INTEGER}, + #{cfgRegionCode,jdbcType=INTEGER} + ) + + + + update dns_res_strategy + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + compile_Id = #{compileId,jdbcType=VARCHAR}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + 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}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + res_group_1_id = #{resGroup1Id,jdbcType=INTEGER}, + + + res_group_1_num = #{resGroup1Num,jdbcType=INTEGER}, + + + res_group_2_id = #{resGroup2Id,jdbcType=INTEGER}, + + + res_group_2_num = #{resGroup2Num,jdbcType=INTEGER}, + + + res_group_3_id = #{resGroup3Id,jdbcType=INTEGER}, + + + res_group_3_num = #{resGroup3Num,jdbcType=INTEGER}, + + + res_group_4_id = #{resGroup4Id,jdbcType=INTEGER}, + + + res_group_4_num = #{resGroup4Num,jdbcType=INTEGER}, + + + res_group_5_id = #{resGroup5Id,jdbcType=INTEGER}, + + + res_group_5_num = #{resGroup5Num,jdbcType=INTEGER}, + + + min_ttl = #{minTtl,jdbcType=INTEGER}, + + + max_ttl = #{maxTtl,jdbcType=INTEGER}, + + + + + and cfg_id = #{cfgId,jdbcType=INTEGER} + + and function_id = #{functionId,jdbcType=INTEGER} + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/basics/PolicyGroupInfoService.java b/src/main/java/com/nis/web/service/basics/PolicyGroupInfoService.java index 08c5e25ad..0a6d19894 100644 --- a/src/main/java/com/nis/web/service/basics/PolicyGroupInfoService.java +++ b/src/main/java/com/nis/web/service/basics/PolicyGroupInfoService.java @@ -40,6 +40,10 @@ public class PolicyGroupInfoService extends BaseService{ page.setList(list); return page; } + public List findPolicyGroupInfos() { + List list=policyGroupInfoDao.findPolicyGroupInfos(); + return list; + } public PolicyGroupInfo getById(int id) { PolicyGroupInfo policyGroupInfo=policyGroupInfoDao.getById(id); diff --git a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java index e46f0a39d..97877079f 100644 --- a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java @@ -1,109 +1,184 @@ package com.nis.web.service.configuration; -import java.util.ArrayList; -import java.util.List; -import org.apache.commons.lang3.StringUtils; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +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.google.gson.Gson; -import com.google.gson.GsonBuilder; +import com.nis.domain.Page; +import com.nis.domain.callback.NtcDnsResStrategy; +import com.nis.domain.configuration.AreaBean; +import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.AvVoipAccountCfg; +import com.nis.domain.configuration.AvVoipIpCfg; import com.nis.domain.configuration.DnsIpCfg; -import com.nis.domain.maat.DnsIpRecvData; -import com.nis.domain.maat.FromMaatBean; -import com.nis.domain.maat.MaatDnsIpCfg; -import com.nis.domain.maat.ToMaatDnsIpBean; -import com.nis.main.ConvertTool; -import com.nis.util.Collections3; +import com.nis.domain.configuration.BaseStringCfg; +import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.DnsIpCfg; +import com.nis.domain.maat.MaatCfg; +import com.nis.domain.maat.ToMaatBean; +import com.nis.domain.maat.ToMaatResult; +import com.nis.domain.maat.MaatCfg.DigestCfg; +import com.nis.domain.maat.MaatCfg.GroupCfg; +import com.nis.domain.maat.MaatCfg.IpCfg; +import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; +import com.nis.domain.maat.MaatCfg.StringCfg; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigServiceUtil; +import com.nis.util.Constants; +import com.nis.util.StringUtil; +import com.nis.util.StringUtils; import com.nis.web.dao.configuration.DnsIpCfgDao; -import com.nis.web.service.CrudService; -import com.nis.web.test.DnsIpTest; +import com.nis.web.security.UserUtils; +import com.nis.web.service.BaseService; + + +/** + * 音视频文本 + * @author dell + * + */ @Service -public class DnsIpCfgService extends CrudService{ +public class DnsIpCfgService extends BaseService{ @Autowired - private DnsIpCfgDao dnsIpCfgDao; - @Override + protected DnsIpCfgDao dnsIpCfgDao; + + + public Page findPage(Page page, DnsIpCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); + entity.setPage(page); + List list=dnsIpCfgDao.findPage(entity); + page.setList(list); + return page; + } + + public DnsIpCfg getDnsIpCfg(Long cfgId) { + return dnsIpCfgDao.getDnsIpCfg(cfgId); + } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void save(DnsIpCfg dnsIpCfg) { - dao.insert(dnsIpCfg); - - Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); - - //组织要发送的json - List toMaatData = new ArrayList(); - ToMaatDnsIpBean toMaatBean = new ToMaatDnsIpBean(); - List ipCfgList = new ArrayList(); - MaatDnsIpCfg ipCfg = new MaatDnsIpCfg(); - List d1 = new ArrayList(); - d1.add(dnsIpCfg); - ipCfg.setIpCfg(d1); - ipCfgList.add(ipCfg); - toMaatBean.setServiceCfg(ipCfgList); - toMaatBean.setAttribute(dnsIpCfg.getAttribute()); - toMaatBean.setClassify(dnsIpCfg.getClassify()); - toMaatBean.setLable(dnsIpCfg.getLable()); - toMaatBean.setIsValid(1); - toMaatBean.setRequestId(dnsIpCfg.getRequest().getId()); - - toMaatData.add(toMaatBean); - - String sendJson = gson.toJson(toMaatData); - - logger.info("准备下发配置:" + sendJson); - //下发配置、接收结果 - String recvJson = ""; - try { - //recvJson = new ConvertTool().saveDNSIPConfig(sendJson); - recvJson = DnsIpTest.examine(sendJson); - logger.info("收到结果:" + recvJson); - } catch (Throwable e) { - logger.error("欺骗ip配置新增下发失败,cfgId=" + dnsIpCfg.getCfgId(), e); - throw new RuntimeException("欺骗ip配置新增下发失败:通讯异常"); - } - - if (StringUtils.isBlank(recvJson)) { - logger.error("新增欺骗ip配置失败:收到空的返回结果,cfgId:" + dnsIpCfg.getCfgId()); - throw new RuntimeException("新增欺骗ip配置失败:收到空的返回结果"); - } - logger.info("结果接收成功"); - - FromMaatBean fromMaatBean = gson.fromJson(recvJson, FromMaatBean.class); - List data = fromMaatBean.getData(); - if (!Collections3.isEmpty(data)) { - DnsIpRecvData dnsIpRecvData = data.get(0); - if (dnsIpRecvData.getFakeId() != null && dnsIpRecvData.getCfgId() != null - && dnsIpRecvData.getCfgId().longValue() == dnsIpCfg.getCfgId().longValue()) { - dnsIpCfg.setFakeId(dnsIpRecvData.getFakeId()); - dao.update(dnsIpCfg); + public void saveOrUpdate(DnsIpCfg entity){ + Date createTime=new Date(); + //设置区域运营商信息 + setAreaEffectiveIds(entity); + //新增 + if(entity.getCfgId()==null){ + entity.setCreatorId(UserUtils.getUser().getId()); + entity.setCreateTime(createTime); + entity.setIsValid(0); + entity.setIsAudit(0); + //调用服务接口获取compileId + List compileIds = new ArrayList(); + try { + compileIds = ConfigServiceUtil.getId(1,1); + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); } - } else { - logger.error("新增欺骗ip配置失败:收到空的返回结果,cfgId:" + dnsIpCfg.getCfgId()); - throw new RuntimeException("新增欺骗ip配置失败:收到空的返回结果"); + if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){ + entity.setCompileId(compileIds.get(0)); + dnsIpCfgDao.insert(entity); + }else{ + throw new MaatConvertException(""); + } + + //修改 + }else{ + Date editTime=new Date(); + entity.setIsValid(0); + entity.setIsAudit(0); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(editTime); + dnsIpCfgDao.update(entity); } } - - public void delete(String fakeIds) { - if(fakeIds.endsWith(","))fakeIds=fakeIds.substring(0,fakeIds.lastIndexOf(",")); - String[] fakeIdsArr = fakeIds.split(","); - for (String fakeId : fakeIdsArr) { - dnsIpCfgDao.deleteByFakeId(fakeId); + + /** + * + * @param isAudit + * @param isValid + * @param ids compileIds + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void delete(Integer isAudit,Integer isValid,String ids,Integer functionId){ + DnsIpCfg entity = new DnsIpCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.valueOf(id)); + entity.setFunctionId(functionId); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + dnsIpCfgDao.update(entity); } - //给配置转换层发送、接收结果 - String sendJson = "{\"fakeId\":[" + fakeIds + "]}"; - logger.info("准备下发配置:" + sendJson); - Boolean recv = true; - try { - recv = new ConvertTool().invalidDNSIPConfig(sendJson); - } catch (Throwable e) { - logger.error("欺骗ip配置删除失败:通讯异常,fakeIds:" + fakeIds, e); - throw new RuntimeException("欺骗ip配置删除失败:通讯失败"); - } - if (!recv) { - logger.error("欺骗ip配置删除失败,收到结果 " + recv + " ,fakeIds:" + fakeIds); - throw new RuntimeException("欺骗ip配置删除失败"); + } + /** + * + * @param isAudit + * @param isValid + * @param ids cfgId + * @param functionId + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime){ + DnsIpCfg entity = new DnsIpCfg(); + + List list = new ArrayList(); + + entity.setCfgId(Long.valueOf(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(auditTime); + + dnsIpCfgDao.update(entity); + + entity=dnsIpCfgDao.getDnsIpCfg(Long.valueOf(id)); + + String json=""; + if(entity.getIsAudit()==1){ + List resStrategyList=new ArrayList(); + //NtcDnsResStrategy resStrategy=convertCallBackIp(entity); + //resStrategyList.add(resStrategy); + //调用服务接口下发配置数据 + json=gsonToJson(resStrategyList); + logger.info("DNS响应策略配置下发配置参数:"+json); + //调用服务接口下发配置 + try { + ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); + if(result!=null){ + logger.info("DNS响应策略配置下发响应信息:"+result.getMsg()); + } + } catch (Exception e) { + logger.error("DNS响应策略配置配置下发失败",e); + throw e; + } + }else if(entity.getIsAudit()==3){ + List resStrategyList=new ArrayList<>(); + //NtcDnsResStrategy ntcDnsResStrategy=convertCallBackDnsResStrategy(cfg); + //resStrategyList.add(ntcDnsResStrategy); + //调用服务接口取消配置 + json=gsonToJson(resStrategyList); + logger.info("DNS响应策略配置配置参数:"+json); + //调用服务接口取消配置 + try { + ToMaatResult result = ConfigServiceUtil.put(json, 2); + logger.info("DNS响应策略配置响应信息:"+result.getMsg()); + } catch (Exception e) { + e.printStackTrace(); + logger.info("DNS响应策略配置配置失败"); + throw e; + } } + } } diff --git a/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java b/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java new file mode 100644 index 000000000..9ecfe19e2 --- /dev/null +++ b/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java @@ -0,0 +1,188 @@ +package com.nis.web.service.configuration; + + +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +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.nis.domain.Page; +import com.nis.domain.callback.InlineIp; +import com.nis.domain.callback.NtcDnsResStrategy; +import com.nis.domain.configuration.DnsResStrategy; +import com.nis.domain.maat.MaatCfg; +import com.nis.domain.maat.ToMaatBean; +import com.nis.domain.maat.ToMaatResult; +import com.nis.domain.maat.MaatCfg.DigestCfg; +import com.nis.domain.maat.MaatCfg.GroupCfg; +import com.nis.domain.maat.MaatCfg.IpCfg; +import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; +import com.nis.domain.maat.MaatCfg.StringCfg; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigServiceUtil; +import com.nis.web.dao.configuration.DnsResStrategyDao; +import com.nis.web.security.UserUtils; +import com.nis.web.service.BaseService; + + + +/** + * 音视频文本 + * @author dell + * + */ +@Service +public class DnsResStrategyService extends BaseService{ + @Autowired + protected DnsResStrategyDao dnsResStrategyDao; + + + /** + * 查询分页数据 + * @param page 分页对象 + * @param entity + * @return + */ + public Page findPage(Page page, DnsResStrategy entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); + entity.setPage(page); + List list=dnsResStrategyDao.findPage(entity); + page.setList(list); + return page; + } + public List findDnsResStrategys(Long cfgId,Integer isValid) { + List list=dnsResStrategyDao.findList(cfgId,isValid); + return list; + } + + public DnsResStrategy getDnsResStrategy(Long id,Integer isValid) { + List list=dnsResStrategyDao.findList(id,isValid); + DnsResStrategy dnsResStrategy=null; + if(list != null && list.size()>0){ + dnsResStrategy=list.get(0); + } + return dnsResStrategy; + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdate(DnsResStrategy entity){ + Date createTime=new Date(); + setAreaEffectiveIds(entity); + List list=dnsResStrategyDao.findList(entity.getCfgId(),null); + //新增 + if(list==null || list.size()==0){ + entity.initDefaultValue(); + entity.setCreatorId(UserUtils.getUser().getId()); + entity.setCreateTime(createTime); + entity.setIsValid(0); + entity.setIsAudit(0); + //调用服务接口获取compileId + List compileIds = new ArrayList(); + try { + compileIds = ConfigServiceUtil.getId(1,1); + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){ + entity.setCompileId(compileIds.get(0)); + } + dnsResStrategyDao.insert(entity); + //修改 + }else{ + Date editTime=new Date(); + entity.setIsValid(0); + entity.setIsAudit(0); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(editTime); + + dnsResStrategyDao.update(entity); + } + } + + /** + * + * @param isAudit + * @param isValid + * @param ids compileIds + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void delete(Integer isAudit,Integer isValid,String ids,Integer functionId){ + DnsResStrategy entity = new DnsResStrategy(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.valueOf(id)); + entity.setFunctionId(functionId); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + dnsResStrategyDao.update(entity); + } + } + /** + * + * @param isAudit + * @param isValid + * @param ids cfgId + * @param functionId + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime){ + DnsResStrategy cfg=new DnsResStrategy(); + List beans=new ArrayList<>(); + beans.add(cfg); + cfg.setCfgId(Long.valueOf(id)); + cfg.setIsValid(isValid); + cfg.setIsAudit(isAudit); + cfg.setEditTime(auditTime); + cfg.setEditorId(UserUtils.getUser().getId()); + cfg.setAuditorId(UserUtils.getUser().getId()); + cfg.setAuditTime(auditTime); + dnsResStrategyDao.update(cfg); + cfg=getDnsResStrategy(cfg.getCfgId(), null); + String json=""; + if(cfg.getIsAudit()==1){ + List resStrategyList=new ArrayList(); + NtcDnsResStrategy resStrategy=convertCallBackDnsResStrategy(cfg); + resStrategyList.add(resStrategy); + //调用服务接口下发配置数据 + json=gsonToJson(resStrategyList); + logger.info("DNS响应策略配置下发配置参数:"+json); + //调用服务接口下发配置 + try { + ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); + if(result!=null){ + logger.info("DNS响应策略配置下发响应信息:"+result.getMsg()); + } + } catch (Exception e) { + logger.error("DNS响应策略配置配置下发失败",e); + throw e; + } + }else if(cfg.getIsAudit()==3){ + List resStrategyList=new ArrayList<>(); + NtcDnsResStrategy ntcDnsResStrategy=convertCallBackDnsResStrategy(cfg); + resStrategyList.add(ntcDnsResStrategy); + //调用服务接口取消配置 + json=gsonToJson(resStrategyList); + logger.info("DNS响应策略配置配置参数:"+json); + //调用服务接口取消配置 + try { + ToMaatResult result = ConfigServiceUtil.put(json, 2); + logger.info("DNS响应策略配置响应信息:"+result.getMsg()); + } catch (Exception e) { + e.printStackTrace(); + logger.info("DNS响应策略配置配置失败"); + throw e; + } + } + } +} + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp index 84048000d..c742f0fb0 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp @@ -3,36 +3,18 @@ <spring:message code="${cfgName}"></spring:message> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-

@@ -100,73 +72,87 @@
- - + + + - - - + + +
- <%-- - + + + - - --%> - " value="${dnsIpCfg.cfgDesc }"/> -
- -
- - - + <%-- --%> +
- -
- <%-- --%> - - - - <%--
- - -
--%> - - - - +
+ +
+
+ + + + + + + +
+ + + +
+
+ + + +
+
+ + + + + +
+ + +
+
+ href="javascript:;"> + + +
- +
-
- -
- -
- + +
+ +
+ - + + @@ -174,13 +160,13 @@
- -
+ +
- - - + + + @@ -188,13 +174,14 @@
- -
+ +
- + - + + @@ -202,13 +189,13 @@
- -
+ +
- - - + + + @@ -216,138 +203,238 @@
- -
-
- - -
-
- -
-
- - " 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});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+ -
+
- +
- - + <%-- --%> - + + - - - - + + - <%-- - - --%> + + + + - - <%-- - --%> + + + + + + <%-- --%> - - - - - - - - - - - - - - + + + + + + + + + + - <%-- + + + + + + + + <%-- --%> + + - - --%> - - - - - - - <%-- - --%> + + + + + + +
ip
${dnsIpCfg.cfgDesc }V${dnsIpCfg.ipType }${dnsIpCfg.srcIp }${dnsIpCfg.srcIpMask }${dnsIpCfg.srcPort }${dnsIpCfg.srcPortMask }${dnsIpCfg.dstIp }${dnsIpCfg.dstIpMask }${dnsIpCfg.dstPort }${dnsIpCfg.dstPortMask }
${cfg.cfgDesc }${cfg.dnsStrategyName } - - + + + + ${cfg.srcIpAddress }${cfg.srcPort }${cfg.destIpAddress }${cfg.destPort } + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + ${cfg.areaEffectiveIds } + + + + - - - - + + + + ${dnsIpCfg.auditor.name }${dnsIpCfg.request.requestTitle } - - - - ${fl.itemValue} - , - - - - - - - - ${xz.itemValue} - , - - - - - - - - ${lable.itemValue} - , - - - - ${dnsIpCfg.creator.name }${dnsIpCfg.editor.name }${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
-
${page}
+
${page}
diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp new file mode 100644 index 000000000..ab6f74a75 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp @@ -0,0 +1,179 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+ +
+
+
+
+
+ + + +
+
+
+ +
+ + + + + + + + + + + + +
+
+
+
+ +
+ readonly="true" type="text" id="cfgId" name="cfgId" value="${_cfg.cfgId}"> +
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ " type="text" name="minTtl" value="${_cfg.minTtl}"> +
+
+
+
+
+
+ +
+ " type="text" name="maxTtl" value="${_cfg.maxTtl}"> +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+ <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp new file mode 100644 index 000000000..d3ef7aff0 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp @@ -0,0 +1,406 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></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});"/> + +
+
+
+ + +
+ + +
+
+
+ + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + +
${cfg.cfgId } + + ${fns:abbr(cfg.cfgDesc,20)} + + + + ${fns:abbr(cfg.group1Name,20)} + + ${cfg.minTtl }${cfg.maxTtl } + + + + + + + + + + + + + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + ${cfg.areaEffectiveIds } + + + + ${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file