diff --git a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java index 0eddc6ea2..01235948e 100644 --- a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java @@ -8,6 +8,8 @@ */ package com.nis.domain.configuration; +import java.util.List; + import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.nis.util.excel.ExcelField; @@ -38,17 +40,20 @@ public class AppPolicyCfg extends BaseCfg { @Expose @ExcelField(title="expression_type") @SerializedName("exprType") - protected Integer exprType ; + private Integer exprType ; @Expose @ExcelField(title="match_method") @SerializedName("matchMethod") - protected Integer matchMethod ; + private Integer matchMethod ; @Expose @ExcelField(title="whether_hexbinary") @SerializedName("isHexbin") - protected Integer isHexbin; + private Integer isHexbin; + + private List ipPortList; + private IpPortCfg ipPort; public Integer getExprType() { return exprType; @@ -134,5 +139,21 @@ public class AppPolicyCfg extends BaseCfg { public void setBehavCode(Integer behavCode) { this.behavCode = behavCode; } + + public List getIpPortList() { + return ipPortList; + } + + public void setIpPortList(List ipPortList) { + this.ipPortList = ipPortList; + } + + public IpPortCfg getIpPort() { + return ipPort; + } + + public void setIpPort(IpPortCfg ipPort) { + this.ipPort = ipPort; + } } diff --git a/src/main/java/com/nis/domain/configuration/BaseCfg.java b/src/main/java/com/nis/domain/configuration/BaseCfg.java index 540c7ff17..120600485 100644 --- a/src/main/java/com/nis/domain/configuration/BaseCfg.java +++ b/src/main/java/com/nis/domain/configuration/BaseCfg.java @@ -31,6 +31,16 @@ public class BaseCfg extends BaseEntity implements Cloneable{ protected String showName;//表在界面上展示的名称 protected String seltype;//选中类型,页面搜索用 protected String tableName; + @ExcelField(title="userregion1") + protected String userRegion1; + @ExcelField(title="userregion2") + protected String userRegion2; + @ExcelField(title="userregion3") + protected String userRegion3; + @ExcelField(title="userregion4") + protected String userRegion4; + @ExcelField(title="userregion5") + protected String userRegion5; /** * 编译id */ @@ -786,4 +796,35 @@ public class BaseCfg extends BaseEntity implements Cloneable{ public void setAreaType(Integer areaType) { this.areaType = areaType; } + public String getUserRegion1() { + return userRegion1; + } + public void setUserRegion1(String userRegion1) { + this.userRegion1 = userRegion1; + } + public String getUserRegion2() { + return userRegion2; + } + public void setUserRegion2(String userRegion2) { + this.userRegion2 = userRegion2; + } + public String getUserRegion3() { + return userRegion3; + } + public void setUserRegion3(String userRegion3) { + this.userRegion3 = userRegion3; + } + public String getUserRegion4() { + return userRegion4; + } + public void setUserRegion4(String userRegion4) { + this.userRegion4 = userRegion4; + } + public String getUserRegion5() { + return userRegion5; + } + public void setUserRegion5(String userRegion5) { + this.userRegion5 = userRegion5; + } + } diff --git a/src/main/java/com/nis/domain/configuration/IpCfgTemplate.java b/src/main/java/com/nis/domain/configuration/IpCfgTemplate.java index 38b8cbbb7..55cb57966 100644 --- a/src/main/java/com/nis/domain/configuration/IpCfgTemplate.java +++ b/src/main/java/com/nis/domain/configuration/IpCfgTemplate.java @@ -8,12 +8,6 @@ */ package com.nis.domain.configuration; -import java.util.Date; - -import org.apache.commons.lang3.StringEscapeUtils; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; import com.nis.util.excel.ExcelField; /** @@ -53,7 +47,82 @@ public class IpCfgTemplate { private Integer ratelimit;//21 private Integer dnsStrategyId;//22 private Integer irType;//23 + private String userRegion1;//77 + private String userRegion2;//78 + private String userRegion3;//79 + private String userRegion4;//80 + private String userRegion5;//81 + /** + * userRegion1 + * @return userRegion1 + */ + @ExcelField(title="userregion1",align=2,sort=77) + public String getUserRegion1() { + return userRegion1; + } + /** + * @param userRegion1 the userRegion1 to set + */ + public void setUserRegion1(String userRegion1) { + this.userRegion1 = userRegion1; + } + /** + * userRegion2 + * @return userRegion2 + */ + @ExcelField(title="userregion2",align=2,sort=78) + public String getUserRegion2() { + return userRegion2; + } + /** + * @param userRegion2 the userRegion2 to set + */ + public void setUserRegion2(String userRegion2) { + this.userRegion2 = userRegion2; + } + /** + * userRegion3 + * @return userRegion3 + */ + @ExcelField(title="userregion3",align=2,sort=79) + public String getUserRegion3() { + return userRegion3; + } + /** + * @param userRegion3 the userRegion3 to set + */ + public void setUserRegion3(String userRegion3) { + this.userRegion3 = userRegion3; + } + /** + * userRegion4 + * @return userRegion4 + */ + @ExcelField(title="userregion4",align=2,sort=80) + public String getUserRegion4() { + return userRegion4; + } + /** + * @param userRegion4 the userRegion4 to set + */ + public void setUserRegion4(String userRegion4) { + this.userRegion4 = userRegion4; + } + /** + * userRegion5 + * @return userRegion5 + */ + @ExcelField(title="userregion5",align=2,sort=81) + public String getUserRegion5() { + return userRegion5; + } + /** + * @param userRegion5 the userRegion5 to set + */ + public void setUserRegion5(String userRegion5) { + this.userRegion5 = userRegion5; + } /** * ratelimit * @return ratelimit diff --git a/src/main/java/com/nis/domain/log/BaseReportLog.java b/src/main/java/com/nis/domain/log/BaseReportLog.java new file mode 100644 index 000000000..7061da40e --- /dev/null +++ b/src/main/java/com/nis/domain/log/BaseReportLog.java @@ -0,0 +1,75 @@ +/** + *@Title: BaseReportLog.java + *@Package com.nis.domain.log + *@Description TODO + *@author dell + *@date 2018年7月5日 上午11:12:48 + *@version 版本号 + */ +package com.nis.domain.log; + +import java.util.Date; + +import com.nis.domain.BaseEntity; + +/** + * @ClassName: BaseReportLog.java + * @Description: 报表接口返回的公共字段 + * @author (wx) + * @date 2018年7月5日 上午11:12:48 + * @version V1.0 + */ +public class BaseReportLog extends BaseEntity { + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = -6190203013788730697L; + protected Long sum; + protected Integer service; + protected Date reportTime; + /** + * sum + * @return sum + */ + + public Long getSum() { + return sum; + } + /** + * @param sum the sum to set + */ + public void setSum(Long sum) { + this.sum = sum; + } + /** + * service + * @return service + */ + + public Integer getService() { + return service; + } + /** + * @param service the service to set + */ + public void setService(Integer service) { + this.service = service; + } + /** + * reportTime + * @return reportTime + */ + + public Date getReportTime() { + return reportTime; + } + /** + * @param reportTime the reportTime to set + */ + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } +} diff --git a/src/main/java/com/nis/domain/log/ReportLog.java b/src/main/java/com/nis/domain/log/ReportLog.java index d912e813b..4cf45a790 100644 --- a/src/main/java/com/nis/domain/log/ReportLog.java +++ b/src/main/java/com/nis/domain/log/ReportLog.java @@ -10,8 +10,6 @@ package com.nis.domain.log; import java.util.Date; -import com.nis.domain.BaseEntity; - /** * @ClassName: ReportLog.java * @Description: TODO @@ -19,7 +17,7 @@ import com.nis.domain.BaseEntity; * @date 2018年6月13日 下午2:21:04 * @version V1.0 */ -public class ReportLog extends BaseEntity{ +public class ReportLog extends BaseReportLog{ /** * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) * diff --git a/src/main/java/com/nis/domain/log/ReportResultLog.java b/src/main/java/com/nis/domain/log/ReportResultLog.java index 19b50d3dc..3619cd8c4 100644 --- a/src/main/java/com/nis/domain/log/ReportResultLog.java +++ b/src/main/java/com/nis/domain/log/ReportResultLog.java @@ -8,12 +8,21 @@ */ package com.nis.domain.log; -import java.util.Date; -import java.util.List; +import java.util.Map.Entry; -import com.nis.domain.BaseEntity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.client.Invocation.Builder; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import com.google.common.reflect.TypeToken; +import com.google.gson.Gson; import com.nis.domain.Page; import com.nis.domain.RestfulResult; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.Constants; +import com.nis.util.StringUtils; +import com.nis.util.httpclient.ClientUtil; /** * @ClassName: ReportResultLog.java @@ -22,9 +31,9 @@ import com.nis.domain.RestfulResult; * @date 2018年6月11日 下午2:04:09 * @version V1.0 */ -public class ReportResultLog extends RestfulResult{ +public class ReportResultLog extends RestfulResult{ private Integer logSource; - private Page data; + private Page data; /** * logSource * @return logSource @@ -44,14 +53,50 @@ public class ReportResultLog extends RestfulResult{ * @return data */ - public Page getData() { + public Page getData() { return data; } /** * @param data the data to set */ - public void setData(Page data) { + public void setData(Page data) { this.data = data; } - + public ReportResultLog getReport(String reportUrl,SearchReport searchCondition) throws MaatConvertException{ + if(StringUtils.isBlank(searchCondition.getSearchService())){ + throw new MaatConvertException(""); + } + String result = null; + ReportResultLog bean = null; + StringBuffer url=new StringBuffer(reportUrl+"?"); + url.append("searchBusinessType=").append(searchCondition.getSearchBusinessType()) + .append("&searchService=").append(searchCondition.getSearchService()); + if(searchCondition.getSearchCondition()!=null){ + for(Entry e:searchCondition.getSearchCondition().entrySet()){ + url.append("&").append(e.getKey()).append("=").append((String)e.getValue()); + } + } + if(StringUtils.isNotBlank(searchCondition.getSearchReportStartTime())){ + url.append("&searchReportStartTime=").append(searchCondition.getSearchReportStartTime()); + } + if(StringUtils.isNotBlank(searchCondition.getSearchReportEndTime())){ + url.append("&searchReportEndTime=").append(searchCondition.getSearchReportEndTime()); + } + //创建连接 + WebTarget wt = ClientUtil.getWebTarger(url.toString()); + Builder header = wt.request(MediaType.APPLICATION_JSON); + Response response= header.get(); + if( response.getStatus() == 200){ + result= response.readEntity(String.class); + Gson gson=Constants.gsonbuilder.create(); + bean = gson.fromJson(result, new TypeToken>(){ + private static final long serialVersionUID = 7963055764864141968L;}.getType()); + }else{ + throw new MaatConvertException(":"+response.readEntity(String.class)); + } + return bean; + } + public static void main(String[] args) { + + } } \ No newline at end of file diff --git a/src/main/java/com/nis/domain/log/SearchReport.java b/src/main/java/com/nis/domain/log/SearchReport.java new file mode 100644 index 000000000..5342db1f6 --- /dev/null +++ b/src/main/java/com/nis/domain/log/SearchReport.java @@ -0,0 +1,191 @@ +/** + *@Title: SearchReport.java + *@Package com.nis.domain.log + *@Description TODO + *@author dell + *@date 2018年7月5日 下午12:30:44 + *@version 版本号 + */ +package com.nis.domain.log; + +import java.util.HashMap; + +import com.nis.domain.BaseEntity; + +/** + * @ClassName: SearchReport.java + * @Description: TODO + * @author (wx) + * @date 2018年7月5日 下午12:30:44 + * @version V1.0 + */ +public class SearchReport extends BaseEntity{ + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = 1L; + private Integer functionId; + private String cfgName; + private Integer action; + private Integer reportType; + private String searchBusinessType; + private String searchReportStartTime; + private String searchReportEndTime; + private String searchService; + private HashMap searchCondition; + public static final String searchConditionSplitor=","; + public int searchConditionLimit; + + /** + * reportType + * @return reportType + */ + + public Integer getReportType() { + return reportType; + } + /** + * @param reportType the reportType to set + */ + public void setReportType(Integer reportType) { + this.reportType = reportType; + } + /** + * functionId + * @return functionId + */ + + public Integer getFunctionId() { + return functionId; + } + /** + * @param functionId the functionId to set + */ + public void setFunctionId(Integer functionId) { + this.functionId = functionId; + } + /** + * cfgName + * @return cfgName + */ + + public String getCfgName() { + return cfgName; + } + /** + * @param cfgName the cfgName to set + */ + public void setCfgName(String cfgName) { + this.cfgName = cfgName; + } + /** + * action + * @return action + */ + + public Integer getAction() { + return action; + } + /** + * @param action the action to set + */ + public void setAction(Integer action) { + this.action = action; + } + /** + * searchBusinessType + * @return searchBusinessType + */ + + public String getSearchBusinessType() { + return searchBusinessType; + } + /** + * @param searchBusinessType the searchBusinessType to set + */ + public void setSearchBusinessType(String searchBusinessType) { + this.searchBusinessType = searchBusinessType; + } + /** + * searchReportStartTime + * @return searchReportStartTime + */ + + public String getSearchReportStartTime() { + return searchReportStartTime; + } + /** + * @param searchReportStartTime the searchReportStartTime to set + */ + public void setSearchReportStartTime(String searchReportStartTime) { + this.searchReportStartTime = searchReportStartTime; + } + /** + * searchReportEndTime + * @return searchReportEndTime + */ + + public String getSearchReportEndTime() { + return searchReportEndTime; + } + /** + * @param searchReportEndTime the searchReportEndTime to set + */ + public void setSearchReportEndTime(String searchReportEndTime) { + this.searchReportEndTime = searchReportEndTime; + } + /** + * searchService + * @return searchService + */ + + public String getSearchService() { + return searchService; + } + /** + * @param searchService the searchService to set + */ + public void setSearchService(String searchService) { + this.searchService = searchService; + } + /** + * searchCondition + * @return searchCondition + */ + + public HashMap getSearchCondition() { + return searchCondition; + } + /** + * @param searchCondition the searchCondition to set + */ + public void setSearchCondition(HashMap searchCondition) { + this.searchCondition = searchCondition; + } + /** + * searchConditionLimit + * @return searchConditionLimit + */ + + public int getSearchConditionLimit() { + return searchConditionLimit; + } + /** + * @param searchConditionLimit the searchConditionLimit to set + */ + public void setSearchConditionLimit(int searchConditionLimit) { + this.searchConditionLimit = searchConditionLimit; + } + /** + * searchconditionsplitor + * @return searchconditionsplitor + */ + + public static String getSearchconditionsplitor() { + return searchConditionSplitor; + } + +} diff --git a/src/main/java/com/nis/util/ConfigServiceUtil.java b/src/main/java/com/nis/util/ConfigServiceUtil.java index 63db81f2b..79c81db9a 100644 --- a/src/main/java/com/nis/util/ConfigServiceUtil.java +++ b/src/main/java/com/nis/util/ConfigServiceUtil.java @@ -1,32 +1,31 @@ package com.nis.util; import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import java.util.Map; -import javax.ws.rs.client.Invocation.Builder; import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation.Builder; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import net.sf.json.JSONObject; -import net.sf.json.JsonConfig; - import org.glassfish.jersey.media.multipart.FormDataMultiPart; import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.reflect.TypeToken; +import com.google.gson.Gson; +import com.nis.domain.log.ReportLog; import com.nis.domain.log.ReportResultLog; import com.nis.domain.maat.ToMaatResult; -import com.nis.domain.maat.ToMaatResult.ResponseData; import com.nis.exceptions.MaatConvertException; import com.nis.util.httpclient.ClientUtil; +import net.sf.json.JSONObject; +import net.sf.json.JsonConfig; + public class ConfigServiceUtil { private static Logger logger = LoggerFactory.getLogger(ConfigServiceUtil.class); /*public static class MapTypeAdapter extends TypeAdapter { @@ -310,12 +309,12 @@ public class ConfigServiceUtil { * @exception * @since 1.0.0 */ - public static ReportResultLog getReport(int type,String ids,String serviceIds,String searchReportStartTime,String searchReportEndTime) throws MaatConvertException{ + public static ReportResultLog getReport(int type,String ids,String serviceIds,String searchReportStartTime,String searchReportEndTime) throws MaatConvertException{ if(StringUtils.isBlank(ids)||StringUtils.isBlank(serviceIds)){ throw new MaatConvertException(""); } String result = null; - ReportResultLog bean = null; + ReportResultLog bean = null; StringBuffer url=new StringBuffer(Constants.SERVICE_URL+Constants.NTC_PZ_REPORT+"?"); url.append("searchBusinessType=").append(type) .append("&searchService=").append(serviceIds).append("&searchCfgId=").append(ids); @@ -331,8 +330,9 @@ public class ConfigServiceUtil { Response response= header.get(); if( response.getStatus() == 200){ result= response.readEntity(String.class); - JSONObject resObject = JSONObject.fromObject(result); - bean = (ReportResultLog) JSONObject.toBean(resObject,ReportResultLog.class); + Gson gson=Constants.gsonbuilder.create(); + bean = gson.fromJson(result, new TypeToken>(){ + private static final long serialVersionUID = 7963055764864141968L;}.getType()); }else{ throw new MaatConvertException(":"+response.readEntity(String.class)); } diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 07e914103..359bf0282 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -40,6 +40,7 @@ import com.nis.domain.configuration.IpCfgTemplate; import com.nis.domain.configuration.RequestInfo; import com.nis.domain.configuration.StringCfgTemplate; import com.nis.domain.log.BaseLogEntity; +import com.nis.domain.log.SearchReport; import com.nis.exceptions.MaatConvertException; import com.nis.util.Configurations; //import com.nis.main.ConvertTool; @@ -329,6 +330,20 @@ public class BaseController { List serviceList = DictUtils.getFunctionServiceDictList(cfg.getFunctionId()); model.addAttribute("serviceList", serviceList); } + protected void initReportCondition(Model model,SearchReport report){ + 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); + List regionList = DictUtils.getFunctionRegionDictList(report.getFunctionId()); + model.addAttribute("regionList", regionList); + List serviceList = DictUtils.getFunctionServiceDictList(report.getFunctionId()); + model.addAttribute("serviceList", serviceList); + } protected void initFormCondition(Model model){ List requestInfos=requestInfoService.getValidRequestInfo(); model.addAttribute("requestInfos", requestInfos); diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index f20367bf1..a291e635a 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -1,6 +1,8 @@ package com.nis.web.controller.configuration; +import java.util.ArrayList; import java.util.Date; +import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -19,6 +21,9 @@ import com.nis.domain.configuration.AppDomainCfg; import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; +import com.nis.domain.configuration.BaseStringCfg; +import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.specific.SpecificServiceCfg; import com.nis.exceptions.MaatConvertException; import com.nis.web.controller.BaseController; @@ -52,6 +57,31 @@ public class AppCfgController extends BaseController { initPageCondition(model,cfg); return "/cfg/app/appPolicyCfgList"; } + /** + * 查询APP策略IP子配置 + * @param model + * @param cfgId + * @param index + * @return + */ + @RequestMapping(value = {"ajaxAppPolicyIpList"}) + public String ajaxSslSubList(Model model,Long cfgId,Integer index) { + AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId); + List tabList = new ArrayList(); + if(cfg.getIpPortList()!=null){ + String cfgType = null; + for(IpPortCfg ip:cfg.getIpPortList()){ + if(!ip.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"1",ip.getCfgType()}); + cfgType = ip.getCfgType(); + } + } + } + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + model.addAttribute("tabList", tabList); + return "/cfg/app/appPolicyIpList"; + } /** * 策略配置表单 * @param model diff --git a/src/main/java/com/nis/web/controller/configuration/CommonController.java b/src/main/java/com/nis/web/controller/configuration/CommonController.java index e61304bfc..9e2402ab6 100644 --- a/src/main/java/com/nis/web/controller/configuration/CommonController.java +++ b/src/main/java/com/nis/web/controller/configuration/CommonController.java @@ -11,7 +11,6 @@ package com.nis.web.controller.configuration; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; @@ -20,16 +19,12 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; -import org.datanucleus.store.types.wrappers.backed.Set; import org.springframework.beans.BeanUtils; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; -import com.nis.domain.SysUser; import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.HttpUrlCfg; @@ -223,7 +218,7 @@ public class CommonController extends BaseController { try { ImportExcel ei = new ImportExcel(file, 0, 0); List list = ei.getDataList(IpCfgTemplate.class); - this.checkIpCfg(list); + this.checkIpCfg(ipCfg.getFunctionId(),list); List ipList = new ArrayList<>(); Date date=new Date(); for(IpCfgTemplate cfg : list){ @@ -251,7 +246,7 @@ public class CommonController extends BaseController { } //ip配置导出 public void _exportIp(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){ + IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){ try { //获取国际化配置 Properties msgProp = getMsgProp(); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java index 91766cba6..0631bc2e1 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java @@ -35,7 +35,7 @@ import com.nis.web.security.UserUtils; public class BgpCfgController extends BaseController{ @RequestMapping(value = {"bgpList"}) - @RequiresPermissions(value={"other:bgp:config"}) +// @RequiresPermissions(value={"other:bgp:config"}) public String httpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg ,HttpServletRequest request,HttpServletResponse response ,RedirectAttributes redirectAttributes) { diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java index 2f47668f0..5c2e21554 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java @@ -47,7 +47,7 @@ import com.nis.web.security.UserUtils; @RequestMapping("${adminPath}/ntc/fileTransfer/") public class FileTransferCfgController extends BaseController{ @RequestMapping(value = {"ftpList"}) - @RequiresPermissions(value={"fileTransfer:ftp:config"}) +// @RequiresPermissions(value={"fileTransfer:ftp:config"}) public String ftpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { Page searchPage=new Page(request,response,"a"); Page page = fileTransferCfgService.getFtpList(searchPage, cfg); @@ -131,7 +131,7 @@ public class FileTransferCfgController extends BaseController{ } @RequestMapping(value = {"fileDigestList"}) - @RequiresPermissions(value={"fileTransfer:fileDigest:config"}) +// @RequiresPermissions(value={"fileTransfer:fileDigest:config"}) public String fileDigestList(Model model,@ModelAttribute("cfg")FileDigestCfg cfg ,HttpServletRequest request,HttpServletResponse response ,RedirectAttributes redirectAttributes) { diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java index bc257553d..75e35434a 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java @@ -45,7 +45,7 @@ import com.nis.web.security.UserUtils; @RequestMapping("${adminPath}/ntc/mail/") public class MailCfgController extends BaseController{ @RequestMapping(value = {"mailList"}) - @RequiresPermissions(value={"mail:config"}) +// @RequiresPermissions(value={"mail:config"}) public String mailList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { Page searchPage=new Page(request,response,"a"); Page page = mailCfgService.getMailList(searchPage, cfg); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java index 39db242b5..670e9c05b 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java @@ -48,7 +48,7 @@ import com.nis.web.security.UserUtils; public class WebsiteController extends BaseController{ @RequestMapping(value = {"httpList"}) - @RequiresPermissions(value={"website:http:config"}) +// @RequiresPermissions(value={"website:http:config"}) public String httpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { Page searchPage=new Page(request,response,"a"); Page page = websiteCfgService.getWebsiteList(searchPage, cfg); @@ -57,7 +57,7 @@ public class WebsiteController extends BaseController{ return "/cfg/website/httpList"; } @RequestMapping(value = {"dnsList"}) - @RequiresPermissions(value={"website:dns:config"}) +// @RequiresPermissions(value={"website:dns:config"}) public String dnsList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { Page searchPage=new Page(request,response,"a"); Page page = websiteCfgService.getWebsiteList(searchPage, cfg); @@ -207,7 +207,7 @@ public class WebsiteController extends BaseController{ return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+functionId; } @RequestMapping(value = {"sslList"}) - @RequiresPermissions(value={"website:ssl:config"}) +// @RequiresPermissions(value={"website:ssl:config"}) public String sslList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { Page searchPage=new Page(request,response,"a"); Page page = websiteCfgService.getWebsiteList(searchPage, cfg); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java index 65698ce81..6bf85fdf8 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java @@ -14,6 +14,9 @@ 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.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; @@ -22,7 +25,7 @@ import com.nis.domain.configuration.HttpUrlCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; -import com.nis.web.controller.BaseController; +import com.nis.web.controller.configuration.CommonController; /** * 白名单 @@ -31,9 +34,9 @@ import com.nis.web.controller.BaseController; */ @Controller @RequestMapping("${adminPath}/ntc/whitelist") -public class WhiteListController extends BaseController{ +public class WhiteListController extends CommonController{ - @RequestMapping(value = {"ipList"}) + @RequestMapping(value = {"ip/list"}) @RequiresPermissions(value={"whitelist:ip:config","whitelist:ip:audit"},logical=Logical.OR) public String ipList(Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) { cfg.setTableName(IpPortCfg.getTablename()); @@ -43,7 +46,7 @@ public class WhiteListController extends BaseController{ initPageCondition(model,cfg); return "/cfg/whitelist/ipList"; } - @RequestMapping(value = {"domainList"}) + @RequestMapping(value = {"domain/list"}) @RequiresPermissions(value={"whitelist:domain:config","whitelist:domain:audit"},logical=Logical.OR) public String domainList(Model model,@ModelAttribute("cfg")HttpUrlCfg cfg,HttpServletRequest request,HttpServletResponse response) { cfg.setTableName(HttpUrlCfg.getTablename()); @@ -53,7 +56,7 @@ public class WhiteListController extends BaseController{ initPageCondition(model,cfg); return "/cfg/whitelist/domainList"; } - @RequestMapping(value = {"ipForm"}) + @RequestMapping(value = {"ip/form"}) @RequiresPermissions(value={"whitelist:ip:config"}) public String ipForm(Model model,String ids,BaseIpCfg entity) { if(StringUtils.isNotBlank(ids)){ @@ -72,7 +75,7 @@ public class WhiteListController extends BaseController{ return "/cfg/whitelist/ipForm"; } - @RequestMapping(value = {"domainForm"}) + @RequestMapping(value = {"domain/form"}) @RequiresPermissions(value={"whitelist:domain:config"}) public String domainForm(Model model,String ids,HttpUrlCfg entity) { if(StringUtils.isNotBlank(ids)){ @@ -90,7 +93,7 @@ public class WhiteListController extends BaseController{ return "/cfg/whitelist/domainForm"; } - @RequestMapping(value = {"saveOrUpdateIp"}) + @RequestMapping(value = {"ip/saveOrUpdate"}) public String saveOrUpdateIp(RedirectAttributes model, IpPortCfg cfg) { cfg.setTableName(IpPortCfg.getTablename()); logger.info("saveOrUpdateIp loaded"); @@ -112,9 +115,9 @@ public class WhiteListController extends BaseController{ logger.error("保存失败",e); addMessage(model,"save_failed"); } - return "redirect:" + adminPath +"/ntc/whitelist/ipList?functionId="+cfg.getFunctionId(); + return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId(); } - @RequestMapping(value = {"saveOrUpdateDomain"}) + @RequestMapping(value = {"domain/saveOrUpdate"}) public String saveOrUpdateDomain(RedirectAttributes model, HttpUrlCfg cfg) { cfg.setTableName(HttpUrlCfg.getTablename()); logger.info("saveOrUpdateIp loaded"); @@ -136,10 +139,10 @@ public class WhiteListController extends BaseController{ logger.error("保存失败",e); addMessage(model,"save_failed"); } - return "redirect:" + adminPath +"/ntc/whitelist/domainList?functionId="+cfg.getFunctionId(); + return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+cfg.getFunctionId(); } - @RequestMapping(value = {"deleteIp"}) + @RequestMapping(value = {"ip/delete"}) @RequiresPermissions("whitelist:ip:config") public String deleteIp(String ids,Integer functionId,RedirectAttributes model) { try{ @@ -149,9 +152,9 @@ public class WhiteListController extends BaseController{ logger.error("删除失败", e); addMessage(model,"delete_failed"); } - return "redirect:" + adminPath +"/ntc/whitelist/ipList?functionId="+functionId; + return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+functionId; } - @RequestMapping(value = {"deleteDomain"}) + @RequestMapping(value = {"domain/delete"}) @RequiresPermissions("whitelist:domain:config") public String deleteDomain(String ids,Integer functionId,RedirectAttributes model) { try{ @@ -161,10 +164,10 @@ public class WhiteListController extends BaseController{ logger.error("删除失败", e); addMessage(model,"delete_failed"); } - return "redirect:" + adminPath +"/ntc/whitelist/domainList?functionId="+functionId; + return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+functionId; } - @RequestMapping(value = {"auditIp"}) - @RequiresPermissions("whitelist:ip:aduit") + @RequestMapping(value = {"ip/audit"}) + @RequiresPermissions("whitelist:ip:audit") public String auditIp(String ids,IpPortCfg cfg,RedirectAttributes redirectAttributes) { try{ for(String id:ids.split(",")){ @@ -183,15 +186,15 @@ public class WhiteListController extends BaseController{ addMessage(redirectAttributes,"audit_success"); }catch(MaatConvertException e){ logger.error("审核失败", e); - addMessage(redirectAttributes, e.getPrefix()+e.getResult().getReason()); + addMessage(redirectAttributes, e.getMessage()); }catch(Exception e){ logger.error("审核失败", e); addMessage(redirectAttributes, "audit_failed"); } - return "redirect:" + adminPath +"/ntc/whitelist/ipList?functionId="+cfg.getFunctionId(); + return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId(); } - @RequestMapping(value = {"auditDomain"}) - @RequiresPermissions("whitelist:domain:aduit") + @RequestMapping(value = {"domain/audit"}) + @RequiresPermissions("whitelist:domain:audit") public String auditDomain(String ids,HttpUrlCfg cfg,RedirectAttributes redirectAttributes) { try{ List beans=domainService.getListByCfgId(ids); @@ -209,11 +212,30 @@ public class WhiteListController extends BaseController{ addMessage(redirectAttributes,"audit_success"); }catch(MaatConvertException e){ logger.error("审核失败", e); - addMessage(redirectAttributes, e.getPrefix()+e.getResult().getReason()); + addMessage(redirectAttributes, e.getMessage()); }catch(Exception e){ logger.error("审核失败", e); addMessage(redirectAttributes, "audit_failed"); } - return "redirect:" + adminPath +"/ntc/whitelist/domainList?functionId="+cfg.getFunctionId(); + return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+cfg.getFunctionId(); + } + //ip配置导入 + @RequestMapping(value = "ip/import", method=RequestMethod.POST) + public String importIp(String cfgName,RedirectAttributes redirectAttributes, + @RequestParam("file") MultipartFile file,IpPortCfg cfg) { + this._importIp(cfgName,redirectAttributes, file,cfg); + return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId(); + } + //ip模板下载 + @RequestMapping(value = "ip/import/template") + public void importFileTemplate(HttpServletRequest request,HttpServletResponse response, + RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) { + this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode); + } + //ip配置导出 + @RequestMapping(value = "ip/export") + public void exportIp(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){ + this._exportIp(model, request, response, entity, ids, redirectAttributes); } } diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java index 5f183849d..3fd5505bb 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java @@ -8,7 +8,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; -import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -17,18 +16,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; -import com.nis.domain.configuration.AreaIpCfg; -import com.nis.domain.configuration.BaseIpCfg; -import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.HttpBodyCfg; import com.nis.domain.configuration.HttpReqHeadCfg; import com.nis.domain.configuration.HttpResHeadCfg; import com.nis.domain.configuration.HttpUrlCfg; -import com.nis.domain.configuration.IpPortCfg; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; -import com.nis.util.StringUtil; import com.nis.web.controller.BaseController; import com.nis.web.security.UserUtils; diff --git a/src/main/java/com/nis/web/controller/report/ReportController.java b/src/main/java/com/nis/web/controller/report/ReportController.java new file mode 100644 index 000000000..53728d4ee --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/ReportController.java @@ -0,0 +1,22 @@ +package com.nis.web.controller.report; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +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 com.nis.domain.log.SearchReport; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report") +public class ReportController extends BaseController { + @RequestMapping("/list") + public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + initReportCondition(model, bean); + return "/report/list"; + } +} diff --git a/src/main/java/com/nis/web/controller/report/TestBean.java b/src/main/java/com/nis/web/controller/report/TestBean.java new file mode 100644 index 000000000..740735fbc --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/TestBean.java @@ -0,0 +1,29 @@ +/** + *@Title: TestBean.java + *@Package com.nis.web.controller.report + *@Description TODO + *@author dell + *@date 2018年7月6日 上午9:20:48 + *@version 版本号 + */ +package com.nis.web.controller.report; + +import com.nis.domain.log.BaseReportLog; + +/** + * @ClassName: TestBean.java + * @Description: TODO + * @author (dell) + * @date 2018年7月6日 上午9:20:48 + * @version V1.0 + */ +public class TestBean extends BaseReportLog { + + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = -8794587413327741665L; +} diff --git a/src/main/java/com/nis/web/controller/report/TestController.java b/src/main/java/com/nis/web/controller/report/TestController.java new file mode 100644 index 000000000..840fd95d3 --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/TestController.java @@ -0,0 +1,32 @@ +package com.nis.web.controller.report; + +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +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 com.nis.domain.Page; +import com.nis.domain.log.SearchReport; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report/test") +public class TestController extends BaseController { + + @RequestMapping("list") + public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + Page page=new Page(request, response); + List list=new ArrayList<>(); + list.add(new TestBean()); + page.setList(list); + model.addAttribute("page", page); + model.addAttribute("bean", bean); + return "/report/test"; + } +} diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java index 317336b02..f6b5214c5 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java @@ -18,6 +18,7 @@ import com.nis.domain.configuration.AppStringCfg; import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.ComplexkeywordCfg; +import com.nis.domain.configuration.IpPortCfg; import com.nis.web.dao.CrudDao; import com.nis.web.dao.MyBatisDao; @@ -32,8 +33,13 @@ public interface AppCfgDao { //app策略配置增删改查 public List findAppPolicyList(AppPolicyCfg entity) ; public AppPolicyCfg getAppPolicyCfg(Long cfgId) ; + public IpPortCfg getAppPolicyIpCfg(AppPolicyCfg entity) ; + public List getAppPolicyIpList(AppPolicyCfg entity); public int insertAppPolicyCfg(AppPolicyCfg entity); public int updateAppPolicyCfg(AppPolicyCfg entity); + public int insertAppPolicyIpCfg(IpPortCfg entity); + public int deleteAppPolicyIpCfg(AppPolicyCfg entity); + //app协议IP配置增删改查 public List findAppIpList(AppIpCfg entity) ; public AppIpCfg getAppIpCfg(Long cfgId) ; diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index 28f60c301..9c6f412e7 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -189,6 +189,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,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, @@ -248,6 +283,15 @@ #{areaEffectiveIds,jdbcType=VARCHAR},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER}, #{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER} + + + a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port + ,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address + ,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 + + + + SELECT LAST_INSERT_ID() + + insert into ip_port_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 + )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} + ) + + update app_policy_cfg @@ -1525,4 +1659,15 @@ + + + + delete from ip_port_cfg where compile_id=#{compileId} and protocol_id=21 and function_id=#{functionId} + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml index 6e98444f6..b5b9e3a01 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml @@ -37,6 +37,11 @@ + + + + + @@ -50,14 +55,14 @@ DIRECTION,PROTOCOL,PROTOCOL_ID,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,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE,USER_REGION1,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5 CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT, DIRECTION,PROTOCOL,PROTOCOL_ID,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,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE,USER_REGION1,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5 @@ -68,7 +73,12 @@ ${page.alias}.CREATOR_ID as creatorId,${page.alias}.CREATE_TIME AS createTime,${page.alias}.EDITOR_ID as editorId,${page.alias}.EDIT_TIME AS editTime,${page.alias}.AUDITOR_ID as auditorId,${page.alias}.AUDIT_TIME AS auditTime, ${page.alias}.SERVICE_ID as serviceId,${page.alias}.REQUEST_ID AS requestId,${page.alias}.COMPILE_ID AS compileId,${page.alias}.IS_AREA_EFFECTIVE as isAreaEffective,${page.alias}.classify, ${page.alias}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds,${page.alias}.FUNCTION_ID AS functionId,${page.alias}.RATELIMIT AS ratelimit, - ${page.alias}.DNS_STRATEGY_ID AS dnsStrategyId,${page.alias}.IR_TYPE AS irType + ${page.alias}.DNS_STRATEGY_ID AS dnsStrategyId,${page.alias}.IR_TYPE AS irType, + ${page.alias}.USER_REGION1 AS userRegion1, + ${page.alias}.USER_REGION2 AS userRegion2, + ${page.alias}.USER_REGION3 AS userRegion3, + ${page.alias}.USER_REGION4 AS userRegion4, + ${page.alias}.USER_REGION5 AS userRegion5 r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType, @@ -77,7 +87,12 @@ r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime, r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify, r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID as functionId,r.RATELIMIT AS ratelimit, - r.DNS_STRATEGY_ID AS dnsStrategyId,r.IR_TYPE AS irType + r.DNS_STRATEGY_ID AS dnsStrategyId,r.IR_TYPE AS irType, + r.USER_REGION1 AS userRegion1, + r.USER_REGION2 AS userRegion2, + r.USER_REGION3 AS userRegion3, + r.USER_REGION4 AS userRegion4, + r.USER_REGION5 AS userRegion5 @@ -92,7 +107,7 @@ REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE, CLASSIFY,ATTRIBUTE,LABLE, AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT, - DNS_STRATEGY_ID,IR_TYPE + DNS_STRATEGY_ID,IR_TYPE,USER_REGION1,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5 #{cfgDesc,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},#{cfgType,jdbcType=VARCHAR}, @@ -105,7 +120,12 @@ #{requestId,jdbcType=INTEGER},#{compileId,jdbcType=INTEGER},#{isAreaEffective,jdbcType=INTEGER}, #{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR}, #{areaEffectiveIds,jdbcType=VARCHAR}, #{functionId,jdbcType=INTEGER}, #{ratelimit,jdbcType=INTEGER}, - #{dnsStrategyId,jdbcType=INTEGER},#{irType,jdbcType=INTEGER} + #{dnsStrategyId,jdbcType=INTEGER},#{irType,jdbcType=INTEGER}, + #{userRegion1,jdbcType=VARCHAR}, + #{userRegion2,jdbcType=VARCHAR}, + #{userRegion3,jdbcType=VARCHAR}, + #{userRegion4,jdbcType=VARCHAR}, + #{userRegion5,jdbcType=VARCHAR} - - - - - - -
-
-
-
- -
- -
-
-
-
- -
-
- -
- -
-
-
-
-
-
-
- -
- - - -
-
-
-
-
-
- -
- -
-
-
-
-
+ + + + + + +
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+ +

+ + + +

+ + + + + +
+ <%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%> +
+ +
+
+
+ + + + +
+
+
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %> <%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp index 3874b5b0d..795f36c5c 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp @@ -32,6 +32,51 @@ $("#level").attr("value",''); $("#searchForm")[0].reset(); }); + //异步获取策略ip相关信息 + $("span[id^=open]").click(function(){ + var openId=$(this).attr("id"); + var closeId=$(this).attr("id").replace("open","close"); + var index=$(this).attr("id").replace("open",""); + $("#"+openId).hide(); + $("#"+closeId).show(); + //var compileId=$(this).attr("compileId"); + var cfgId=$(this).attr("cfgId"); + if($("#"+openId).parent().parent().next("tr").hasClass("child")){ + $("#"+openId).parent().parent().next("tr").show(); + }else{ + $.ajax({ + type:'post', + async:false, + url:'${ctx}/app/ajaxAppPolicyIpList', + data:{"cfgId":cfgId,"index":index}, + dataType:"html", + success:function(data){ + var subTab=""+ + ""+ + ""+ + ""+ + ""; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+=""; + subTab+=""; + $("#"+openId).parent().parent().after(subTab); + $("div[name='tabTitle"+index+"']").get(0).click(); + } + }); + } + + }); + + $("span[id^=close]").on("click",function(){ + var closeId=$(this).attr("id"); + var openId=$(this).attr("id").replace("close","open"); + $("#"+closeId).hide(); + $("#"+openId).show(); + $("#"+closeId).parent().parent().next("tr").hide(); + }); }); @@ -287,6 +332,7 @@ + ${cfg.cfgDesc } diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyIpList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyIpList.jsp new file mode 100644 index 000000000..8bb0252d2 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyIpList.jsp @@ -0,0 +1,130 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + +
+ + +
+
+
+
+
+
+ +
+
+
+
+ + + +
+ + +
+
+ + + + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/common/domainList.jsp b/src/main/webapp/WEB-INF/views/cfg/common/domainList.jsp index 92dff7c9b..682e6d67d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/common/domainList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/common/domainList.jsp @@ -123,7 +123,7 @@ - +
+ +
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %> <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> diff --git a/src/main/webapp/WEB-INF/views/cfg/common/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/common/ipList.jsp index ad242fa17..33370a4fd 100644 --- a/src/main/webapp/WEB-INF/views/cfg/common/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/common/ipList.jsp @@ -50,20 +50,6 @@ <%@include file="/WEB-INF/include/excel/importIp.jsp" %> - @@ -101,7 +101,7 @@ diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/list.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/list.jsp index e2d89e8f3..eead892ee 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/list.jsp @@ -109,6 +109,7 @@
+
+
href="javascript:;"> diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectForm.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectForm.jsp index 37ff10beb..4920a0f70 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectForm.jsp @@ -55,6 +55,15 @@ } }); + $("select[name='userRegion1']").on("change",function(){ + var code = $(this).val(); + if(code.indexOf("30")==0){//以30开头的应答码需要输入URL地址 + $("input[name='userRegion2']").addClass("url"); + }else{ + $("input[name='userRegion2']").removeClass("url"); + } + }); + $("#cfgFrom").validate( { errorPlacement : function(error, element) { @@ -68,8 +77,8 @@ } }, submitHandler : function(form) { - loading('onloading...'); var flag = true; + //代表所有业务都隐藏了,提示必须增加一种业务数据 if(!$(".httpReqCfg").hasClass("hidden")){ if($(".httpReqCfg").find(".boxSolid").length==$(".httpReqCfg").find(".boxSolid.hidden").length){ @@ -99,13 +108,15 @@ flag = false; return; } - }) + }); + if(flag){ //将disable属性的元素删除 $(".disabled").each(function(){ $(this).remove(); }); $("input[name$='exprType']").attr("disabled",false); + loading('onloading...'); form.submit(); } @@ -201,7 +212,7 @@
-
@@ -233,6 +244,34 @@ +
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp index b4c4b5cfe..b2febeaf8 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp @@ -464,6 +464,8 @@ + + @@ -495,6 +497,14 @@ + + + + + + + + ${indexCfg.userRegion2 } diff --git a/src/main/webapp/WEB-INF/views/cfg/stringCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/stringCfgForm.jsp index e0cf27e92..c2980bef4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/stringCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/stringCfgForm.jsp @@ -68,7 +68,7 @@ $(function(){ @@ -85,7 +85,7 @@ $(function(){ diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp index 2b1a2039a..f836fe2bb 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp @@ -2,7 +2,7 @@ <%@ include file="/WEB-INF/include/taglib.jsp"%> -<spring:message code="${cfgName}"></spring:message> +<spring:message code="domain_control_white"></spring:message> @@ -55,7 +42,7 @@ <%-- --%> @@ -71,7 +58,7 @@
- + @@ -114,8 +101,8 @@
- - + + @@ -126,9 +113,9 @@
diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp index 9ba2db414..516e7759f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp @@ -81,7 +81,7 @@ $(function(){
-
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp index d667956a8..388eff2b6 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp @@ -43,13 +43,30 @@
+ + + <%@include file="/WEB-INF/include/excel/importIp.jsp" %> +

@@ -62,7 +79,7 @@
- + @@ -106,8 +123,9 @@
- - + + +
@@ -116,9 +134,9 @@
diff --git a/src/main/webapp/WEB-INF/views/report/attrType.jsp b/src/main/webapp/WEB-INF/views/report/attrType.jsp new file mode 100644 index 000000000..015959889 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/attrType.jsp @@ -0,0 +1,42 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
性质总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点
+
${page}
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/destIp.jsp b/src/main/webapp/WEB-INF/views/report/destIp.jsp new file mode 100644 index 000000000..e65b43edc --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/destIp.jsp @@ -0,0 +1,42 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
所属国家总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点
+
${page}
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/entranceId.jsp b/src/main/webapp/WEB-INF/views/report/entranceId.jsp new file mode 100644 index 000000000..e6b77f476 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/entranceId.jsp @@ -0,0 +1,42 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
局点总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点
+
${page}
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/label.jsp b/src/main/webapp/WEB-INF/views/report/label.jsp new file mode 100644 index 000000000..7d2cca059 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/label.jsp @@ -0,0 +1,42 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
标签总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点
+
${page}
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp new file mode 100644 index 000000000..73b10b86f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -0,0 +1,138 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${bean.cfgName}"></spring:message> + + + +
+ +

+ + +

+ +
+
+
+
+
+ + + + + + +
+
+ + + + + + + + + + +
+
+
+ + + +
+
+
+ + + + +
+ +
+ + + +
+
+ +
+
+ +
+ +
+
+
+ <%@include file="/WEB-INF/views/report/label.jsp" %> + <%@include file="/WEB-INF/views/report/attrType.jsp" %> + <%@include file="/WEB-INF/views/report/lwhh.jsp" %> + <%@include file="/WEB-INF/views/report/srcIp.jsp" %> + <%@include file="/WEB-INF/views/report/destIp.jsp" %> + <%@include file="/WEB-INF/views/report/entranceId.jsp" %> +
+
+ +
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/lwhh.jsp b/src/main/webapp/WEB-INF/views/report/lwhh.jsp new file mode 100644 index 000000000..1d2a8b5f8 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/lwhh.jsp @@ -0,0 +1,42 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
性质总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点
+
${page}
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/srcIp.jsp b/src/main/webapp/WEB-INF/views/report/srcIp.jsp new file mode 100644 index 000000000..63cc402ae --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/srcIp.jsp @@ -0,0 +1,43 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
所属省所属市总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点
+
${page}
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/test.jsp b/src/main/webapp/WEB-INF/views/report/test.jsp new file mode 100644 index 000000000..366b517de --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/test.jsp @@ -0,0 +1,128 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${bean.cfgName}"></spring:message> + + + +
+ +

+ + +

+ +
+
+
+
+
+ + + + + + + + + +
+
+ + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ + + + +
+ +
+ + + +
+
+ +
+
+ +
+ +
+ +
+ <%@include file="/WEB-INF/views/report/label.jsp" %> + <%@include file="/WEB-INF/views/report/attrType.jsp" %> + <%@include file="/WEB-INF/views/report/lwhh.jsp" %> + <%@include file="/WEB-INF/views/report/srcIp.jsp" %> + <%@include file="/WEB-INF/views/report/destIp.jsp" %> + <%@include file="/WEB-INF/views/report/entranceId.jsp" %> +
+
+ +
+
+
+ + \ No newline at end of file