From 68fe4209c770f170e1dff46fd7c2802ced19f987 Mon Sep 17 00:00:00 2001 From: leijun Date: Sat, 15 Dec 2018 22:53:52 +0800 Subject: [PATCH] =?UTF-8?q?radius=20=E5=8A=A8=E6=80=81=E5=88=97=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=9D=A5=E5=AF=BC=E5=87=BAExcel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nis/domain/log/BaseLogEntity.java | 12 +++- src/main/java/com/nis/util/Reflections.java | 8 +++ .../java/com/nis/util/excel/ExportExcel.java | 2 +- .../ntc/NtcCollectRadiusLogController.java | 5 +- src/main/webapp/WEB-INF/tags/sys/delRow.tag | 6 ++ .../WEB-INF/views/log/ntc/radiusLogList.jsp | 60 +++++++++---------- 6 files changed, 59 insertions(+), 34 deletions(-) diff --git a/src/main/java/com/nis/domain/log/BaseLogEntity.java b/src/main/java/com/nis/domain/log/BaseLogEntity.java index a62f5c0ea..01b94e2b7 100644 --- a/src/main/java/com/nis/domain/log/BaseLogEntity.java +++ b/src/main/java/com/nis/domain/log/BaseLogEntity.java @@ -11,6 +11,7 @@ public class BaseLogEntity extends BaseEntity { protected Integer cfgId; @ExcelField(title="found_time",sort=5) protected String foundTime; //发现时间,timestamp + @ExcelField(title="recv_time",sort=6) protected String recvTime; //接收时间,timestamp @ExcelField(title="transport_layer_protocol",dictType="LOG_PROTOCOL",sort=30) protected String transProto; //协议类型,从字典LOG_PROTOCOL取值 @@ -29,12 +30,15 @@ public class BaseLogEntity extends BaseEntity { @ExcelField(title="client_port",sort=43) protected String sPort; //客户端ip端口 protected Integer service; //配置表的serviceId + @ExcelField(title="entrance_id",dictType="ENTRANCE",sort=7) protected Integer entranceId; //出入口编号 + @ExcelField(title="deviceid",dictType="DEVICE",sort=45) protected Integer deviceId; //串联设备编号 @ExcelField(title="direction",dictType="LOG_DIRECTION",sort=55) protected Integer direction; //传输方向 0:域内->域外,1:域外->域内,从字典LOG_DIRECTION取值 @ExcelField(title="stream_type",dictType="LOG_STREAM_TYPE",sort=65) protected Integer streamDir; //流类型 0:c2s;1:s2c;2:double,从字典LOG_STREAMTYPE取值 + @ExcelField(title="clj_ip",sort=27) protected String capIp; //处理机IP @ExcelField(title="nest_addr_list",sort=66) protected String addrList; //嵌套地址列表 @@ -42,12 +46,17 @@ public class BaseLogEntity extends BaseEntity { protected String serverLocate;// 服务端地址定位信息 @ExcelField(title="client_locate",sort=68) protected String clientLocate;// 客户端地址定位信息 + @ExcelField(title="user_region",sort=76) protected String userRegion; //用户自定义 + @ExcelField(title="s_asn",sort=70) protected String sAsn;//客户端ASN + @ExcelField(title="d_asn",sort=71) protected String dAsn;//服务端ASN + @ExcelField(title="s_subscribe_id",sort=73) protected String sSubscribeId;//客户端用户名 + @ExcelField(title="d_subscribe_id",sort=74) protected String dSubscribeId;//服务端用户名 - @ExcelField(title="scene_file",sort=70) + @ExcelField(title="scene_file",sort=77) protected String sceneFile;//现场日志文件地址 protected Integer functionId; @@ -65,6 +74,7 @@ public class BaseLogEntity extends BaseEntity { //新增字段 @ExcelField(title="encap_type",dictType="ENCAP_TYPE",sort=50) protected Integer encapType;//原始二层封装格式 + @ExcelField(title="link_id",dictType="LINK",sort=47) protected Integer linkId;//串联设备链路号 @ExcelField(title="inner_smac",sort=58) protected String innerSmac;//MAC_IN_MAC的内层源MAC diff --git a/src/main/java/com/nis/util/Reflections.java b/src/main/java/com/nis/util/Reflections.java index 61aa08b68..075420c9a 100644 --- a/src/main/java/com/nis/util/Reflections.java +++ b/src/main/java/com/nis/util/Reflections.java @@ -49,6 +49,14 @@ public class Reflections { getName="dPort"; }else if(getName.equals("SPort")){ getName="sPort"; + }else if(getName.equals("SAsn")){ + getName="sAsn"; + }else if(getName.equals("DAsn")){ + getName="dAsn"; + }else if(getName.equals("SSubscribeId")){ + getName="sSubscribeId"; + }else if(getName.equals("DSubscribeId")){ + getName="dSubscribeId"; } String getterMethodName = GETTER_PREFIX + getName; object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index 33194c26b..0d34ebfa3 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -1910,7 +1910,7 @@ public class ExportExcel { val = getBasicInfo(ef.dictType(),map,valStr); }else{ //字典数据已做国际化处理 - String dict=DictUtils.getDictLabel(ef.dictType(), valStr, ""); + String dict=DictUtils.getDictLabel(ef.dictType(), valStr, valStr); //如果找不到字典国际化值,把字典本身作为默认值放进去,不然导出就是空了 val = msgProp.getProperty(dict,dict); } diff --git a/src/main/java/com/nis/web/controller/log/ntc/NtcCollectRadiusLogController.java b/src/main/java/com/nis/web/controller/log/ntc/NtcCollectRadiusLogController.java index da0290861..891357ae5 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/NtcCollectRadiusLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/NtcCollectRadiusLogController.java @@ -78,7 +78,7 @@ public class NtcCollectRadiusLogController extends BaseController { //radius配置导出 @RequestMapping(value = "exportRadius") - public void exportRadius(@ModelAttribute("log") NtcCollectRadiusLog log, Model model, HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes){ + public void exportRadius(@ModelAttribute("log") NtcCollectRadiusLog log, Model model,String hColumns, HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes){ try { //export data info List titleList=new ArrayList(); @@ -114,7 +114,7 @@ public class NtcCollectRadiusLogController extends BaseController { } titleList.add("radius_log"); classMap.put("radius_log", NtcCollectRadiusLog.class); - String cfgIndexInfoNoExport=""; + String cfgIndexInfoNoExport=","+hColumns; noExportMap.put("radius_log",cfgIndexInfoNoExport); dataMap.put("radius_log",list); /*}*/ @@ -125,4 +125,5 @@ public class NtcCollectRadiusLogController extends BaseController { } } + } diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index 1b9d2e85a..f309b52db 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -382,9 +382,12 @@ function cancelPassOpt(url){ //导出 function exportData(url,maxRow,searchUrl){ var column=[]; + var hColumn=[]; //隐藏列名 $("#${id} ${value} thead tr th").each(function(){ if($(this).is(":visible")){ column.push($(this).text().trim()); + }else{ + hColumn.push($(this).attr("column")); } }); if($("#exportType").val() != null && $("#exportType").val() != ""){ @@ -395,6 +398,9 @@ function cancelPassOpt(url){ if(column){ url+="&columns="+column.toString(); } + if(hColumn){ + url+="&hColumns="+hColumn.toString(); + } var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox"); //导出选中数据 if($(checkboxes).filter(":checked").length>0){ diff --git a/src/main/webapp/WEB-INF/views/log/ntc/radiusLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/radiusLogList.jsp index 00ae2f4cd..5ed735ee8 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/radiusLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/radiusLogList.jsp @@ -214,40 +214,40 @@ <%-- --%> - - - + + + - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + +