diff --git a/src/main/java/com/nis/domain/log/BaseLogEntity.java b/src/main/java/com/nis/domain/log/BaseLogEntity.java index 718bfa542..de302a7ac 100644 --- a/src/main/java/com/nis/domain/log/BaseLogEntity.java +++ b/src/main/java/com/nis/domain/log/BaseLogEntity.java @@ -33,7 +33,7 @@ public class BaseLogEntity extends BaseEntity { protected Integer service; //配置表的serviceId @ExcelField(title="entrance_id",dictType="ENTRANCE",sort=7) protected Integer entranceId; //出入口编号 - @ExcelField(title="deviceid",dictType="DEVICE",sort=45) + @ExcelField(title="deviceid",dictType="DEVICE",sort=50) protected Integer deviceId; //串联设备编号 @ExcelField(title="direction",dictType="LOG_DIRECTION",sort=55) protected Integer direction; //传输方向 0:域内->域外,1:域外->域内,从字典LOG_DIRECTION取值 @@ -74,9 +74,9 @@ public class BaseLogEntity extends BaseEntity { protected String orderBy;//排序参数 //新增字段 - @ExcelField(title="encap_type",dictType="ENCAP_TYPE",sort=50) + @ExcelField(title="encap_type",dictType="ENCAP_TYPE",sort=52) protected Integer encapType;//原始二层封装格式 - @ExcelField(title="link_id",dictType="LINK",sort=47) + @ExcelField(title="link_id",dictType="LINK",sort=51) protected Integer linkId;//串联设备链路号 @ExcelField(title="inner_smac",sort=58) protected String innerSmac;//MAC_IN_MAC的内层源MAC diff --git a/src/main/java/com/nis/domain/log/NtcConnRecordLog.java b/src/main/java/com/nis/domain/log/NtcConnRecordLog.java index f6863769d..3eeb5af38 100644 --- a/src/main/java/com/nis/domain/log/NtcConnRecordLog.java +++ b/src/main/java/com/nis/domain/log/NtcConnRecordLog.java @@ -5,20 +5,69 @@ import com.nis.util.excel.ExcelField; public class NtcConnRecordLog extends BaseLogEntity { private static final long serialVersionUID = -4947912502754359817L; - @ExcelField(title = "social_app", sort = 8) protected String appLabel; - - @ExcelField(title = "c2s_pkt_num", sort = 9) + @ExcelField(title = "c2s_pkt_num", sort = 44) protected String c2sPktNum; - @ExcelField(title = "s2c_pkt_num", sort = 10) + @ExcelField(title = "s2c_pkt_num", sort = 45) protected String s2cPktNum; - @ExcelField(title = "c2s_byte_num", sort = 12) + @ExcelField(title = "c2s_byte_num", sort = 47) protected String c2sByteNum; - @ExcelField(title = "s2c_byte_num", sort = 13) + @ExcelField(title = "s2c_byte_num", sort = 48) protected String s2cByteNum; + @ExcelField(title = "APP", sort = 8) + protected String appId; + @ExcelField(title = "Web", sort = 10) + protected String webId; + @ExcelField(title = "Protocol", sort = 9) + protected String protoId; + @ExcelField(title = "Total Pkt", sort = 46) + protected String totalPkt; + @ExcelField(title = "Total Byte", sort = 49) + protected String totalByte; + + + public String getTotalPkt() { + return totalPkt; + } + + public void setTotalPkt(String totalPkt) { + this.totalPkt = totalPkt; + } + + public String getTotalByte() { + return totalByte; + } + + public void setTotalByte(String totalByte) { + this.totalByte = totalByte; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getWebId() { + return webId; + } + + public void setWebId(String webId) { + this.webId = webId; + } + + public String getProtoId() { + return protoId; + } + + public void setProtoId(String protoId) { + this.protoId = protoId; + } public String getAppLabel() { return appLabel; diff --git a/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java b/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java index f04c2d4e9..4bf4a08d6 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java @@ -1,45 +1,31 @@ package com.nis.web.controller.log.ntc; -import java.text.ParseException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.Map.Entry; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.httpclient.HttpClient; import org.apache.commons.lang3.StringUtils; -import org.eclipse.jetty.util.ajax.JSON; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.SysUser; -import com.nis.domain.log.IrDnatLog; -import com.nis.domain.log.IrSnatLog; -import com.nis.domain.log.NtcCollectRadiusLog; import com.nis.domain.log.NtcConnRecordLog; -import com.nis.domain.log.NtcConnRecordLog; -import com.nis.domain.log.SearchReport; import com.nis.domain.maat.LogRecvData; -import com.nis.domain.report.NtcServiceReport; import com.nis.exceptions.MaatConvertException; import com.nis.util.CodeDicUtils; -import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.StringUtil; @@ -63,11 +49,40 @@ public class NtcConnRecordLogController extends BaseController { params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); initLogSearchValue(log, params); - + if (StringUtils.isNotBlank(log.getAppId())) { + params.put("searchAppId", log.getAppId()); + } + if (StringUtils.isNotBlank(log.getProtoId())) { + params.put("searchProtoId", log.getProtoId()); + } + if (StringUtils.isNotBlank(log.getWebId())) { + params.put("searchWebId", log.getWebId()); + } + if (StringUtils.isNotBlank(log.getsAsn())) { + params.put("searchSAsn", log.getsAsn()); + } + if (StringUtils.isNotBlank(log.getdAsn())) { + params.put("searchDAsn", log.getdAsn()); + } + if (StringUtils.isNotBlank(log.getServerLocate())) { + params.put("searchServerLocate", log.getServerLocate()); + } + if (StringUtils.isNotBlank(log.getClientLocate())) { + params.put("searchClientLocate", log.getClientLocate()); + } + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); List appList = CodeDicUtils.getCodeList("appCode"); + List protocolList = CodeDicUtils.getCodeList("protocolCode"); + List webList = CodeDicUtils.getCodeList("webCode"); + model.addAttribute("appList", appList); + model.addAttribute("protocolList", protocolList); + model.addAttribute("webList", webList); + model.addAttribute("appList", appList); + model.addAttribute("protocolList", protocolList); + model.addAttribute("webList", webList); String url = Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_LOG; String recv = HttpClientUtil.getMsg(url, params, request); @@ -148,10 +163,36 @@ public class NtcConnRecordLogController extends BaseController { params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); initLogSearchValue(log, params); - + if (StringUtils.isNotBlank(log.getAppId())) { + params.put("searchAppId", log.getAppId()); + } + if (StringUtils.isNotBlank(log.getProtoId())) { + params.put("searchProtoId", log.getProtoId()); + } + if (StringUtils.isNotBlank(log.getWebId())) { + params.put("searchWebId", log.getWebId()); + } + if (StringUtils.isNotBlank(log.getsAsn())) { + params.put("searchSAsn", log.getsAsn()); + } + if (StringUtils.isNotBlank(log.getdAsn())) { + params.put("searchDAsn", log.getdAsn()); + } + if (StringUtils.isNotBlank(log.getServerLocate())) { + params.put("searchServerLocate", log.getServerLocate()); + } + if (StringUtils.isNotBlank(log.getClientLocate())) { + params.put("searchClientLocate", log.getClientLocate()); + } List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); - + List appList = CodeDicUtils.getCodeList("appCode"); + List protocolList = CodeDicUtils.getCodeList("protocolCode"); + List webList = CodeDicUtils.getCodeList("webCode"); + model.addAttribute("appList", appList); + model.addAttribute("protocolList", protocolList); + model.addAttribute("webList", webList); + Properties msgProp = getMsgProp(); String url = Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_LOG; String recv = HttpClientUtil.getMsg(url, params, request); List list = new ArrayList(); @@ -166,8 +207,21 @@ public class NtcConnRecordLogController extends BaseController { } } for (NtcConnRecordLog l : list) { - l.setFunctionId(log.getFunctionId()); - setLogAction(l, serviceList); + if (StringUtils.isNotBlank(l.getAppId())) { + l.setAppId(getName(l.getAppId(),appList,msgProp)); + } + if (StringUtils.isNotBlank(l.getProtoId())) { + l.setProtoId(getName(l.getProtoId(),protocolList,msgProp)); + } + if (StringUtils.isNotBlank(l.getWebId())) { + l.setWebId(getName(l.getWebId(),webList,msgProp)); + } + if (StringUtils.isNotBlank(l.getC2sPktNum()) && StringUtils.isNotBlank(l.getS2cPktNum()) ) { + l.setTotalPkt(String.valueOf(Integer.valueOf(l.getC2sPktNum())+Integer.valueOf(l.getS2cPktNum()))); + } + if (StringUtils.isNotBlank(l.getC2sByteNum()) && StringUtils.isNotBlank(l.getS2cByteNum()) ) { + l.setTotalByte(String.valueOf(Integer.valueOf(l.getC2sByteNum())+Integer.valueOf(l.getS2cByteNum()))); + } } titleList.add("conn_record"); classMap.put("conn_record", NtcConnRecordLog.class); @@ -177,7 +231,7 @@ public class NtcConnRecordLogController extends BaseController { } else { hColumns += ","; } - String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns; + String cfgIndexInfoNoExport = ",cfg_id,action,user_region," + hColumns; noExportMap.put("conn_record", cfgIndexInfoNoExport); dataMap.put("conn_record", list); String timeRange= initLogMap(log,"conn_record"); @@ -195,5 +249,16 @@ public class NtcConnRecordLogController extends BaseController { addMessage(redirectAttributes, "error", "export_failed"); } } + + public String getName(String id,List list,Properties msgProp){ + String name=String.valueOf(id); + for (int i = 0; i < list.size(); i++) { + if(String.valueOf(id).equals(list.get(i).getCode())){ + name=msgProp.getProperty(list.get(i).getItem(),list.get(i).getItem()); + break; + } + } + return name; + } } diff --git a/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp index 60fd1d8a4..3e36ab497 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp @@ -11,7 +11,7 @@ //reset $("#resetBtn").on("click",function(){ $("select.selectpicker").each(function(){ - $(this).selectpicker('val',$(this).find('option:first').val()); + $(this).selectpicker('val',""); $(this).find("option").attr("selected",false); $(this).find("option:first").attr("selected",true); }); @@ -21,10 +21,9 @@ .attr("value",''); $("#searchForm")[0].reset(); }); + returnBack(); //筛选功能 filterActionInit(); - - $("span[id^=close]").on("click",function(){ var closeId=$(this).attr("id"); var openId=$(this).attr("id").replace("close","open"); @@ -35,6 +34,33 @@ ajaxConnPercent(); }); + + function returnBack(){ + $('#appSelect').selectpicker(); + var app = $("#apps").val(); //回选的数据 + if (app !=null && app !='') { + var seasonlist = app.split(","); + $('#appSelect').selectpicker('val',seasonlist); + $('#appSelect').selectpicker('render'); + } + + $('#protoSelect').selectpicker(); + var proto = $("#protos").val(); //回选的数据 + if (proto !=null && proto !='') { + var protolist = proto.split(","); + $('#protoSelect').selectpicker('val',protolist); + $('#protoSelect').selectpicker('render'); + } + + $('#webSelect').selectpicker(); + var web = $("#webs").val(); //回选的数据 + if (web !=null && web !='') { + var weblist = web.split(","); + $('#webSelect').selectpicker('val',weblist); + $('#webSelect').selectpicker('render'); + } + }; + var ajaxConnPercent=function(){ $.ajax({ type:'get', @@ -96,6 +122,10 @@ + + + +
-
-
- - - - - - - -
-
- -
-
- - - - - - - -
-
+
@@ -207,6 +215,20 @@
+
+
+ + + + + + + +
+
+ + +
@@ -220,14 +242,93 @@
-
+ +
+
+ + + + + + + +
+
+ <%--
--%> + +
+
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+
+
+ + +
+
+ +
+
+ +
+
+ + +
+
+
+ + @@ -243,9 +344,19 @@ + + APP + Protocol + Web + + + + + + + - Total Pkt @@ -253,31 +364,23 @@ Total Byte - - - - - - - - - - - - - + + + + + - + - - + + <%-- --%> - + @@ -287,16 +390,7 @@ <%-- --%> - <%-- ${log.cfgId } - - ${log.action } - - - ${dict.itemValue} - - - - --%> + ${log.foundTime } ${log.recvTime } @@ -310,31 +404,46 @@ + ${log.appId } + + + ${dict.item} + + + + + + + ${log.protoId } + + + ${dict.item} + + + + + + + ${log.webId } + + + ${dict.item} + + + + + + + <%-- ${log.appLabel } - + ${dict.item} - - ${log.c2sPktNum } - ${log.s2cPktNum } - ${log.s2cPktNum+log.c2sPktNum } - ${log.c2sByteNum } - ${log.s2cByteNum } - ${log.s2cByteNum+log.c2sByteNum } - + --%> ${fns:abbr(log.capIp, 42)} - - ${log.transProto } - - - ${dic.itemValue} - - - - ${log.addrType } @@ -344,10 +453,29 @@ + + + ${log.transProto } + + + ${dic.itemValue} + + + + + ${fns:abbr(log.dIp, 42)} ${fns:abbr(log.sIp, 42)} ${log.dPort } ${log.sPort } + + ${log.c2sPktNum } + ${log.s2cPktNum } + ${log.s2cPktNum+log.c2sPktNum } + ${log.c2sByteNum } + ${log.s2cByteNum } + ${log.s2cByteNum+log.c2sByteNum } + ${log.deviceId }