From 6e646d83e59f0ec5de4a40f656c325f941382dc9 Mon Sep 17 00:00:00 2001 From: shangguanyanfei Date: Thu, 27 Jun 2019 10:33:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1-=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=A1=B5=E9=9D=A2=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/util/httpclient/HttpClientUtil.java | 5 +- .../dashboard/ConfigStatisticsController.java | 157 ++++++++++++++---- .../WEB-INF/views/dashboard/newActionList.jsp | 2 + .../views/dashboard/newActiveClientIPList.jsp | 2 + .../views/dashboard/newActiveServerIPList.jsp | 2 + .../views/dashboard/newAppTypeList.jsp | 2 + .../views/dashboard/newBandWidthList.jsp | 5 +- .../views/dashboard/newDomainsList.jsp | 2 + .../views/dashboard/newProtocolTypeList.jsp | 2 + .../views/dashboard/newSubscriberIDList.jsp | 2 + 10 files changed, 142 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/nis/util/httpclient/HttpClientUtil.java b/src/main/java/com/nis/util/httpclient/HttpClientUtil.java index 809f1b65d..01240b57f 100644 --- a/src/main/java/com/nis/util/httpclient/HttpClientUtil.java +++ b/src/main/java/com/nis/util/httpclient/HttpClientUtil.java @@ -86,7 +86,10 @@ public class HttpClientUtil { throw new ConnectException("流量统计服务接口连接错误"+response); } } catch (Exception e) { - throw e; +// e.printStackTrace(); + logger.error("获取消息失败,相应内容如下: " + response); + logger.error("获取消息失败 ", e); + throw new MaatConvertException(":"); }finally { if (response != null) { try { diff --git a/src/main/java/com/nis/web/controller/dashboard/ConfigStatisticsController.java b/src/main/java/com/nis/web/controller/dashboard/ConfigStatisticsController.java index 8290abf4c..feb749ab8 100644 --- a/src/main/java/com/nis/web/controller/dashboard/ConfigStatisticsController.java +++ b/src/main/java/com/nis/web/controller/dashboard/ConfigStatisticsController.java @@ -36,6 +36,7 @@ import com.nis.domain.SysUser; import com.nis.domain.configuration.WebsiteDomainTopic; import com.nis.domain.dashboard.ConfigStatistic; import com.nis.domain.maat.LogRecvData; +import com.nis.exceptions.MaatConvertException; import com.nis.util.CodeDicUtils; import com.nis.util.Constants; import com.nis.util.DateUtils; @@ -130,10 +131,17 @@ public class ConfigStatisticsController extends BaseController { Map result = (Map)fromJsonList.get("data"); model.addAttribute("searchDirection", searchDirection); return result; - } catch (Exception e) { - e.printStackTrace(); + } catch (MaatConvertException e1) { +// e1.printStackTrace(); + Properties msgProp = getMsgProp(); + logger.error("带宽详情数据获取错误"+e1); + map.put("error",msgProp.getProperty("request_service_failed")); + LogUtils.saveLog(request, null, e1, null); + }catch (Exception e) { +// e.printStackTrace(); + Properties msgProp = getMsgProp(); logger.error("带宽详情数据获取错误"+e); - map.put("error","request_service_failed"); + map.put("error",msgProp.getProperty("search_error")); LogUtils.saveLog(request, null, e, null); } return map; @@ -433,9 +441,15 @@ public class ConfigStatisticsController extends BaseController { JSONObject obj=JSONObject.fromObject(json); resultList =getList(fromJsonList); + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("配置统计详情数据获取错误"+e1); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); - resultList.add(Maps.newHashMap("error","request_service_failed")); + Properties msgProp = getMsgProp(); + logger.error("配置统计详情数据获取错误"+e); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); } return resultList; @@ -521,10 +535,15 @@ public class ConfigStatisticsController extends BaseController { fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); // logger.debug(searchAction+"动作数据"+fromJsonList); resultList = (ArrayList) fromJsonList.get("data"); + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error(searchAction+"动作详情数据获取错误"+e1); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); + Properties msgProp = getMsgProp(); logger.error(searchAction+"动作详情数据获取错误"+e); - resultList.add(Maps.newHashMap("error","request_service_failed")); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); } return resultList; @@ -666,10 +685,15 @@ public class ConfigStatisticsController extends BaseController { m.put("totalGByte", totalGByte); } } + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("协议数据获取错误"+e1); + list.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); + Properties msgProp = getMsgProp(); logger.error("协议数据获取错误"+e); - list.add(Maps.newHashMap("error","request_service_failed")); + list.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); } return list; @@ -753,9 +777,15 @@ public class ConfigStatisticsController extends BaseController { resultLists.add(maps); resultList=resultLists; + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("协议详情数据获取错误"+e1); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); - resultList.add(Maps.newHashMap("error","request_service_failed")); + Properties msgProp = getMsgProp(); + logger.error("协议详情数据获取错误"+e); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); } return resultList; @@ -852,10 +882,15 @@ public class ConfigStatisticsController extends BaseController { } } + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("app 数据获取错误"+e1); + list.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); + Properties msgProp = getMsgProp(); logger.error("app 数据获取错误"+e); - list.add(Maps.newHashMap("error","request_service_failed")); + list.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); } return list; @@ -938,9 +973,15 @@ public class ConfigStatisticsController extends BaseController { maps.put("result", list); resultLists.add(maps); resultList=resultLists; + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("app 详情数据获取错误"+e1); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); - resultList.add(Maps.newHashMap("error","request_service_failed")); + Properties msgProp = getMsgProp(); + logger.error("app 详情数据获取错误"+e); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); } return resultList; @@ -1033,10 +1074,15 @@ public class ConfigStatisticsController extends BaseController { m.put("totalGByte", totalGByte); } } + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("域名数据获取错误"+e1); + list.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); + Properties msgProp = getMsgProp(); logger.error("域名数据获取错误"+e); - list.add(Maps.newHashMap("error","request_service_failed")); + list.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); } return list; @@ -1122,11 +1168,17 @@ public class ConfigStatisticsController extends BaseController { resultLists.add(maps); resultList=resultLists; + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("域名详情数据获取错误"+e1); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); - resultList.add(Maps.newHashMap("error","request_service_failed")); + Properties msgProp = getMsgProp(); + logger.error("域名详情数据获取错误"+e); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); - } + } return resultList; } /** @@ -1201,12 +1253,17 @@ public class ConfigStatisticsController extends BaseController { } } + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("ClientIP据获取错误"+e1); + list.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); + Properties msgProp = getMsgProp(); logger.error("ClientIP据获取错误"+e); - list.add(Maps.newHashMap("error","request_service_failed")); + list.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); - } + } return list; } @@ -1282,9 +1339,15 @@ public class ConfigStatisticsController extends BaseController { maps.put("result", list); resultLists.add(maps); resultList=resultLists; + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("ClientIP详情据获取错误"+e1); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); - resultList.add(Maps.newHashMap("error","request_service_failed")); + Properties msgProp = getMsgProp(); + logger.error("ClientIP详情据获取错误"+e); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); } return resultList; @@ -1360,10 +1423,15 @@ public class ConfigStatisticsController extends BaseController { } } + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("ServerIP数据获取错误"+e1); + list.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); + Properties msgProp = getMsgProp(); logger.error("ServerIP数据获取错误"+e); - list.add(Maps.newHashMap("error","request_service_failed")); + list.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); } return list; @@ -1442,11 +1510,17 @@ public class ConfigStatisticsController extends BaseController { resultLists.add(maps); resultList=resultLists; + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("ServerIP详情数据获取错误"+e1); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); - resultList.add(Maps.newHashMap("error","request_service_failed")); + Properties msgProp = getMsgProp(); + logger.error("ServerIP详情数据获取错误"+e); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); - } + } return resultList; } @@ -1553,12 +1627,17 @@ public class ConfigStatisticsController extends BaseController { list.add(m); list.add(m1);*/ + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("SubscriberID数据获取错误"+e1); + list.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); + Properties msgProp = getMsgProp(); logger.error("SubscriberID数据获取错误"+e); - list.add(Maps.newHashMap("error","request_service_failed")); + list.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); - } + } return list; } @@ -1657,11 +1736,17 @@ public class ConfigStatisticsController extends BaseController { fromJsonList.put("list", s); resultList =getList(fromJsonList);*/ + } catch (MaatConvertException e1) { + Properties msgProp = getMsgProp(); + logger.error("SubscriberID详情数据获取错误"+e1); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("request_service_failed"))); + LogUtils.saveLog(request, null, e1, null); } catch (Exception e) { - e.printStackTrace(); - resultList.add(Maps.newHashMap("error","request_service_failed")); + Properties msgProp = getMsgProp(); + logger.error("SubscriberID详情数据获取错误"+e); + resultList.add(Maps.newHashMap("error",msgProp.getProperty("search_error"))); LogUtils.saveLog(request, null, e, null); - } + } return resultList; } } diff --git a/src/main/webapp/WEB-INF/views/dashboard/newActionList.jsp b/src/main/webapp/WEB-INF/views/dashboard/newActionList.jsp index e1954d50a..9a08d6274 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/newActionList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/newActionList.jsp @@ -205,6 +205,8 @@ function showActionTransChart(chartType,xData,series){ success:function (rs) { if(rs!=null&&rs.length>0&&rs[0].error!=null){ // top.$.jBox.tip("", ""); + $("#messageBox").html(rs[0].error); + $("#messageBox").append(""); $("#errorTipDiv").show(); return; } diff --git a/src/main/webapp/WEB-INF/views/dashboard/newActiveClientIPList.jsp b/src/main/webapp/WEB-INF/views/dashboard/newActiveClientIPList.jsp index 3d88caa5a..467fb4745 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/newActiveClientIPList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/newActiveClientIPList.jsp @@ -102,6 +102,8 @@ function ajaxClientIPList(start,end,entranceId){ success:function (data){ if(data!=null&&data.length>0&&data[0].error!=null){ // top.$.jBox.tip("", ""); + $("#messageBox").html(data[0].error); + $("#messageBox").append(""); $("#errorTipDiv").show(); return; } diff --git a/src/main/webapp/WEB-INF/views/dashboard/newActiveServerIPList.jsp b/src/main/webapp/WEB-INF/views/dashboard/newActiveServerIPList.jsp index d12ba4ed1..25e6494d6 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/newActiveServerIPList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/newActiveServerIPList.jsp @@ -102,6 +102,8 @@ function ajaxServerIPList(start,end,entranceId){ success:function (data){ if(data!=null&&data.length>0&&data[0].error!=null){ // top.$.jBox.tip("", ""); + $("#messageBox").html(data[0].error); + $("#messageBox").append(""); $("#errorTipDiv").show(); return; } diff --git a/src/main/webapp/WEB-INF/views/dashboard/newAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/newAppTypeList.jsp index d834f9bbb..c132b9afd 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/newAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/newAppTypeList.jsp @@ -104,6 +104,8 @@ function ajaxAppList(start,end,entranceId){ success:function (data){ if(data!=null&&data.length>0&&data[0].error!=null){ // top.$.jBox.tip("", ""); + $("#messageBox").html(data[0].error); + $("#messageBox").append(""); $("#errorTipDiv").show(); return; } diff --git a/src/main/webapp/WEB-INF/views/dashboard/newBandWidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/newBandWidthList.jsp index 5f8935821..996824773 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/newBandWidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/newBandWidthList.jsp @@ -1,7 +1,7 @@ <%@ page contentType="text/html;charset=UTF-8"%> <%@ include file="/WEB-INF/include/taglib.jsp"%>
- +
@@ -92,7 +92,8 @@ function changeBandwidth(unitType,beginDate,endDate){ timeout:50000, success:function (data){ if(data!=null && data.error!=null){ -// top.$.jBox.tip("", ""); + $("#messageBox").html(data.error); + $("#messageBox").append(""); $("#errorTipDiv").show(); return; } diff --git a/src/main/webapp/WEB-INF/views/dashboard/newDomainsList.jsp b/src/main/webapp/WEB-INF/views/dashboard/newDomainsList.jsp index 0419d95bb..60d35d976 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/newDomainsList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/newDomainsList.jsp @@ -117,6 +117,8 @@ // top.$.jBox.tip( // "", // ""); + $("#messageBox").html(data[0].error); + $("#messageBox").append(""); $("#errorTipDiv").show(); return; } diff --git a/src/main/webapp/WEB-INF/views/dashboard/newProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/newProtocolTypeList.jsp index 54202bfeb..749ec3a73 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/newProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/newProtocolTypeList.jsp @@ -105,6 +105,8 @@ function ajaxProtocolList(start,end,entranceId){ success:function (data){ if(data!=null&&data.length>0&&data[0].error!=null){ // top.$.jBox.tip("", ""); + $("#messageBox").html(data[0].error); + $("#messageBox").append(""); $("#errorTipDiv").show(); return; } diff --git a/src/main/webapp/WEB-INF/views/dashboard/newSubscriberIDList.jsp b/src/main/webapp/WEB-INF/views/dashboard/newSubscriberIDList.jsp index 9c15cb47e..83b80c601 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/newSubscriberIDList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/newSubscriberIDList.jsp @@ -102,6 +102,8 @@ function ajaxSubscriberIDList(start,end,entranceId){ success:function (data){ if(data!=null&&data.length>0&&data[0].error!=null){ // top.$.jBox.tip("", ""); + $("#messageBox").html(data[0].error); + $("#messageBox").append(""); $("#errorTipDiv").show(); return; }