From 170e0ef1c5bfed88447ee22ba2bf6a60a9f14be8 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Wed, 16 Jan 2019 16:45:44 +0800 Subject: [PATCH 1/8] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9Stream=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=AF=BC=E5=85=A5=E9=A1=B5action=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=EF=BC=9B2.=E4=BF=AE=E6=94=B9IP=20Spoofing=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/util/excel/ExportExcel.java | 2 + .../nis/web/controller/BaseController.java | 74 +----------- .../java/com/nis/web/service/BaseService.java | 108 ++++++++++++++++++ .../PxyObjSpoofingIpPoolService.java | 24 ---- .../WEB-INF/include/excel/importModal.jsp | 14 ++- 5 files changed, 125 insertions(+), 97 deletions(-) diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index b42ab7a7a..f37273b7a 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -566,6 +566,8 @@ public class ExportExcel { //1、非空 commentStr=commentStr+"▶"+msgProp.getProperty("required")+"\n"; index++; + commentStr=commentStr+"▶"+msgProp.getProperty("ip_check")+"(IPv4)\n"; + index++; } if(region.getRegionType().equals(1)){//IP配置 diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 54c3a024f..ac186ccd0 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -1,7 +1,6 @@ package com.nis.web.controller; import java.beans.PropertyEditorSupport; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.net.URLEncoder; import java.text.ParseException; @@ -73,7 +72,6 @@ import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.configuration.FileDigestCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.PxyObjKeyring; -import com.nis.domain.configuration.PxyObjSpoofingIpPool; import com.nis.domain.configuration.PxyObjTrustedCaCert; import com.nis.domain.configuration.PxyObjTrustedCaCrl; import com.nis.domain.configuration.RequestInfo; @@ -120,10 +118,8 @@ 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.domain.report.NtcPzReport; import com.nis.domain.maat.ToMaatBean; -import com.nis.domain.maat.ToMaatResult; -import com.nis.domain.specific.ConfigGroupInfo; +import com.nis.domain.report.NtcPzReport; import com.nis.domain.specific.SpecificServiceCfg; import com.nis.exceptions.MaatConvertException; //import com.nis.util.AsnCacheUtils; @@ -145,7 +141,6 @@ import com.nis.util.excel.thread.CheckDnsResStrategyFormatThread; import com.nis.util.excel.thread.CheckIpFormatThread; import com.nis.util.excel.thread.CheckStringFormatThread; import com.nis.util.excel.thread.CheckTopicWebsiteFormatThread; -import com.nis.web.dao.configuration.PxyObjSpoofingIpPoolDao; import com.nis.web.security.UserUtils; import com.nis.web.service.ArchiveServcie; import com.nis.web.service.AreaService; @@ -155,7 +150,6 @@ import com.nis.web.service.LogService; import com.nis.web.service.MenuService; import com.nis.web.service.OfficeService; import com.nis.web.service.RoleService; -import com.nis.web.service.SpringContextHolder; import com.nis.web.service.SystemService; import com.nis.web.service.UserService; import com.nis.web.service.basics.AsnGroupInfoService; @@ -1640,17 +1634,12 @@ public class BaseController { while(!ipPortCfgs.isEmpty()) { ipPortCfgs.drainTo(_ipPortCfgs, Constants.MAAT_JSON_SEND_SIZE); List compileIds=Lists.newArrayList(); - List spoofingPoolIds=Lists.newArrayList(); List regionIds=Lists.newArrayList(); List groupIds=Lists.newArrayList(); List numRegionGroupIds=Lists.newArrayList(); List numRegionRegionIds=Lists.newArrayList(); - List spoofingPools = new ArrayList(); - PxyObjSpoofingIpPoolDao pxyObjSpoofingIpPoolDao = SpringContextHolder.getBean(PxyObjSpoofingIpPoolDao.class); - PxyObjSpoofingIpPoolService pxyObjSpoofingIpPoolService = SpringContextHolder.getBean(PxyObjSpoofingIpPoolService.class); try { compileIds = ConfigServiceUtil.getId(1,_ipPortCfgs.size()); - spoofingPoolIds = ConfigServiceUtil.getId(1,_ipPortCfgs.size()); if(isSend.equals("1")) { groupIds = ConfigServiceUtil.getId(2,_ipPortCfgs.size()); regionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size()); @@ -1707,67 +1696,8 @@ public class BaseController { if(compileIds.size()==_ipPortCfgs.size()) { cfg.setCompileId(compileIds.get(ind)); } - - // 保存IP仿冒池 - PxyObjSpoofingIpPool spoofingPool = new PxyObjSpoofingIpPool(); - spoofingPool.setIpType(4);//ipv4 - spoofingPool.setIpAddress(cfg.getUserRegion2());//仿冒IP - spoofingPool.setProtocol(0); - if("dnat".equals(cfg.getUserRegion1().toLowerCase())){//spoofing server ip->dnat - spoofingPool.setDirection(1); - }else{ - spoofingPool.setDirection(2);//spoofing client ip->snat - } - spoofingPool.setPort("0"); - spoofingPool.setUserRegion("0"); - spoofingPool.setLocation(0); - spoofingPool.setServiceId(642); - spoofingPool.setAreaEffectiveIds("0"); - spoofingPool.setIsAreaEffective(0); - spoofingPool.setCreateTime(date); - spoofingPool.setCreatorId(UserUtils.getUser().getId()); - if(spoofingPoolIds.size()==_ipPortCfgs.size()) { - spoofingPool.setCompileId(spoofingPoolIds.get(ind)); - } - spoofingPool.setAction(1); - spoofingPool.setFunctionId(666); - spoofingPool.setRequestId(0); - if(isSend.equals("1")) { - spoofingPool.setIsAudit(Constants.AUDIT_YES); - spoofingPool.setIsValid(Constants.VALID_YES); - spoofingPool.setAuditorId(UserUtils.getUser().getId()); - spoofingPool.setAuditTime(date); - - }else { - spoofingPool.setIsValid(Constants.VALID_NO); - spoofingPool.setIsAudit(Constants.AUDIT_NOT_YET); - - } - pxyObjSpoofingIpPoolDao.insert(spoofingPool);//保存仿冒IP池配置 - cfg.setUserRegion3(String.valueOf(spoofingPool.getCfgId()));//将仿冒IP池配置ID作为策略组ID - - if(isSend.equals("1")) { - PxyObjSpoofingIpPool pool=new PxyObjSpoofingIpPool(); - pool.setCfgId(Long.valueOf(cfg.getUserRegion3())); - pool.setIsValid(cfg.getIsValid()); - pool.setIsAudit(cfg.getIsAudit()); - pool.setAuditorId(UserUtils.getUser().getId()); - pool.setAuditTime(date); - pxyObjSpoofingIpPoolDao.update(pool); - - spoofingPool.setAreaEffectiveIds("0"); - spoofingPool.setGroupId(spoofingPool.getCfgId().intValue()); - spoofingPools.add(spoofingPool); - } - - CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); - BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"}); - cfgIndexInfos.add(cfgIndexInfo); - ind++; - } - if(isSend.equals("1") && spoofingPools.size()>0) { - pxyObjSpoofingIpPoolService.auditSpoofingPool(spoofingPools); + } ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _ipPortCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,asnNoMaps,isSend.equals("1")); cfgIndexInfos.clear(); diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index ce2d81f55..cad6976c5 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -71,6 +71,7 @@ import com.nis.domain.configuration.FileDigestCfg; import com.nis.domain.configuration.IpReusePolicyCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.configuration.PxyObjKeyring; +import com.nis.domain.configuration.PxyObjSpoofingIpPool; import com.nis.domain.configuration.PxyObjTrustedCaCert; import com.nis.domain.configuration.PxyObjTrustedCaCrl; import com.nis.domain.configuration.WebsiteDomainTopic; @@ -86,6 +87,7 @@ import com.nis.domain.maat.ToMaatBean; import com.nis.domain.maat.ToMaatResult; import com.nis.domain.specific.ConfigGroupInfo; import com.nis.domain.specific.SpecificServiceCfg; +import com.nis.exceptions.MaatConvertException; //import com.nis.util.AsnCacheUtils; import com.nis.util.ConfigServiceUtil; import com.nis.util.Configurations; @@ -103,6 +105,7 @@ import com.nis.web.dao.configuration.DdosCfgDao; import com.nis.web.dao.configuration.DnsIpCfgDao; import com.nis.web.dao.configuration.DnsResStrategyDao; import com.nis.web.dao.configuration.IpCfgDao; +import com.nis.web.dao.configuration.PxyObjSpoofingIpPoolDao; import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.dao.specific.ConfigGroupInfoDao; import com.nis.web.dao.specific.SpecificServiceCfgDao; @@ -1671,6 +1674,10 @@ public abstract class BaseService { }else if(list.get(0) instanceof AppTopicDomainCfg) { type="AppTopicDomain"; } + + if(regionDict.getFunctionId().equals(214)) { // 处理IpSpoofing配置导入 + this.saveAndSendSpoofingIpPool(list,cfgIndexInfos,send); + } if (cfgIndexInfos != null && cfgIndexInfos.size() > 0) { this.saveCfgIndexOf(cfgIndexInfos); } @@ -3128,5 +3135,106 @@ public abstract class BaseService { return commonGroupList; } + /** + * 处理IpSpoofing配置导入 + * @param list + * @param cfgIndexInfos + * @param send + */ + public void saveAndSendSpoofingIpPool(List list, List cfgIndexInfos, boolean send) { + List ipCfgList = (List)list; + List spoofingPoolIds=Lists.newArrayList(); + List spoofingPools = new ArrayList(); + PxyObjSpoofingIpPoolDao pxyObjSpoofingIpPoolDao = SpringContextHolder.getBean(PxyObjSpoofingIpPoolDao.class); + + try { + spoofingPoolIds = ConfigServiceUtil.getId(1,ipCfgList.size()); + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + int index = 0; + for (BaseIpCfg cfg : ipCfgList) { + // 保存IP仿冒池 + PxyObjSpoofingIpPool spoofingPool = new PxyObjSpoofingIpPool(); + spoofingPool.setIpType(4);//ipv4 + spoofingPool.setIpAddress(cfg.getUserRegion2());//仿冒IP + spoofingPool.setProtocol(0); + if("dnat".equals(cfg.getUserRegion1().toLowerCase())){//spoofing server ip->dnat + spoofingPool.setDirection(1); + }else{ + spoofingPool.setDirection(2);//spoofing client ip->snat + } + spoofingPool.setPort("0"); + spoofingPool.setUserRegion("0"); + spoofingPool.setLocation(0); + spoofingPool.setServiceId(642); + spoofingPool.setAreaEffectiveIds("0"); + spoofingPool.setIsAreaEffective(0); + spoofingPool.setCreateTime(cfg.getCreateTime()); + spoofingPool.setCreatorId(UserUtils.getUser().getId()); + if(spoofingPoolIds.size() == ipCfgList.size()) { + spoofingPool.setCompileId(spoofingPoolIds.get(index)); + } + spoofingPool.setAction(1); + spoofingPool.setFunctionId(666); + spoofingPool.setRequestId(0); + if(send) { + spoofingPool.setIsAudit(Constants.AUDIT_YES); + spoofingPool.setIsValid(Constants.VALID_YES); + spoofingPool.setAuditorId(UserUtils.getUser().getId()); + spoofingPool.setAuditTime(cfg.getAuditTime()); + + }else { + spoofingPool.setIsValid(Constants.VALID_NO); + spoofingPool.setIsAudit(Constants.AUDIT_NOT_YET); + + } + pxyObjSpoofingIpPoolDao.insert(spoofingPool);//保存仿冒IP池配置 + cfg.setUserRegion3(String.valueOf(spoofingPool.getCfgId()));//将仿冒IP池配置ID作为策略组ID + + if(send) { + PxyObjSpoofingIpPool pool=new PxyObjSpoofingIpPool(); + pool.setCfgId(Long.valueOf(cfg.getUserRegion3())); + pool.setIsValid(cfg.getIsValid()); + pool.setIsAudit(cfg.getIsAudit()); + pool.setAuditorId(UserUtils.getUser().getId()); + pool.setAuditTime(cfg.getAuditTime()); + pxyObjSpoofingIpPoolDao.update(pool); + + spoofingPool.setAreaEffectiveIds("0"); + spoofingPool.setGroupId(spoofingPool.getCfgId().intValue()); + spoofingPools.add(spoofingPool); + } + + CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); + BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"}); + cfgIndexInfos.add(cfgIndexInfo); + + index ++; + } + + if(send && spoofingPools.size()>0) { + //调用服务接口下发配置数据 + String json=gsonToJson(spoofingPools); + if(spoofingPools.size()>10) { + logger.info("欺骗IP池配置下发配置条数:" + spoofingPools.size()); + }else { + logger.info("欺骗IP池配置下发配置参数:" + json); + } + //调用服务接口下发配置 + try { + ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); + if(result!=null){ + logger.info("欺骗IP池配置下发响应信息:"+result.getMsg()); + } + } catch (Exception e) { + logger.error("欺骗IP池配置配置下发失败",e); + throw e; + } + } + } + } diff --git a/src/main/java/com/nis/web/service/configuration/PxyObjSpoofingIpPoolService.java b/src/main/java/com/nis/web/service/configuration/PxyObjSpoofingIpPoolService.java index 1999122fb..d400257ee 100644 --- a/src/main/java/com/nis/web/service/configuration/PxyObjSpoofingIpPoolService.java +++ b/src/main/java/com/nis/web/service/configuration/PxyObjSpoofingIpPoolService.java @@ -270,30 +270,6 @@ public class PxyObjSpoofingIpPoolService extends BaseService{ } - /** - * IP Spoofing配置导入时 下发仿冒IP池配置 - * @param spoofingPools - */ - public void auditSpoofingPool(List spoofingPools) { - //调用服务接口下发配置数据 - String json=gsonToJson(spoofingPools); - if(spoofingPools.size()>10) { - logger.info("欺骗IP池配置下发配置条数:" + spoofingPools.size()); - }else { - logger.info("欺骗IP池配置下发配置参数:" + json); - } - //调用服务接口下发配置 - try { - ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); - if(result!=null){ - logger.info("欺骗IP池配置下发响应信息:"+result.getMsg()); - } - } catch (Exception e) { - logger.error("欺骗IP池配置配置下发失败",e); - throw e; - } - - } } \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/excel/importModal.jsp b/src/main/webapp/WEB-INF/include/excel/importModal.jsp index 0b5db22dc..f47c82e69 100644 --- a/src/main/webapp/WEB-INF/include/excel/importModal.jsp +++ b/src/main/webapp/WEB-INF/include/excel/importModal.jsp @@ -47,6 +47,7 @@ checked> + @@ -58,7 +59,18 @@ - + + + + + + + + + + + + From 7c28a24dd3a18533699c2407b4ea87c17ceb6955 Mon Sep 17 00:00:00 2001 From: wangxin Date: Wed, 16 Jan 2019 17:00:09 +0800 Subject: [PATCH 2/8] =?UTF-8?q?WdataPicker=E5=B1=8F=E8=94=BD=E6=8E=89=20?= =?UTF-8?q?=E5=AE=98=E7=BD=91=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/static/global/plugins/My97DatePicker/WdatePicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/static/global/plugins/My97DatePicker/WdatePicker.js b/src/main/webapp/static/global/plugins/My97DatePicker/WdatePicker.js index 9298422e9..aceaeb91e 100644 --- a/src/main/webapp/static/global/plugins/My97DatePicker/WdatePicker.js +++ b/src/main/webapp/static/global/plugins/My97DatePicker/WdatePicker.js @@ -43,4 +43,4 @@ errDealMode:0, autoPickDate:null, qsEnabled:true, autoShowQS:false, -specialDates:null,specialDays:null,disabledDates:null,disabledDays:null,opposite:false,onpicking:null,onpicked:null,onclearing:null,oncleared:null,ychanging:null,ychanged:null,Mchanging:null,Mchanged:null,dchanging:null,dchanged:null,Hchanging:null,Hchanged:null,mchanging:null,mchanged:null,schanging:null,schanged:null,eCont:null,vel:null,elProp:"",errMsg:"",quickSel:[],has:{},getRealLang:function(){var _=$.$langList;for(var A=0;A<_.length;A++)if(_[A].name==this.lang)return _[A];return _[0]}};WdatePicker=T;var X=window,S={innerHTML:""},M="document",H="documentElement",C="getElementsByTagName",U,A,R,G,a,W=navigator.appName;if(W=="Microsoft Internet Explorer")R=true;else if(W=="Opera")a=true;else G=true;A=J();if($.$wdate)K(A+"skin/WdatePicker.css");U=X;if($.$crossFrame){try{while(U.parent&&U.parent[M]!=U[M]&&U.parent[M][C]("frameset").length==0)U=U.parent}catch(N){}}if(!U.$dp)U.$dp={ff:G,ie:R,opera:a,status:0,defMinDate:$.minDate,defMaxDate:$.maxDate};B();if($.$preLoad&&$dp.status==0)E(X,"onload",function(){T(null,true)});if(!X[M].docMD){E(X[M],"onmousedown",D);X[M].docMD=true}if(!U[M].docMD){E(U[M],"onmousedown",D);U[M].docMD=true}E(X,"onunload",function(){if($dp.dd)O($dp.dd,"none")});function B(){U.$dp=U.$dp||{};obj={$:function($){return(typeof $=="string")?X[M].getElementById($):$},$D:function($,_){return this.$DV(this.$($).value,_)},$DV:function(_,$){if(_!=""){this.dt=$dp.cal.splitDate(_,$dp.cal.dateFmt);if($)for(var B in $)if(this.dt[B]===undefined)this.errMsg="invalid property:"+B;else{this.dt[B]+=$[B];if(B=="M"){var C=$["M"]>0?1:0,A=new Date(this.dt["y"],this.dt["M"],0).getDate();this.dt["d"]=Math.min(A+C,this.dt["d"])}}if(this.dt.refresh())return this.dt}return""},show:function(){var A=U[M].getElementsByTagName("div"),$=100000;for(var B=0;B$)$=_}this.dd.style.zIndex=$+2;O(this.dd,"block")},hide:function(){O(this.dd,"none")},attachEvent:E};for(var $ in obj)U.$dp[$]=obj[$];$dp=U.$dp}function E(A,$,_){if(R)A.attachEvent($,_);else if(_){var B=$.replace(/on/,"");_._ieEmuEventHandler=function($){return _($)};A.addEventListener(B,_._ieEmuEventHandler,false)}}function J(){var _,A,$=X[M][C]("script");for(var B=0;B<$.length;B++){_=$[B].getAttribute("src")||"";_=_.substr(0,_.toLowerCase().indexOf("wdatepicker.js"));A=_.lastIndexOf("/");if(A>0)_=_.substring(0,A+1);if(_)break}return _}function K(A,$,B){var D=X[M][C]("HEAD").item(0),_=X[M].createElement("link");if(D){_.href=A;_.rel="stylesheet";_.type="text/css";if($)_.title=$;if(B)_.charset=B;D.appendChild(_)}}function F($){$=$||U;var A=0,_=0;while($!=U){var D=$.parent[M][C]("iframe");for(var F=0;F_.scrollTop||A.scrollLeft>_.scrollLeft))?A:_;return{"top":B.scrollTop,"left":B.scrollLeft}}function D($){var _=$?($.srcElement||$.target):null;try{if($dp.cal&&!$dp.eCont&&$dp.dd&&_!=$dp.el&&$dp.dd.style.display=="block")$dp.cal.close()}catch($){}}function Y(){$dp.status=2}var P,_;function T(N,F){$dp.win=X;B();N=N||{};for(var K in $)if(K.substring(0,1)!="$"&&N[K]===undefined)N[K]=$[K];if(F){if(!L()){_=_||setInterval(function(){if(U[M].readyState=="complete")clearInterval(_);T(null,true)},50);return}if($dp.status==0){$dp.status=1;N.el=S;I(N,true)}else return}else if(N.eCont){N.eCont=$dp.$(N.eCont);N.el=S;N.autoPickDate=true;N.qsEnabled=false;I(N)}else{if($.$preLoad&&$dp.status!=2)return;var J=H();if(J){N.srcEl=J.srcElement||J.target;J.cancelBubble=true}N.el=N.el=$dp.$(N.el||N.srcEl);if(!N.el||N.el["My97Mark"]===true||N.el.disabled||($dp.dd&&O($dp.dd)!="none"&&$dp.dd.style.left!="-970px")){try{N.el["My97Mark"]=false}catch(C){}return}I(N);if(J&&N.el.nodeType==1&&N.el["My97Mark"]===undefined){var A,D;if(J.type=="focus"){A="onclick";D="onfocus"}else{A="onfocus";D="onclick"}E(N.el,A,N.el[D])}}function L(){if(R&&U!=X&&U[M].readyState!="complete")return false;return true}function H(){if(G){func=H.caller;while(func!=null){var $=func.arguments[0];if($&&($+"").indexOf("Event")>=0)return $;func=func.caller}return null}return event}}function Q(_,$){return _.currentStyle?_.currentStyle[$]:document.defaultView.getComputedStyle(_,false)[$]}function O(_,$){if(_)if($!=null)_.style.display=$;else return Q(_,"display")}function I(G,_){var D=G.el?G.el.nodeName:"INPUT";if(_||G.eCont||new RegExp(/input|textarea|div|span|p|a/ig).test(D))G.elProp=D=="INPUT"?"value":"innerHTML";else return;if(G.lang=="auto")G.lang=R?navigator.browserLanguage.toLowerCase():navigator.language.toLowerCase();if(!G.eCont)for(var C in G)$dp[C]=G[C];if(!$dp.dd||G.eCont||($dp.dd&&(G.getRealLang().name!=$dp.dd.lang||G.skin!=$dp.dd.skin))){if(G.eCont)E(G.eCont,G);else{$dp.dd=U[M].createElement("DIV");$dp.dd.style.cssText="position:absolute";U[M].body.appendChild($dp.dd);E($dp.dd,G);if(_)$dp.dd.style.left=$dp.dd.style.top="-970px";else{$dp.show();B($dp)}}}else if($dp.cal){$dp.show();$dp.cal.init();if(!$dp.eCont)B($dp)}function E(F,E){F.innerHTML="";var D=F.lastChild.contentWindow[M],_=$.$langList,C=$.$skinList,H=E.getRealLang();F.lang=H.name;F.skin=E.skin;var G=[""];for(var I=0;I");G.push("");G.push("");G.push("");E.setPos=B;E.onload=Y;D.write("");D.cfg=E;D.write(G.join(""))}function B(I){var G=I.position.left,B=I.position.top,C=I.el;if(C==S)return;if(C!=I.srcEl&&(O(C)=="none"||C.type=="hidden"))C=I.srcEl;var H=V(C),$=F(X),D=L(U),A=Z(U),E=$dp.dd.offsetHeight,_=$dp.dd.offsetWidth;if(isNaN(B))B=0;if(($.topM+H.bottom+E>D.height)&&($.topM+H.top-E>0))B+=A.top+$.topM+H.top-E-2;else B+=A.top+$.topM+Math.min(H.bottom,D.height-E)+2;if(isNaN(G))G=0;G+=A.left+Math.min($.leftM+H.left,D.width-_-5)-(R?2:0);I.dd.style.top=B+"px";I.dd.style.left=G+"px"}}})() \ No newline at end of file +specialDates:null,specialDays:null,disabledDates:null,disabledDays:null,opposite:false,onpicking:null,onpicked:null,onclearing:null,oncleared:null,ychanging:null,ychanged:null,Mchanging:null,Mchanged:null,dchanging:null,dchanged:null,Hchanging:null,Hchanged:null,mchanging:null,mchanged:null,schanging:null,schanged:null,eCont:null,vel:null,elProp:"",errMsg:"",quickSel:[],has:{},getRealLang:function(){var _=$.$langList;for(var A=0;A<_.length;A++)if(_[A].name==this.lang)return _[A];return _[0]}};WdatePicker=T;var X=window,S={innerHTML:""},M="document",H="documentElement",C="getElementsByTagName",U,A,R,G,a,W=navigator.appName;if(W=="Microsoft Internet Explorer")R=true;else if(W=="Opera")a=true;else G=true;A=J();if($.$wdate)K(A+"skin/WdatePicker.css");U=X;if($.$crossFrame){try{while(U.parent&&U.parent[M]!=U[M]&&U.parent[M][C]("frameset").length==0)U=U.parent}catch(N){}}if(!U.$dp)U.$dp={ff:G,ie:R,opera:a,status:0,defMinDate:$.minDate,defMaxDate:$.maxDate};B();if($.$preLoad&&$dp.status==0)E(X,"onload",function(){T(null,true)});if(!X[M].docMD){E(X[M],"onmousedown",D);X[M].docMD=true}if(!U[M].docMD){E(U[M],"onmousedown",D);U[M].docMD=true}E(X,"onunload",function(){if($dp.dd)O($dp.dd,"none")});function B(){U.$dp=U.$dp||{};obj={$:function($){return(typeof $=="string")?X[M].getElementById($):$},$D:function($,_){return this.$DV(this.$($).value,_)},$DV:function(_,$){if(_!=""){this.dt=$dp.cal.splitDate(_,$dp.cal.dateFmt);if($)for(var B in $)if(this.dt[B]===undefined)this.errMsg="invalid property:"+B;else{this.dt[B]+=$[B];if(B=="M"){var C=$["M"]>0?1:0,A=new Date(this.dt["y"],this.dt["M"],0).getDate();this.dt["d"]=Math.min(A+C,this.dt["d"])}}if(this.dt.refresh())return this.dt}return""},show:function(){var A=U[M].getElementsByTagName("div"),$=100000;for(var B=0;B$)$=_}this.dd.style.zIndex=$+2;O(this.dd,"block")},hide:function(){O(this.dd,"none")},attachEvent:E};for(var $ in obj)U.$dp[$]=obj[$];$dp=U.$dp}function E(A,$,_){if(R)A.attachEvent($,_);else if(_){var B=$.replace(/on/,"");_._ieEmuEventHandler=function($){return _($)};A.addEventListener(B,_._ieEmuEventHandler,false)}}function J(){var _,A,$=X[M][C]("script");for(var B=0;B<$.length;B++){_=$[B].getAttribute("src")||"";_=_.substr(0,_.toLowerCase().indexOf("wdatepicker.js"));A=_.lastIndexOf("/");if(A>0)_=_.substring(0,A+1);if(_)break}return _}function K(A,$,B){var D=X[M][C]("HEAD").item(0),_=X[M].createElement("link");if(D){_.href=A;_.rel="stylesheet";_.type="text/css";if($)_.title=$;if(B)_.charset=B;D.appendChild(_)}}function F($){$=$||U;var A=0,_=0;while($!=U){var D=$.parent[M][C]("iframe");for(var F=0;F_.scrollTop||A.scrollLeft>_.scrollLeft))?A:_;return{"top":B.scrollTop,"left":B.scrollLeft}}function D($){var _=$?($.srcElement||$.target):null;try{if($dp.cal&&!$dp.eCont&&$dp.dd&&_!=$dp.el&&$dp.dd.style.display=="block")$dp.cal.close()}catch($){}}function Y(){$dp.status=2}var P,_;function T(N,F){$dp.win=X;B();N=N||{};for(var K in $)if(K.substring(0,1)!="$"&&N[K]===undefined)N[K]=$[K];if(F){if(!L()){_=_||setInterval(function(){if(U[M].readyState=="complete")clearInterval(_);T(null,true)},50);return}if($dp.status==0){$dp.status=1;N.el=S;I(N,true)}else return}else if(N.eCont){N.eCont=$dp.$(N.eCont);N.el=S;N.autoPickDate=true;N.qsEnabled=false;I(N)}else{if($.$preLoad&&$dp.status!=2)return;var J=H();if(J){N.srcEl=J.srcElement||J.target;J.cancelBubble=true}N.el=N.el=$dp.$(N.el||N.srcEl);if(!N.el||N.el["My97Mark"]===true||N.el.disabled||($dp.dd&&O($dp.dd)!="none"&&$dp.dd.style.left!="-970px")){try{N.el["My97Mark"]=false}catch(C){}return}I(N);if(J&&N.el.nodeType==1&&N.el["My97Mark"]===undefined){var A,D;if(J.type=="focus"){A="onclick";D="onfocus"}else{A="onfocus";D="onclick"}E(N.el,A,N.el[D])}}function L(){if(R&&U!=X&&U[M].readyState!="complete")return false;return true}function H(){if(G){func=H.caller;while(func!=null){var $=func.arguments[0];if($&&($+"").indexOf("Event")>=0)return $;func=func.caller}return null}return event}}function Q(_,$){return _.currentStyle?_.currentStyle[$]:document.defaultView.getComputedStyle(_,false)[$]}function O(_,$){if(_)if($!=null)_.style.display=$;else return Q(_,"display")}function I(G,_){var D=G.el?G.el.nodeName:"INPUT";if(_||G.eCont||new RegExp(/input|textarea|div|span|p|a/ig).test(D))G.elProp=D=="INPUT"?"value":"innerHTML";else return;if(G.lang=="auto")G.lang=R?navigator.browserLanguage.toLowerCase():navigator.language.toLowerCase();if(!G.eCont)for(var C in G)$dp[C]=G[C];if(!$dp.dd||G.eCont||($dp.dd&&(G.getRealLang().name!=$dp.dd.lang||G.skin!=$dp.dd.skin))){if(G.eCont)E(G.eCont,G);else{$dp.dd=U[M].createElement("DIV");$dp.dd.style.cssText="position:absolute";U[M].body.appendChild($dp.dd);E($dp.dd,G);if(_)$dp.dd.style.left=$dp.dd.style.top="-970px";else{$dp.show();B($dp)}}}else if($dp.cal){$dp.show();$dp.cal.init();if(!$dp.eCont)B($dp)}function E(F,E){F.innerHTML="";var D=F.lastChild.contentWindow[M],_=$.$langList,C=$.$skinList,H=E.getRealLang();F.lang=H.name;F.skin=E.skin;var G=[""];for(var I=0;I");G.push("");G.push("");G.push("");E.setPos=B;E.onload=Y;D.write("");D.cfg=E;D.write(G.join(""))}function B(I){var G=I.position.left,B=I.position.top,C=I.el;if(C==S)return;if(C!=I.srcEl&&(O(C)=="none"||C.type=="hidden"))C=I.srcEl;var H=V(C),$=F(X),D=L(U),A=Z(U),E=$dp.dd.offsetHeight,_=$dp.dd.offsetWidth;if(isNaN(B))B=0;if(($.topM+H.bottom+E>D.height)&&($.topM+H.top-E>0))B+=A.top+$.topM+H.top-E-2;else B+=A.top+$.topM+Math.min(H.bottom,D.height-E)+2;if(isNaN(G))G=0;G+=A.left+Math.min($.leftM+H.left,D.width-_-5)-(R?2:0);I.dd.style.top=B+"px";I.dd.style.left=G+"px"}}})() \ No newline at end of file From cf0bf96f983f3221479f0f93c630b7f6ca9808bd Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Wed, 16 Jan 2019 18:07:16 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A1=8C=E7=BB=9F=E8=AE=A1=EF=BC=8C=E5=8F=AF=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=9F=A5=E8=AF=A2IP=EF=BC=8C=E6=A0=B9?= =?UTF-8?q?=E6=8D=AEiP=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/domain/dashboard/NtcRadiusReport.java | 22 +- .../nis/domain/dashboard/PageDashboard.java | 637 ++++++++++++++++++ .../TrafficStatisticsReportController.java | 127 +++- .../views/dashboard/trafficNasIpList.jsp | 133 ++++ .../views/dashboard/trafficUserBehavior.jsp | 264 +++----- .../views/dashboard/trafficUserList.jsp | 148 ++++ src/main/webapp/static/global/css/layout.css | 14 +- 7 files changed, 1127 insertions(+), 218 deletions(-) create mode 100644 src/main/java/com/nis/domain/dashboard/PageDashboard.java create mode 100644 src/main/webapp/WEB-INF/views/dashboard/trafficNasIpList.jsp create mode 100644 src/main/webapp/WEB-INF/views/dashboard/trafficUserList.jsp diff --git a/src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java b/src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java index cb836f0b7..067344c5f 100644 --- a/src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java +++ b/src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java @@ -1,14 +1,20 @@ package com.nis.domain.dashboard; +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlTransient; + import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.google.gson.annotations.SerializedName; +import com.nis.domain.Page; import com.nis.util.excel.ExcelField; import com.wordnik.swagger.annotations.ApiModelProperty; -public class NtcRadiusReport { +public class NtcRadiusReport implements Serializable { + private static final long serialVersionUID = -1434148698159286062L; // @JsonInclude(value = Include.NON_NULL) // @ApiModelProperty(value = "接入IP", required = true) @ExcelField(title = "ip_address_control", sort = 2) @@ -40,6 +46,8 @@ public class NtcRadiusReport { protected String searchNasIp; protected String searchAccount; protected String groupType; + + protected Page page; public String getNasIp() { return nasIp; @@ -146,5 +154,17 @@ public class NtcRadiusReport { public void setGroupType(String groupType) { this.groupType = groupType; } + @JsonIgnore + @XmlTransient + public Page getPage() { + if (page == null) { + page = new Page(); + } + return page; + } + public Page setPage(Page page) { + this.page = page; + return page; + } } diff --git a/src/main/java/com/nis/domain/dashboard/PageDashboard.java b/src/main/java/com/nis/domain/dashboard/PageDashboard.java new file mode 100644 index 000000000..e897d4875 --- /dev/null +++ b/src/main/java/com/nis/domain/dashboard/PageDashboard.java @@ -0,0 +1,637 @@ +/** + * Copyright © 2012-2014 JeeSite All rights reserved. + */ +package com.nis.domain.dashboard; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.servlet.support.RequestContext; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.nis.util.Configurations; +import com.nis.util.Constants; +import com.nis.util.CookieUtil; + +/** + * 分页类 + * @author ThinkGem + * @version 2013-7-2 + * @param + */ +public class PageDashboard { + + private int pageNo = 1; // 当前页码 + private int pageSize = Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)); // 页面大小,设置为“-1”表示不进行分页(分页无效) + + private long count;// 总记录数,设置为“-1”表示不查询总数 + private int first;// 首页索引 +// private int last;// 尾页索引 + private int prev;// 上一页索引 + private int next;// 下一页索引 + + + private boolean firstPage;//是否是第一页 + private boolean lastPage;//是否是最后一页 + +// private int length = 8;// 显示页面长度 +// private int slider = 1;// 前后显示页面长度 + + private List list = new ArrayList(); + + private String orderBy = ""; // 标准查询有效, 实例: updatedate desc, name asc + + private String fields;//制定资源的字段 + + private String where; + private String alias; + private String funcName = "page"; // 设置点击页码调用的js函数名称,默认为page,在一页有多个分页对象时使用。 + + private String funcParam = ""; // 函数的附加参数,第三个参数值。 + + private String message = ""; // 设置提示消息,显示在“共n条”之后 + + private RequestContext requestContext; + + private int maxExportSize=Constants.MAX_EXPORT_SIZE; + + public PageDashboard() { + this.pageSize = -1; + } + + /** + * 构造方法 + * @param request 传递 repage 参数,来记住页码 + * @param response 用于设置 Cookie,记住页码 + */ + public PageDashboard(HttpServletRequest request, HttpServletResponse response){ + this(request, response, Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30))); + } + public PageDashboard(HttpServletRequest request, HttpServletResponse response,String alias){ + + this(request, response, Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)),alias); + } + + public PageDashboard(HttpServletRequest request, HttpServletResponse response, int defaultPageSize,String alias){ + this.setAlias(alias); + this.initPage(request, response, defaultPageSize); + } + public PageDashboard(HttpServletRequest request, HttpServletResponse response, int defaultPageSize){ + this.initPage(request, response, defaultPageSize); + } + private void initPage(HttpServletRequest request, HttpServletResponse response, int defaultPageSize){ + try { + + this.requestContext = new RequestContext(request); + + // 设置页码参数(传递repage参数,来记住页码) + String no = request.getParameter("pageNo"); + if (StringUtils.isNotBlank(no)) { + if (StringUtils.isNumeric(no)){ + CookieUtil.addCookie(response, "pageNo", no); + this.setPageNo(Integer.parseInt(no)); + }else if (request.getParameter("repage")!=null){ + no = CookieUtil.getValue(request, "pageNo"); + if (StringUtils.isNumeric(no)){ + this.setPageNo(Integer.parseInt(no)); + } + } + } + + // 设置页面大小参数(传递repage参数,来记住页码大小) + String size = ""; + if(defaultPageSize==-1){ + size = "-1"; + }else{ + size = request.getParameter("pageSize"); + + } + if (StringUtils.isNotBlank(size)) { + + if (StringUtils.isNumeric(size) || size.equals("-1")){ + CookieUtil.addCookie(response, "pageSize", size); + this.setPageSize(Integer.parseInt(size)); + } else if (request.getParameter("repage")!=null){ + size = CookieUtil.getValue(request, "pageSize"); + if (StringUtils.isNumeric(size)){ + this.setPageSize(Integer.parseInt(size)); + } + } + } else { + this.pageSize = defaultPageSize; + } + + String fields = request.getParameter("fields"); + if (StringUtils.isNotBlank(fields)){ + this.setFields(fields); + } + + // 设置排序参数 + String orderBy = request.getParameter("orderBy"); + if (StringUtils.isNotBlank(orderBy)){ + this.setOrderBy(orderBy); + } + + this.setWhere(getWhere(request)); + + + } catch (Exception e) { + e.printStackTrace(); + } + } + /** + * + * @Title: getWhere + * @Description: TODO(抽取where查询条件) + * @param @param request + * @param @return 入参 + * @return String 返回类型 + * @author (darnell) + * @throws + * @date 2016年8月17日 上午9:28:21 + * @version V1.0 + * wx:日期格式的数据用日期格式化函数格式化,带空格的数据加上引号 + */ + private String getWhere(HttpServletRequest request) { + String format=Constants.SEARCH_DATEFORMAT; + SimpleDateFormat sdf=new SimpleDateFormat(format); + Map requestMap = request.getParameterMap(); + StringBuilder whereBuilder = new StringBuilder(512); + for(String paramName : request.getParameterMap().keySet()) { + if (requestMap.get(paramName)!=null&¶mName.startsWith("search_")&&StringUtils.isNotBlank(requestMap.get(paramName)[0])) { + String clomn=paramName.substring("search_".length()); + String value=requestMap.get(paramName)[0].trim(); + boolean isDate=false; + try { + sdf.parse(value); + isDate=true; + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + if(clomn.endsWith("_start")){ + clomn=clomn.substring(0,clomn.lastIndexOf("_start")); + if(StringUtils.isNotBlank(alias)) whereBuilder.append(alias.trim()+"."); + whereBuilder.append(clomn).append(">="); + if(isDate){ + whereBuilder.append("date_format('") + .append(value).append("','%Y-%m-%d %H:%i:%S')"); + }else if(value.indexOf(" ")>-1){ + whereBuilder.append("'").append(requestMap.get(paramName)[0]).append("'"); + }else{ + whereBuilder.append(requestMap.get(paramName)[0]); + } + whereBuilder.append(" and "); + }else if(clomn.endsWith("_end")){ + clomn=clomn.substring(0,clomn.lastIndexOf("_end")); + if(StringUtils.isNotBlank(alias)) whereBuilder.append(alias.trim()+"."); + whereBuilder.append(clomn).append("<="); + if(isDate){ + whereBuilder.append("DATE_FORMAT('") + .append(value).append("','%Y-%m-%d %H:%i:%S')"); + }else if(value.indexOf(" ")>-1){ + whereBuilder.append("'").append(requestMap.get(paramName)[0]).append("'"); + }else{ + whereBuilder.append(requestMap.get(paramName)[0]); + } + whereBuilder.append(" and "); + }else{ + if(StringUtils.isNotBlank(alias)) whereBuilder.append(alias.trim()+"."); + whereBuilder.append(clomn).append("="); + if(isDate){ + whereBuilder.append("date_format('") + .append(value).append("','%Y-%m-%d %H:%i:%S')"); + }else if(value.indexOf(" ")>-1){ + whereBuilder.append("'").append(requestMap.get(paramName)[0]).append("'"); + }else{ + whereBuilder.append(requestMap.get(paramName)[0]); + } + whereBuilder.append(" and "); + } + + } + } + if (whereBuilder.length() > 0) { + whereBuilder.delete(whereBuilder.lastIndexOf(" and "), whereBuilder.length()); + } + return whereBuilder.toString(); + } + + + /** + * 构造方法 + * @param pageNo 当前页码 + * @param pageSize 分页大小 + */ + public PageDashboard(int pageNo, int pageSize) { + this(pageNo, pageSize, 0); + } + + /** + * 构造方法 + * @param pageNo 当前页码 + * @param pageSize 分页大小 + * @param count 数据条数 + */ + public PageDashboard(int pageNo, int pageSize, long count) { + this(pageNo, pageSize, count, new ArrayList()); + } + + /** + * 构造方法 + * @param pageNo 当前页码 + * @param pageSize 分页大小 + * @param count 数据条数 + * @param list 本页数据对象列表 + */ + public PageDashboard(int pageNo, int pageSize, long count, List list) { + this.setCount(count); + this.setPageNo(pageNo); + this.pageSize = pageSize; + this.list = list; + } + + /** + * 初始化参数 + */ + public void initialize(){ + + //1 + this.first = 1; + + //首页 + if (this.pageNo <= 1) { + this.pageNo = this.first; + this.firstPage=true; + } + + //最后一页 + if(list.size()= this.pageSize) { + this.next = this.pageNo + 1; + } +// 上一页 + if (pageNo > 1) { + this.prev = this.pageNo - 1; + } else { + this.prev = this.first; + } + + //2 + if (this.pageNo < this.first) {// 如果当前页小于首页 + this.pageNo = this.first; + } + + + } + + /** + * 默认输出当前分页标签 + *
${page}
+ */ + @Override + public String toString() { + + + if(list != null && list.isEmpty()&&pageNo<=1) { + return "
  "+requestContext.getMessage("noneData")+"
"; + } + + + StringBuilder sb = new StringBuilder(); + + sb.append("
  • "+requestContext.getMessage("firstPage")+"
  • \n"); + if (pageNo == first) {// 如果是首页 + sb.append("
  • « "+requestContext.getMessage("previousPage")+"
  • \n"); + } else { + sb.append("
  • « "+requestContext.getMessage("previousPage")+"
  • \n"); + } + + sb.append("
  • "+pageNo+"
  • \n"); + +// 最后一页 未铺满 集合不为空 + if (list != null && !list.isEmpty()&&list.size()"+requestContext.getMessage("nextPage")+" »\n"); + }else if(pageNo>1&&list.isEmpty()){ + sb.append("
  • "+requestContext.getMessage("nextPage")+" »
  • \n"); + }else { + sb.append("
  • " + + ""+requestContext.getMessage("nextPage")+" »
  • \n"); + } + + + sb.insert(0,"
      \n").append("
    \n"); + + sb.append("
    "); + + return sb.toString(); + } + + /** + * 获取分页HTML代码 + * @return + */ + @JsonIgnore + public String getHtml(){ + return toString(); + } + + + /** + * 获取设置总数 + * @return + */ + public long getCount() { + return count; + } + + /** + * 设置数据总数 + * @param count + */ + public void setCount(long count) { + this.count = count; + if (pageSize >= count){ + pageNo = 1; + } + } + + /** + * 获取当前页码 + * @return + */ + public int getPageNo() { + return pageNo; + } + + /** + * 设置当前页码 + * @param pageNo + */ + public void setPageNo(int pageNo) { + this.pageNo = pageNo; + } + + /** + * 获取页面大小 + * @return + */ + public int getPageSize() { + return pageSize; + } + + /** + * 设置页面大小(最大500) + * @param pageSize + */ + public void setPageSize(int pageSize) { + if (pageSize == -1 || pageSize > 0 ) { + this.pageSize = pageSize; + } else { + this.pageSize = Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)); + } + } + + /** + * 首页索引 + * @return + */ + @JsonIgnore + public int getFirst() { + return first; + } + + + /** + * 是否为第一页 + * @return + */ + @JsonIgnore + public boolean isFirstPage() { + return firstPage; + } + + /** + * 是否为最后一页 + * @return + */ + @JsonIgnore + public boolean isLastPage() { + return lastPage; + } + + + /** + * @return where + */ + @JsonIgnore + public String getWhere() { + return where; + } + + /** + * @param where 要设置的 where + */ + public void setWhere(String where) { + this.where = where; + } + + /** + * 上一页索引值 + * @return + */ + @JsonIgnore + public int getPrev() { + if (isFirstPage()) { + return pageNo; + } else { + return pageNo - 1; + } + } + + /** + * 下一页索引值 + * @return + */ + @JsonIgnore + public int getNext() { + if (isLastPage()) { + return pageNo; + } else { + return pageNo + 1; + } + } + + /** + * 获取本页数据对象列表 + * @return List + */ + public List getList() { + return list; + } + + /** + * 设置本页数据对象列表 + * @param list + */ + public PageDashboard setList(List list) { + this.list = list; + initialize(); + return this; + } + + /** + * 获取查询排序字符串 + * @return + */ + @JsonIgnore + public String getOrderBy() { + // SQL过滤,防止注入 + String reg = "(?:')|(?:--)|(/\\*(?:.|[\\n\\r])*?\\*/)|" + + "(\\b(select|update|and|or|delete|insert|trancate|char|into|substr|ascii|declare|exec|count|master|into|drop|execute)\\b)"; + Pattern sqlPattern = Pattern.compile(reg, Pattern.CASE_INSENSITIVE); + if (sqlPattern.matcher(orderBy).find()) { + return ""; + } + return orderBy; + } + + /** + * 设置查询排序,标准查询有效, 实例: updatedate desc, name asc + */ + public void setOrderBy(String orderBy) { + this.orderBy = orderBy; + } + + + + /** + * @return fields 字段属性查询,拼接用,分隔 + */ + @JsonIgnore + public String getFields() { + return fields; + } + + /** + * @param fields 要设置的 fields + */ + public void setFields(String fields) { + this.fields = fields; + } + + /** + * 获取点击页码调用的js函数名称 + * function ${page.funcName}(pageNo){location="${ctx}/list-${category.id}${urlSuffix}?pageNo="+i;} + * @return + */ + @JsonIgnore + public String getFuncName() { + return funcName; + } + + /** + * 设置点击页码调用的js函数名称,默认为page,在一页有多个分页对象时使用。 + * @param funcName 默认为page + */ + public void setFuncName(String funcName) { + this.funcName = funcName; + } + + /** + * 获取分页函数的附加参数 + * @return + */ + @JsonIgnore + public String getFuncParam() { + return funcParam; + } + @JsonIgnore + public int getMaxExportSize() { + return maxExportSize; + } + public void setMaxExportSize(int maxExportSize) { + this.maxExportSize = maxExportSize; + } + /** + * 设置分页函数的附加参数 + * @return + */ + public void setFuncParam(String funcParam) { + this.funcParam = funcParam; + } + + /** + * 设置提示消息,显示在“共n条”之后 + * @param message + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * 分页是否有效 + * @return this.pageSize==-1 + */ + @JsonIgnore + public boolean isDisabled() { + return this.pageSize==-1; + } + + /** + * 是否进行总数统计 + * @return this.count==-1 + */ + @JsonIgnore + public boolean isNotCount() { + return this.count==-1; + } + + /** + * 获取 Hibernate FirstResult + */ + @JsonIgnore + public int getFirstResult(){ + int firstResult = (getPageNo() - 1) * getPageSize(); + if (firstResult >= getCount()) { + firstResult = 0; + } + return firstResult; + } + /** + * 获取 Hibernate MaxResults + */ + @JsonIgnore + public int getMaxResults(){ + return getPageSize(); + } + + /** + * alias + * @return alias + */ + + public String getAlias() { + return alias; + } + + /** + * @param alias the alias to set + */ + public void setAlias(String alias) { + this.alias = alias; + } + +} diff --git a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsReportController.java b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsReportController.java index affcc53fd..8593cc1be 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsReportController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsReportController.java @@ -6,16 +6,13 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.Random; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; @@ -28,22 +25,17 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.nis.domain.Page; import com.nis.domain.PageLog; -import com.nis.domain.SysUser; import com.nis.domain.dashboard.NtcRadiusReport; -import com.nis.domain.log.BaseLogEntity; +import com.nis.domain.dashboard.PageDashboard; import com.nis.domain.maat.LogRecvData; -import com.nis.domain.report.NtcAsnRecord; -import com.nis.domain.report.NtcIpRangeReport; -import com.nis.util.Configurations; import com.nis.util.Constants; import com.nis.util.DateUtils; import com.nis.util.StringUtil; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; -import com.nis.web.security.UserUtils; import net.sf.json.JSONObject; - +@SuppressWarnings("all") @Controller @RequestMapping("${adminPath}/traffic") public class TrafficStatisticsReportController extends BaseController { @@ -64,6 +56,13 @@ public class TrafficStatisticsReportController extends BaseController { Map userJsonList = new HashMap(); Map ipJsonList = new HashMap(); String searchBusinessType = bean.getSearchBusinessType(); + + + PageDashboard page=new PageDashboard(request, response); + int pageSize = page.getPageSize(); + int pageNo = page.getPageNo(); + + if ("2".endsWith(searchBusinessType)) { model.addAttribute("searchBusinessType", 2);// 用户查询 } @@ -77,6 +76,7 @@ public class TrafficStatisticsReportController extends BaseController { String nasIp = bean.getNasIp(); String destUrl = url + "?searchBusinessType=1"; String userUrl = url + "?searchBusinessType=2"; + userUrl+="&pageSize="+pageSize+"&pageNo="+pageNo; String ipUrl = url + "?searchBusinessType=3"; List list = new ArrayList(); List userList = new ArrayList(); @@ -110,7 +110,7 @@ public class TrafficStatisticsReportController extends BaseController { } model.addAttribute("nowTime", DateUtils.getDateTime()); // 用户及IP数据 - String string = HttpClientUtil.get(destUrl); + /*String string = HttpClientUtil.get(destUrl); Gson gson = new GsonBuilder().create(); fromJsonList = gson.fromJson(string, new TypeToken() { }.getType()); @@ -142,8 +142,8 @@ public class TrafficStatisticsReportController extends BaseController { System.out.println( "-------------------:" + nasIpList.size() + "+++" + accountList.size() + "=================="); model.addAttribute("nasIpList", nasIpList); - model.addAttribute("accountList", accountList); - if (StringUtil.isBlank(account) && accountList != null && accountList.size() > 0 + model.addAttribute("accountList", accountList);*/ +/* if (StringUtil.isBlank(account) && accountList != null && accountList.size() > 0 && !"3".equals(searchBusinessType)) { Map accountMap = (Map) accountList.get(0); String firstAccount = ""; @@ -175,26 +175,29 @@ public class TrafficStatisticsReportController extends BaseController { model.addAttribute("ipList", ipList); model.addAttribute("searchNasIp", firstIp); - } + }*/ if ("2".endsWith(searchBusinessType) && !StringUtil.isBlank(account)) { String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + account); // 指定用户 查询 Gson usergson = new GsonBuilder().create(); - userJsonList = usergson.fromJson(userString, new TypeToken() { - }.getType()); - userList = (ArrayList) userJsonList.get("data"); - model.addAttribute("userList", userList); +// userJsonList = usergson.fromJson(userString, new TypeToken() {}.getType()); + LogRecvData fromJson = usergson.fromJson(userString, new TypeToken>(){}.getType()); + page.setList(fromJson.getData().getList()); + List list2 = page.getList(); + model.addAttribute("userList", list2); + model.addAttribute("page", page); model.addAttribute("searchAccount", account); } if ("3".endsWith(searchBusinessType) && !StringUtil.isBlank(nasIp)) { String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + nasIp); // 指定IP查询 Gson ipgson = new GsonBuilder().create(); - ipJsonList = ipgson.fromJson(ipString, new TypeToken() { - }.getType()); - ipList = (ArrayList) ipJsonList.get("data"); - model.addAttribute("ipList", ipList); + LogRecvData fromJson = ipgson.fromJson(ipString, new TypeToken>(){}.getType()); + page.setList(fromJson.getData().getList()); + List list3 = page.getList(); + model.addAttribute("ipList", list3); + model.addAttribute("page", page); model.addAttribute("searchNasIp", nasIp); } } catch (Exception e) { @@ -203,6 +206,86 @@ public class TrafficStatisticsReportController extends BaseController { } return "/dashboard/trafficUserBehavior"; } + /** + * 用户行为查询2 + * + * @param bean + * @param model + * @param request + * @param response + * @return + */ + @RequestMapping("getUserBehaviorList") + public String getUserBehaviorList(@ModelAttribute("log")NtcRadiusReport bean, Model model, HttpServletRequest request, + HttpServletResponse response, RedirectAttributes redirectAttributes) { + Map fromJsonList = new HashMap(); + Map userJsonList = new HashMap(); + Map ipJsonList = new HashMap(); + String searchBusinessType = bean.getSearchBusinessType(); + + + PageDashboard page=new PageDashboard(request, response); + int pageSize = page.getPageSize(); + int pageNo = page.getPageNo(); + String url = Constants.DASHBOARD_URL + Constants.NTC_RADIUS_REPORT; + String statTime = bean.getSearchFoundStartTime(); + String endTime = bean.getSearchFoundEndTime(); + String account = bean.getAccount(); + String nasIp = bean.getNasIp(); + String userUrl = url + "?searchBusinessType=2"; + userUrl+="&pageSize="+pageSize+"&pageNo="+pageNo; + String ipUrl = url + "?searchBusinessType=3"; + ipUrl+="&pageSize="+pageSize+"&pageNo="+pageNo; + try { + if (StringUtil.isBlank(statTime) && StringUtil.isBlank(endTime)) { + Calendar cal = Calendar.getInstance(); + cal.setTime(new Date()); + endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cal.getTime());// 获取到完整的时间 + cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1); + statTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cal.getTime()); + bean.setSearchFoundStartTime(statTime); + bean.setSearchFoundEndTime(endTime); + statTime = URLEncoder.encode(statTime, "UTF-8"); + endTime = URLEncoder.encode(endTime, "UTF-8"); + String paramUrl = "&searchReportStartTime=" + statTime + "&searchReportEndTime=" + endTime; + userUrl = userUrl + paramUrl; + ipUrl = ipUrl + paramUrl; + } else { + statTime = URLEncoder.encode(statTime, "UTF-8"); + endTime = URLEncoder.encode(endTime, "UTF-8"); + String paramUrl = "&searchReportStartTime=" + statTime + "&searchReportEndTime=" + endTime; + userUrl = userUrl + paramUrl; + ipUrl = ipUrl + paramUrl; + } + if ("2".endsWith(searchBusinessType) && !StringUtil.isBlank(account)) { + + String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + account); + // 指定用户 查询 + Gson usergson = new GsonBuilder().create(); + LogRecvData fromJson = usergson.fromJson(userString, new TypeToken>(){}.getType()); + page.setList(fromJson.getData().getList()); + model.addAttribute("page", page); + model.addAttribute("searchAccount", account); + model.addAttribute("searchBusinessType", 2);// 用户查询 + return "/dashboard/trafficNasIpList"; + } + if ("3".endsWith(searchBusinessType) && !StringUtil.isBlank(nasIp)) { + String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + nasIp); + // 指定IP查询 + Gson ipgson = new GsonBuilder().create(); + LogRecvData fromJson = ipgson.fromJson(ipString, new TypeToken>(){}.getType()); + page.setList(fromJson.getData().getList()); + model.addAttribute("page", page); + model.addAttribute("searchNasIp", nasIp); + model.addAttribute("searchBusinessType", 3);// ip查询 + return "/dashboard/trafficUserList"; + } + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, "error", "request_service_failed"); + } + return null; + } // 用户行为导出 @RequestMapping(value = "userBehaviorExport") diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficNasIpList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficNasIpList.jsp new file mode 100644 index 000000000..872ed5bf6 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficNasIpList.jsp @@ -0,0 +1,133 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + +<spring:message code="framed_ip"></spring:message> + + + + +
    +

    + ${searchAccount } +

    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    ${it.nasIp}${it.reportTime}
    +
    ${page}
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp index ded2b39c9..b207a3362 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp @@ -5,9 +5,10 @@ + <spring:message code="traffic_user_behavior"></spring:message> +<spring:message code="traffic_user_behavior"></spring:message> + + + + +
    +

    + ${searchNasIp } +

    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    ${it.account}${it.reportTime}
    +
    ${page}
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/src/main/webapp/static/global/css/layout.css b/src/main/webapp/static/global/css/layout.css index 1c32bf20c..6830b550d 100644 --- a/src/main/webapp/static/global/css/layout.css +++ b/src/main/webapp/static/global/css/layout.css @@ -25,21 +25,21 @@ a:hover,a:focus{outline:none;text-decoration: none;} .about .about-body .about-title h1{ font-size:30px; color: #666; } .about .about-body .about-title .help-block{ color: #cbcbcb; font-size: 20px;} -.about .about-body .about-content{ position: relative; color: #666;line-height: 180%; font-size: 16px; padding-bottom: 200px;} +.about .about-body .about-content{ position: relative; color: #666;line-height: 180%; font-size: 16px; padding-bottom: 0px;} .about .about-body .tree-bg{ background: url('../img/about_tree_bg.png') no-repeat right bottom;} .about .about-body .about-content p{ color: #666; text-indent: 2em; line-height: 180%; font-size: 16px;} /** * 发展历程 */ -.process-timeline{ height: 387px; width: 98%; position: relative; overflow:hidden;margin-right: 25px} -.process-timeline:after{content:"";position:absolute;top:48%;left:0;margin-left:0; overflow:hidden;background:url('../img/development_timeline.png') repeat-x; height:15px; width:98%; display:block} +.process-timeline{ height: 200px; width: 98%; position: relative; overflow:hidden;margin-right: 25px} +.process-timeline:after{content:"";position:absolute;top:45%;left:0;margin-left:0; overflow:hidden;background:url('../img/development_timeline.png') repeat-x; height:15px; width:98%; display:block} .process-timeline .process-body{ position: relative; height: 100%; margin-left: 0; overflow:hidden;} -.process-timeline .process-row{ cursor:move; display: inline-block; width: 150px; float: left; margin-top: 30px; position: relative; height: 300px;overflow:hidden;} -.process-timeline .process-row .process-time{ position: absolute; top: 48.7%; left: 10%; -wekit-top:48.8%;} +.process-timeline .process-row{ cursor:move; display: inline-block; width: 150px; float: left; margin-top: 0px; position: relative; height: 192px;overflow:hidden;} +.process-timeline .process-row .process-time{ position: absolute; top: 45.7%; left: 10%; -wekit-top:48.8%;} .process-timeline .process-row .process-time .time-con{ position: relative; text-align: center; } .process-timeline .process-row .process-time .time-con .pic{position: absolute; } .process-timeline .process-row .process-time .time-con .pic i{ font-size: 100px; color: #666; } -.process-timeline .process-row .process-time .time-con .year{ position: absolute; font-size: 9px; color:#000; padding: 20px 5px 0 5px;margin-left: 5px; overflow:hidden;} +.process-timeline .process-row .process-time .time-con .year{ position: absolute; font-size: 10px; color:#000; padding: 20px 5px 0 5px;margin-left: 5px; overflow:hidden;} .process-timeline .process-row .process-time .time-con .bgcolor{ position: absolute; border-radius: 100%; margin-top: 48px; margin-left: 10px; width: 40px; height: 40px; } .process-timeline .process-row .process-time .time-con .bgcolor.red{ background: red;} @@ -51,7 +51,7 @@ a:hover,a:focus{outline:none;text-decoration: none;} .process-timeline .process-row .process-time .time-con .orange i{ color: #ff9900;} -.process-timeline .process-row .process-noyear { position: absolute; top: 43%; width: 200px; font-size: 16px;margin-left: 20px; overflow:hidden;margin-right:20px} +.process-timeline .process-row .process-noyear { position: absolute; top: 30%; width: auto; font-size: 16px;margin-left: 20px; overflow:hidden;margin-right:20px} .process-timeline .process-row .process-content{padding-bottom: 40px; } .process-timeline .process-row .process-content h2{ font-size: 16px; text-align: center;} .process-timeline .process-row .process-content p{text-indent: 0 !important; font-size: 11px !important; height: 180px;color: #888; white-space:normal; } From 783d28ab12237cb889731e3fee2151ee9ad7a7f8 Mon Sep 17 00:00:00 2001 From: leijun Date: Wed, 16 Jan 2019 18:21:22 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=B6=8B=E5=8A=BF=E5=9B=BE=E7=9A=84=E7=BB=93=E6=9D=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=82=B9=E4=B8=8E=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/controller/configuration/LogSearchController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/nis/web/controller/configuration/LogSearchController.java b/src/main/java/com/nis/web/controller/configuration/LogSearchController.java index 3866b4bce..49dc3d3ce 100644 --- a/src/main/java/com/nis/web/controller/configuration/LogSearchController.java +++ b/src/main/java/com/nis/web/controller/configuration/LogSearchController.java @@ -77,7 +77,7 @@ public class LogSearchController extends BaseController{ Map fromJsonList = new HashMap(); List resultList = new ArrayList(); String url = Constants.LOG_BASE_URL+Constants.NTC_PZ_REPORT; - url=url+"?searchBusinessType=2&searchCfgId="+cfgId; + url=url+"?pageSize=-1&searchBusinessType=2&searchCfgId="+cfgId; if(!StringUtil.isEmpty(serviceId)){ url=url+"&searchService="+serviceId; } From e92aa528eb9c63e1cff49b9fdd0270a02a281d9b Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Wed, 16 Jan 2019 18:23:58 +0800 Subject: [PATCH 5/8] =?UTF-8?q?app=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=B6=8B=E5=8A=BF=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp index e9f6622b4..1618849f2 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp @@ -41,7 +41,7 @@
    - +
    From 98971a4c326098190e6ab610723146f7469fe08a Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Wed, 16 Jan 2019 18:31:01 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8F=8A=E8=BF=90?= =?UTF-8?q?=E8=90=A5=E5=95=86=E8=A1=A8=E7=BB=93=E6=9E=84=E5=8F=8A=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E6=95=B0=E6=8D=AE=EF=BC=8C=E9=83=A8=E5=88=86?= =?UTF-8?q?=E2=80=9C=E9=A2=84=E7=95=99100G=E8=AE=BE=E5=A4=877=E2=80=9D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9C=AA=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sql/20190116/device_isp_table_data.sql | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 src/main/resources/sql/20190116/device_isp_table_data.sql diff --git a/src/main/resources/sql/20190116/device_isp_table_data.sql b/src/main/resources/sql/20190116/device_isp_table_data.sql new file mode 100644 index 000000000..5f84bfec8 --- /dev/null +++ b/src/main/resources/sql/20190116/device_isp_table_data.sql @@ -0,0 +1,111 @@ +CREATE TABLE `sys_device_info` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `device_type` varchar(32) NOT NULL COMMENT '豸', + `ip_addr` varchar(128) NOT NULL, + `device_id` int(11) NOT NULL COMMENT '豸IDͬ豸ɶӦӪ', + `link_id` int(11) NOT NULL COMMENT '·', + `isp` int(11) NOT NULL COMMENT 'Ӫ̱룬ktel-mxpe:1001', + `entrance_id` int(11) NOT NULL COMMENT ' 1-astana 2-alamty', + `status` int(11) NOT NULL COMMENT '0-δ 1- 2-ֽ', + `create_time` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4; + + +CREATE TABLE `sys_isp_info` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `isp_name` varchar(64) NOT NULL COMMENT 'ͨӪ', + `isp_code` int(11) NOT NULL COMMENT 'ͨӪ̱', + `business_type_name` varchar(64) NOT NULL COMMENT 'ҵ', + `business_type_code` int(11) NOT NULL COMMENT 'ҵͱ', + `isp_key_name` varchar(64) NOT NULL COMMENT 'ӪΨһʶƣktel-mxpe:1001', + `isp_key_code` int(11) NOT NULL COMMENT 'ӪΨһʶ', + `create_time` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4; + +##INSERT INTO `galaxy-dev`.`sys_isp_info` (`id`, `isp_name`, `isp_code`, `business_type_name`, `business_type_code`, `isp_key_name`, `isp_key_code`, `#create_time`) VALUES ('1', '1', '1', '1', '1', '1', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_isp_info` ( `isp_name`, `isp_code`, `business_type_name`, `business_type_code`, `isp_key_name`, `isp_key_code`, `create_time`) VALUES ( 'ktel', '100', 'mxpe', '1', 'ktel-mxpe', '1001', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_isp_info` ( `isp_name`, `isp_code`, `business_type_name`, `business_type_code`, `isp_key_name`, `isp_key_code`, `create_time`) VALUES ( 'ktel', '100', 'bng', '2', 'ktel-bng', '1002', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_isp_info` ( `isp_name`, `isp_code`, `business_type_name`, `business_type_code`, `isp_key_name`, `isp_key_code`, `create_time`) VALUES ( 'ktel', '100', 'mask', '1', 'ktel-mask', '1003', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_isp_info` ( `isp_name`, `isp_code`, `business_type_name`, `business_type_code`, `isp_key_name`, `isp_key_code`, `create_time`) VALUES ( 'transtel', '101', 'ALL', '0', 'transtel', '1010', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_isp_info` ( `isp_name`, `isp_code`, `business_type_name`, `business_type_code`, `isp_key_name`, `isp_key_code`, `create_time`) VALUES ( 'tnsplus', '102', 'ALL', '0', 'tnsplus', '1020', '2019-01-14 19:10:55'); + +##INSERT INTO `galaxy-dev`.`sys_device_info` (`id`, `device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('1', '10g', '10.4.2.1', '1', '3', '1', '1', '0', '2019-01-14 19:05:38'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.1', '1', '0', '1001', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.1', '1', '1', '1001', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.1', '1', '2', '1001', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.1', '1', '3', '1001', '1', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.2', '2', '0', '1001', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.2', '2', '1', '1001', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.2', '2', '2', '1001', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.2', '2', '3', '1001', '1', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.3', '3', '0', '1001', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.3', '3', '1', '1001', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.3', '3', '2', '1001', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.3', '3', '3', '1001', '1', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.4', '4', '0', '1010', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.4', '4', '1', '1010', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.4', '4', '2', '1010', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.4.2.4', '4', '3', '1010', '1', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.4.2.5', '5', '0', '1002', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.4.2.6', '6', '0', '1002', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.4.2.7', '7', '0', '1002', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.4.2.8', '8', '0', '1002', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.4.2.9', '9', '0', '1010', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.4.2.10', '10', '0', '1020', '1', '1', '2019-01-14 19:10:55'); +#INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.4.2.11', '11', '0', 'Ԥ100G豸7', '1', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.1', '1', '0', '1001', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.1', '1', '1', '1001', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.1', '1', '2', '1001', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.1', '1', '3', '1001', '2', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.2', '2', '0', '1001', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.2', '2', '1', '1001', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.2', '2', '2', '1001', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.2', '2', '3', '1001', '2', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.3', '3', '0', '1001', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.3', '3', '1', '1001', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.3', '3', '2', '1001', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.3', '3', '3', '1001', '2', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.4', '4', '0', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.4', '4', '1', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.4', '4', '2', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.4', '4', '3', '1020', '2', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.5', '5', '0', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.5', '5', '1', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.5', '5', '2', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.5', '5', '3', '1020', '2', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.6', '6', '0', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.6', '6', '1', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.6', '6', '2', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.6', '6', '3', '1020', '2', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.7', '7', '0', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.7', '7', '1', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.7', '7', '2', '1020', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.7', '7', '3', '1020', '2', '1', '2019-01-14 19:10:55'); + +#INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.8', '8', '0', 'Ԥ10G豸8', '2', '1', '2019-01-14 19:10:55'); +#INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.8', '8', '1', 'Ԥ10G豸8', '2', '1', '2019-01-14 19:10:55'); +#INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.8', '8', '2', 'Ԥ10G豸8', '2', '1', '2019-01-14 19:10:55'); +#INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('10g', '10.3.2.8', '8', '3', 'Ԥ10G豸8', '2', '1', '2019-01-14 19:10:55'); + +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.3.2.9', '9', '0', '1002', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.3.2.10', '10', '0', '1002', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.3.2.11', '11', '0', '1002', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.3.2.12', '12', '0', '1002', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.3.2.13', '13', '0', '1002', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.3.2.14', '14', '0', '1002', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.3.2.15', '15', '0', '1002', '2', '1', '2019-01-14 19:10:55'); +INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.3.2.16', '16', '0', '1002', '2', '1', '2019-01-14 19:10:55'); +#INSERT INTO `galaxy-dev`.`sys_device_info` (`device_type`, `ip_addr`, `device_id`, `link_id`, `isp`, `entrance_id`, `status`, `create_time`) VALUES ('100g', '10.3.2.17', '17', '0', 'Ԥ100G豸7', '2', '1', '2019-01-14 19:10:55'); From d7807f000968857ff6ccd30e0572c09e26f308af Mon Sep 17 00:00:00 2001 From: leijun Date: Wed, 16 Jan 2019 18:49:44 +0800 Subject: [PATCH 7/8] =?UTF-8?q?DNAT=E5=A4=8D=E7=94=A8=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E5=92=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20=E8=B0=83=E6=95=B4SNAT=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=B1=A0=E7=AE=A1=E7=90=86=20=E9=85=8D=E7=BD=AEIP=E7=9A=84?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=B8=BA=EF=BC=9AIP=20sql=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/IpReuseDnatPolicyCfg.java | 25 ++++++- .../configuration/IpReusePolicyCfg.java | 2 +- .../manipulation/IpMultiplexController.java | 17 ++++- .../web/dao/configuration/IpMultiplexDao.xml | 40 +++++++---- .../sql/20190110/update_region_dict.sql | 2 + .../maintenance/ipMultiplexPool/snatform2.jsp | 33 ++++++++- .../maintenance/ipMultiplexPool/snatlist2.jsp | 1 - .../ipmulitiplex/dnatPolicyForm2.jsp | 35 +++++++++- .../ipmulitiplex/dnatPolicyList2.jsp | 67 ++++++++++++++++++- .../ipmulitiplex/snatPolicyForm2.jsp | 3 +- .../ipmulitiplex/snatPolicyList2.jsp | 8 +-- 11 files changed, 203 insertions(+), 30 deletions(-) create mode 100644 src/main/resources/sql/20190110/update_region_dict.sql diff --git a/src/main/java/com/nis/domain/configuration/IpReuseDnatPolicyCfg.java b/src/main/java/com/nis/domain/configuration/IpReuseDnatPolicyCfg.java index 124bb0bd8..d6019f748 100644 --- a/src/main/java/com/nis/domain/configuration/IpReuseDnatPolicyCfg.java +++ b/src/main/java/com/nis/domain/configuration/IpReuseDnatPolicyCfg.java @@ -40,7 +40,7 @@ public class IpReuseDnatPolicyCfg extends IpPortCfg{ @Expose @SerializedName("translatedDestIp") - @ExcelField(title="translated_dest_ip",sort=6) + //@ExcelField(title="translated_dest_ip",sort=6) private String destIpAddress; @Expose @@ -54,8 +54,31 @@ public class IpReuseDnatPolicyCfg extends IpPortCfg{ @Expose @SerializedName("effectiveRange") private String areaEffectiveIds; + @ExcelField(title="user",sort=10) + @Expose + private String translatedUserId; + @Expose + @ExcelField(title="user_type",sort=9) + private String translatedUserType; + + public String getTranslatedUserId() { + return translatedUserId; + } + + public void setTranslatedUserId(String translatedUserId) { + this.translatedUserId = translatedUserId; + } + + public String getTranslatedUserType() { + return translatedUserType; + } + + public void setTranslatedUserType(String translatedUserType) { + this.translatedUserType = translatedUserType; + } + public String getIndexTable() { return indexTable; } diff --git a/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java b/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java index f6371c9d8..ae476f29d 100644 --- a/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java +++ b/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java @@ -36,7 +36,7 @@ public class IpReusePolicyCfg extends BaseCfg{ private Integer ipType; private Integer ipPattern; - @ExcelField(title="ip",sort=6) + //@ExcelField(title="ip",sort=6) private String srcIpAddress; private String destIpAddress; @Expose diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java index ba21d0979..53f00fbaf 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java @@ -343,6 +343,10 @@ public class IpMultiplexController extends CommonController { Page page = ipMultiplexService.findPageDnat(new Page(request, response, "r"), cfg); model.addAttribute("page", page); + + // 获取用户信息 地址池信息 + List users = userManageService.findUsers(); + model.addAttribute("users", users); initFormCondition(model, cfg); return "/cfg/manipulation/ipmulitiplex/dnatPolicyList2"; @@ -363,6 +367,10 @@ public class IpMultiplexController extends CommonController { } else { initFormCondition(model, cfg); } + + // 获取用户信息 地址池信息 + List users = userManageService.findUsers(); + model.addAttribute("users", users); model.addAttribute("_cfg", cfg); return "/cfg/manipulation/ipmulitiplex/dnatPolicyForm2"; } @@ -581,7 +589,14 @@ public class IpMultiplexController extends CommonController { logTotal.put("sum",0L); logTotals.add(logTotal); } - + IpReuseDnatPolicyCfg dnat=(IpReuseDnatPolicyCfg) cfg; + if(dnat.getTranslatedUserType().equals("VPN")){ + dnat.setTranslatedUserType(msgProp.getProperty("policy_vpn_user","VPN")); + }else if(dnat.getTranslatedUserType().equals("SIPv4")){ + dnat.setTranslatedUserType(msgProp.getProperty("policy_sipv4_user","SIPv4")); + }else if(dnat.getTranslatedUserType().equals("SIPv6")){ + dnat.setTranslatedUserType(msgProp.getProperty("policy_sipv6_user","SIPv6")); + } } StringBuilder serviceIds=new StringBuilder(","); for (Integer id : set) { diff --git a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml index a672f431c..527712ca7 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml @@ -45,7 +45,7 @@ - + @@ -73,6 +73,9 @@ + + + @@ -86,11 +89,11 @@ a.cfg_id,a.cfg_desc,a.ip_type,a.original_dest_ip,a.ip_pattern,a.port_pattern,a.original_dest_port, - a.protocol,a.protocol_id,a.cfg_type,a.action,a.translated_dest_port,a.translated_dest_ip,a.is_valid, + a.protocol,a.protocol_id,a.cfg_type,a.action,a.translated_dest_port,a.is_valid, a.is_audit,a.creator_id,a.create_time,a.editor_id,a.edit_time,a.auditor_id,a.audit_time, a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable, a.area_effective_ids,a.function_id,a.cfg_region_code,a.user_region1,a.user_region2, - a.user_region3,a.user_region4,a.user_region5 + a.user_region3,a.user_region4,a.user_region5,a.translated_user_type,a.translated_user_id checked> @@ -176,6 +177,32 @@ var resetIndex = function(){
    + + +
    + +
    + + +

    @@ -227,7 +254,7 @@ var resetIndex = function(){
    -
    +