From a28087e5add3611875204ae50a91ca2432417526 Mon Sep 17 00:00:00 2001 From: leijun Date: Thu, 30 Aug 2018 17:25:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=A1=A8=201?= =?UTF-8?q?=E3=80=81action=E4=B8=ADdrop=E5=92=8Cwhitelist=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=A4=84=E7=90=86=202=E3=80=81=E4=BF=AE=E5=A4=8Dfunct?= =?UTF-8?q?ionId=E5=90=8E=E5=8F=B0=E6=B2=A1=E6=9C=89=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/NtcDestIpReportController.java | 11 ++++-- .../report/NtcEntranceReportController.java | 11 ++++-- .../report/NtcLwhhReportController.java | 10 ++++- .../report/NtcPzReportController.java | 3 +- .../report/NtcServiceReportController.java | 12 ++++-- .../NtcSrcipDomesticReportController.java | 9 ++++- .../report/NtcTagReportController.java | 7 +++- .../report/NtcXzReportController.java | 7 +++- src/main/webapp/WEB-INF/views/report/list.jsp | 39 ++++++++++++++----- 9 files changed, 82 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/nis/web/controller/report/NtcDestIpReportController.java b/src/main/java/com/nis/web/controller/report/NtcDestIpReportController.java index ff86dbde4..28f53cc41 100644 --- a/src/main/java/com/nis/web/controller/report/NtcDestIpReportController.java +++ b/src/main/java/com/nis/web/controller/report/NtcDestIpReportController.java @@ -60,7 +60,6 @@ public class NtcDestIpReportController extends BaseController { }else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){ bean.setSearchBusinessType("4"); } - // 调用服务接口... bean.setPageSize(-1); @@ -70,6 +69,7 @@ public class NtcDestIpReportController extends BaseController { } catch (ParseException e1) { // TODO Auto-generated catch block e1.printStackTrace(); + } List titles=this.getDateTitiles(bean); model.addAttribute("titles", titles); @@ -91,7 +91,11 @@ public class NtcDestIpReportController extends BaseController { trimStr=report.getDestCountry().trim()+Constants.REPORT_TRIM_CONNECTOR+ report.getReportTime().substring(0,7); } - trimData.put(trimStr, report.getSum().longValue()); + if(trimData.containsKey(trimStr)){ + trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); + }else{ + trimData.put(trimStr, report.getSum().longValue()); + } } HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 @@ -115,7 +119,8 @@ public class NtcDestIpReportController extends BaseController { model.addAttribute("datas", showData); } catch (Exception e) { // TODO: handle exception - e.printStackTrace(); + logger.error("查询失败", e); + addMessageLog(model, null); } // HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 // List line= new ArrayList(); diff --git a/src/main/java/com/nis/web/controller/report/NtcEntranceReportController.java b/src/main/java/com/nis/web/controller/report/NtcEntranceReportController.java index 0006c83ee..097c48fc9 100644 --- a/src/main/java/com/nis/web/controller/report/NtcEntranceReportController.java +++ b/src/main/java/com/nis/web/controller/report/NtcEntranceReportController.java @@ -32,9 +32,7 @@ import net.sf.json.JsonConfig; public class NtcEntranceReportController extends BaseController { @RequestMapping("/ajaxNtcIspReport") public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { - List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); - if(bean.getAction()!=null){ for(FunctionServiceDict service:serviceList){ if(service.getAction().intValue()==bean.getAction().intValue()){ @@ -91,7 +89,11 @@ public class NtcEntranceReportController extends BaseController { trimStr=report.getEntranceId().intValue()+Constants.REPORT_TRIM_CONNECTOR+ report.getReportTime().substring(0,7); } - trimData.put(trimStr, report.getSum().longValue()); + if(trimData.containsKey(trimStr)){ + trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); + }else{ + trimData.put(trimStr, report.getSum().longValue()); + } } HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 for(Entry counrty:trimData.entrySet()){ @@ -114,7 +116,8 @@ public class NtcEntranceReportController extends BaseController { model.addAttribute("datas", showData); } catch (Exception e) { // TODO: handle exception - e.printStackTrace(); + logger.error("查询失败", e); + addMessageLog(model, null); } // HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 // List line= new ArrayList(); diff --git a/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java b/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java index ecb45e1ed..3e06578e5 100644 --- a/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java +++ b/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java @@ -21,6 +21,7 @@ import com.nis.domain.report.NtcLwhhReport; import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; import com.nis.util.DictUtils; +import com.nis.util.StringUtil; import com.nis.web.controller.BaseController; import net.sf.json.JSONArray; @@ -89,7 +90,11 @@ public class NtcLwhhReportController extends BaseController { trimStr=report.getLwhh().intValue()+Constants.REPORT_TRIM_CONNECTOR+ report.getReportTime().substring(0,7); } - trimData.put(trimStr, report.getSum().longValue()); + if(trimData.containsKey(trimStr)){ + trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); + }else{ + trimData.put(trimStr, report.getSum().longValue()); + } } HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 for(RequestInfo requestInfo:requestInfos){ @@ -111,7 +116,8 @@ public class NtcLwhhReportController extends BaseController { model.addAttribute("datas", showData); } catch (Exception e) { // TODO: handle exception - e.printStackTrace(); + logger.error("查询失败", e); + addMessageLog(model, null); } // HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 // for(RequestInfo requestInfo:requestInfos){ diff --git a/src/main/java/com/nis/web/controller/report/NtcPzReportController.java b/src/main/java/com/nis/web/controller/report/NtcPzReportController.java index a31da3994..97eb3109c 100644 --- a/src/main/java/com/nis/web/controller/report/NtcPzReportController.java +++ b/src/main/java/com/nis/web/controller/report/NtcPzReportController.java @@ -122,7 +122,8 @@ public class NtcPzReportController extends BaseController{ model.addAttribute("datas", getList(json)); } catch (Exception e) { // TODO: handle exception - e.printStackTrace(); + logger.error("查询失败", e); + addMessageLog(model, null); } return "/report/pz"; } diff --git a/src/main/java/com/nis/web/controller/report/NtcServiceReportController.java b/src/main/java/com/nis/web/controller/report/NtcServiceReportController.java index ede3d2d93..2070eacff 100644 --- a/src/main/java/com/nis/web/controller/report/NtcServiceReportController.java +++ b/src/main/java/com/nis/web/controller/report/NtcServiceReportController.java @@ -42,7 +42,7 @@ public class NtcServiceReportController extends BaseController { serviceId.append(bean.getServices()); }else{ for(int i=0;i data=getList(json); Map dataMap=new HashMap<>(); for(NtcServiceReport report:data){ - dataMap.put(report.getService(),report.getSum().longValue()); + if(dataMap.containsKey(report.getService())){ + dataMap.put(report.getService(), dataMap.get(report.getService())+report.getSum().longValue()); + }else{ + dataMap.put(report.getService(),report.getSum().longValue()); + } } for(Entry e:dataMap.entrySet()) { Map _data=new HashMap<>(); @@ -82,7 +85,8 @@ public class NtcServiceReportController extends BaseController { } } catch (Exception e) { // TODO Auto-generated catch block - e.printStackTrace(); + logger.error("查询失败", e); + addMessageLog(model, null); } // if(bean.getAction()!=null){ // data.put(bean.getAction().toString(), 66666666l); diff --git a/src/main/java/com/nis/web/controller/report/NtcSrcipDomesticReportController.java b/src/main/java/com/nis/web/controller/report/NtcSrcipDomesticReportController.java index 1a976932e..5095cf9ad 100644 --- a/src/main/java/com/nis/web/controller/report/NtcSrcipDomesticReportController.java +++ b/src/main/java/com/nis/web/controller/report/NtcSrcipDomesticReportController.java @@ -127,7 +127,11 @@ public class NtcSrcipDomesticReportController extends BaseController { report.getSrcCity().trim()+Constants.REPORT_TRIM_CONNECTOR+ report.getReportTime().substring(0,7); } - trimData.put(trimStr, report.getSum().longValue()); + if(trimData.containsKey(trimStr)){ + trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); + }else{ + trimData.put(trimStr, report.getSum().longValue()); + } } HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 for(String key:trimData.keySet()){ @@ -152,7 +156,8 @@ public class NtcSrcipDomesticReportController extends BaseController { model.addAttribute("datas", showData); } catch (Exception e) { // TODO: handle exception - e.printStackTrace(); + logger.error("查询失败", e); + addMessageLog(model, null); } // HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 // long total=0; diff --git a/src/main/java/com/nis/web/controller/report/NtcTagReportController.java b/src/main/java/com/nis/web/controller/report/NtcTagReportController.java index f8a157ebc..a128c62d5 100644 --- a/src/main/java/com/nis/web/controller/report/NtcTagReportController.java +++ b/src/main/java/com/nis/web/controller/report/NtcTagReportController.java @@ -90,7 +90,11 @@ public class NtcTagReportController extends BaseController { trimStr=report.getTag().intValue()+Constants.REPORT_TRIM_CONNECTOR+ report.getReportTime().substring(0,7); } + if(trimData.containsKey(trimStr)){ + trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); + }else{ trimData.put(trimStr, report.getSum().longValue()); + } } HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 for(ServiceDictInfo label:labels){ @@ -112,7 +116,8 @@ public class NtcTagReportController extends BaseController { model.addAttribute("datas", showData); } catch (Exception e) { // TODO: handle exception - e.printStackTrace(); + logger.error("查询失败", e); + addMessageLog(model, null); } // HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 // for(ServiceDictInfo label:labels){ diff --git a/src/main/java/com/nis/web/controller/report/NtcXzReportController.java b/src/main/java/com/nis/web/controller/report/NtcXzReportController.java index 3bfda5ee0..dfabfcb2e 100644 --- a/src/main/java/com/nis/web/controller/report/NtcXzReportController.java +++ b/src/main/java/com/nis/web/controller/report/NtcXzReportController.java @@ -95,7 +95,11 @@ public class NtcXzReportController extends BaseController { trimStr=report.getAttrType().intValue()+Constants.REPORT_TRIM_CONNECTOR+ report.getReportTime().substring(0,7); } + if(trimData.containsKey(trimStr)){ + trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); + }else{ trimData.put(trimStr, report.getSum().longValue()); + } } HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 for(ServiceDictInfo xz:xzs){ @@ -117,7 +121,8 @@ public class NtcXzReportController extends BaseController { model.addAttribute("datas", showData); } catch (Exception e) { // TODO: handle exception - e.printStackTrace(); + logger.error("查询失败", e); + addMessageLog(model, null); } // HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 // for(ServiceDictInfo xz:xzs){ diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index 025b48826..6b256a1e8 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -159,7 +159,8 @@ var ajaxReport=function(url,target){ data:{ "action":$('[name="action"]').val(), "reportType":$('[name="reportType"]').val(), - "reportTime":$('[name="reportTime"]').val() + "reportTime":$('[name="reportTime"]').val(), + "functionId":$('[name="functionId"]').val() }, dataType:"html", success:function(data){ @@ -215,13 +216,26 @@ function customColumnClick(){ -
btn-primary - btn-default"> - - - 0 -
+ + +
btn-primary + btn-default"> + + + 0 +
+
+
+ +
btn-primary + btn-default"> + + + 0 +
+
@@ -253,7 +267,14 @@ function customColumnClick(){ - + + + + + + + +