diff --git a/WebRoot/images/newtopo/ASEM-T102-FRONT.png b/WebRoot/images/newtopo/ASEM-T102-FRONT.png index b1ab59b..ea8d518 100644 Binary files a/WebRoot/images/newtopo/ASEM-T102-FRONT.png and b/WebRoot/images/newtopo/ASEM-T102-FRONT.png differ diff --git a/WebRoot/main.jsp b/WebRoot/main.jsp index c71aea1..bcc58c5 100644 --- a/WebRoot/main.jsp +++ b/WebRoot/main.jsp @@ -424,13 +424,15 @@ html, body { .nav a span{ margin-left: 40px; } - +#leftNodes { + width:250px; +} .middle_tab{ - left: 210px; + left: 250px; } .middle_right{ - left : 215px; + left : 255px; } @@ -564,7 +566,7 @@ html, body {
-
+
▽i18n_main.text.show1_n81i▽
diff --git a/WebRoot/page/detection/monitorData/drawSwitchportMonitorInfo.jsp b/WebRoot/page/detection/monitorData/drawSwitchportMonitorInfo.jsp index b306c38..c45220a 100644 --- a/WebRoot/page/detection/monitorData/drawSwitchportMonitorInfo.jsp +++ b/WebRoot/page/detection/monitorData/drawSwitchportMonitorInfo.jsp @@ -29,6 +29,7 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ i18n_dswmi.message.title_n81i +
+
+ + + +
+          + i18n_dswmi.message.defaultMsg_n81i +
+
+ +
+
+
+ + + + + + + + +
+ +
+ +
+
+ + + i18n_dswmi.message.noRecord_n81i + +
+
+
+ + + + + + + + + + + + + + + + +
+ +
+
+ + i18n_dswmi.textnoClassify_n81i + +
+ +
+ +   + +
+
+
+ +
+ + diff --git a/WebRoot/page/detection/switchInfo/switchInfoTotalList.jsp b/WebRoot/page/detection/switchInfo/switchInfoTotalList.jsp index f057731..7e8837d 100644 --- a/WebRoot/page/detection/switchInfo/switchInfoTotalList.jsp +++ b/WebRoot/page/detection/switchInfo/switchInfoTotalList.jsp @@ -400,7 +400,7 @@ onkeyup="lianxiangkeyup('nodeIp','NodeTable','String','nodeIp','suggest1',this.value);" name="nodeIp" title="i18n_sitl.message.nodeIp_n81i" value="${nodeIp}" size="20" />
- --%>
diff --git a/src/com/nms/thread/DetectInsertTimeOutThread.java b/src/com/nms/thread/DetectInsertTimeOutThread.java index 39b21a8..556bc93 100644 --- a/src/com/nms/thread/DetectInsertTimeOutThread.java +++ b/src/com/nms/thread/DetectInsertTimeOutThread.java @@ -6,7 +6,7 @@ import com.nms.thread.common.ThreadPoolCommon; import com.nms.thread.socket.SSLClient; public class DetectInsertTimeOutThread implements Runnable{ - private static final Logger logger = Logger.getLogger(DetectDatasTimeoutAlarmThread.class); + private static final Logger logger = Logger.getLogger(DetectInsertTimeOutThread.class); private String ip; private int port; private long timeout; diff --git a/src/nis/nms/web/actions/detection/InlineDeviceAction.java b/src/nis/nms/web/actions/detection/InlineDeviceAction.java index aac6215..d92784b 100644 --- a/src/nis/nms/web/actions/detection/InlineDeviceAction.java +++ b/src/nis/nms/web/actions/detection/InlineDeviceAction.java @@ -13,13 +13,17 @@ import org.hibernate.SQLQuery; import com.nis.util.StringUtil; +import edu.emory.mathcs.backport.java.util.Arrays; +import nis.nms.domains.CheckTypeInfo; +import nis.nms.domains.Metadata; import nis.nms.service.CommonService; import nis.nms.util.BaseAction; import nis.nms.util.Constant; import nis.nms.util.Page; @Results({ - @Result(name = "inlineInfoList", value = "/page/detection/monitorData/inlineInfoList.jsp") + @Result(name = "inlineInfoList", value = "/page/detection/monitorData/inlineInfoList.jsp"), + @Result(name = "inlineSwitchportMonitorInfo", value = "/page/detection/monitorData/inlineSwitchportMonitorInfo.jsp") }) @SuppressWarnings("all") public class InlineDeviceAction extends BaseAction{ @@ -34,6 +38,12 @@ public class InlineDeviceAction extends BaseAction{ private String nodeIp;//查询条件:节点ip private String addrCode; //查询条件:地域编码 private String ispKeyCode;//查询条件:运营商唯一标识 + private String sqId; + private String ctId; + private String detectionSetInfoId; + private List metadataList; + private List dataList; + private String dsiId; @Override public String executeAction() throws Exception { @@ -41,6 +51,8 @@ public class InlineDeviceAction extends BaseAction{ //查询运营商等信息 if("query".equalsIgnoreCase(this.action)) { result = inlineInfoList(); + }else if("drawPic".equalsIgnoreCase(this.action)) { + result = ajaxDrawDateSource(); } return result; } @@ -180,6 +192,57 @@ public class InlineDeviceAction extends BaseAction{ this.getRequest().setAttribute("page", devicePage); return "inlineInfoList"; } + + + public String ajaxDrawDateSource() { + String resu = ""; + try { + + String deviceId = this.getRequest().getParameter("deviceId");//sys_device_info表的id deviceId + dsiId = this.getRequest().getParameter("dsiId"); + sqId = this.getRequest().getParameter("sqId"); + ctId = this.getRequest().getParameter("checkTypeId"); + detectionSetInfoId=this.getRequest().getParameter("detectionSetInfoId"); + CheckTypeInfo checkTypeInfo = (CheckTypeInfo) this.commonService.get(CheckTypeInfo.class,Long.parseLong(ctId)); + + String tString = "select * from metadata where table_name = " + + "(select table_name from check_type_info where id=" + + "(select check_type_id from detection_set_info where id=" + dsiId + ")) " + + " and chart_state = '0'"; + + metadataList = this.commonService.executeSQL(tString, Metadata.class); + + String sql = "SELECT " + + " sdi.*,nt.* " + + " FROM " + + " sys_device_info sdi " + + " LEFT JOIN ( SELECT node_ip, seq_id FROM node_table GROUP BY node_ip ) nt ON nt.node_ip = sdi.ip_addr " + + "where sdi.status != 0 and sdi.id = ?"; + List> list = commonService.executeSQLMap(sql, deviceId); + if(list != null && list.size()>0) { + Map deviceMap = list.get(0); + String portName = deviceMap.get("port_name")+""; + if(!StringUtil.isBlank(portName)) { + String[] split = portName.split(","); + dataList = Arrays.asList(split); + } + } + // 针对多项监测都使用分类标识,所以取消判断是否为snmp监控 + // 得到分类标识字段 + return "inlineSwitchportMonitorInfo"; + } catch (Exception e) { + e.printStackTrace(); + logger.error(e.getStackTrace()); + outHtmlString( + ""); + } + return resu; + + } + + + public CommonService getCommonService() { return commonService; @@ -245,5 +308,61 @@ public class InlineDeviceAction extends BaseAction{ this.ispKeyCode = ispKeyCode; } + public SimpleDateFormat getSdf() { + return sdf; + } + + public void setSdf(SimpleDateFormat sdf) { + this.sdf = sdf; + } + + public String getSqId() { + return sqId; + } + + public void setSqId(String sqId) { + this.sqId = sqId; + } + + public String getCtId() { + return ctId; + } + + public void setCtId(String ctId) { + this.ctId = ctId; + } + + public String getDetectionSetInfoId() { + return detectionSetInfoId; + } + + public void setDetectionSetInfoId(String detectionSetInfoId) { + this.detectionSetInfoId = detectionSetInfoId; + } + + public List getMetadataList() { + return metadataList; + } + + public void setMetadataList(List metadataList) { + this.metadataList = metadataList; + } + + public List getDataList() { + return dataList; + } + + public void setDataList(List dataList) { + this.dataList = dataList; + } + + public String getDsiId() { + return dsiId; + } + + public void setDsiId(String dsiId) { + this.dsiId = dsiId; + } + } diff --git a/src/nis/nms/web/actions/detection/MonitorDataAction.java b/src/nis/nms/web/actions/detection/MonitorDataAction.java index 90ed064..df751c3 100644 --- a/src/nis/nms/web/actions/detection/MonitorDataAction.java +++ b/src/nis/nms/web/actions/detection/MonitorDataAction.java @@ -12,6 +12,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import javax.servlet.http.HttpServletResponse; + import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.struts2.config.Result; @@ -37,6 +39,7 @@ import nis.nms.domains.OptionTable; import nis.nms.domains.VDetectionInfoNew; import nis.nms.service.CommonService; import nis.nms.util.BaseAction; +import nis.nms.util.Common; import nis.nms.util.Constant; import nis.nms.util.DateUtil; import nis.nms.util.ExportUtils; @@ -1013,18 +1016,25 @@ public class MonitorDataAction extends BaseAction { try { String[] linStrings = lines.split(",");// 选择的端口,可能是多个 String temp = ""; - String source = "select max(to_char(data_check_time,'yyyy-mm-dd HH24:mi')) maxTime," + sortFiledType[0] - + " from " + checkTypeInfo.getTableName() + " t where " + metadata.getFiledName() + " is not null" + String source = "select to_char(din.data_check_time,'yyyy-mm-dd HH24:mi') maxTime," + sortFiledType[0] + + " from " + checkTypeInfo.getTableName() + " t " + + " left join detection_info_new din on t.DETECTION_INFO_ID = din.DETECTION_INFO_ID " + + "where " + metadata.getFiledName() + " is not null" // +" and t.data_check_time >= trunc(sysdate-30)" - + " and t.detection_info_id in " + /*+ " and t.detection_info_id in " + "(select d.id from detection_info d where d.detection_set_info_id=" + dsiId + " and d.seq_id = " - + seqId + ")"; - + + seqId + ")";*/ + + " and din.seq_id =" + seqId + + " and din.detection_set_info_id=" +dsiId ; if (null != startTime && !startTime.equals("") && null != endTime && !endTime.equals("")) { source += " and to_char(data_check_time,'yyyy-mm-dd')>= '" + startTime + "' and to_char(data_check_time,'yyyy-mm-dd')<='" + endTime + "'"; } else { - source += " and t.data_check_time >= trunc(sysdate-1) "; + if(Constant.IS_MYSQL) { + source += " and t.data_check_time >= '" + Common.getDateStr(new Date(), "yyyy-MM-dd 00:00:00") +"' " ; + }else { + source += " and t.data_check_time >= trunc(sysdate-1) "; + } } if (sortFiledType[1].toString().equals("NUMBER") || sortFiledType[1].toString().equals("Number")) { temp = lines.substring(0, lines.length() - 1); @@ -1043,25 +1053,32 @@ public class MonitorDataAction extends BaseAction { // ------------------以上确定最后一个数据点---------------------------- if (lastList != null && lastList.size() > 0) { Object[] row = (Object[]) lastList.get(0); - String lastSource = "select * from ( select to_char(data_check_time,'yyyy-mm-dd HH24:mi')," - + metadata.getFiledName() + " from " + checkTypeInfo.getTableName() + " t where " + String lastSource = "select * from ( select to_char(t.data_check_time,'yyyy-mm-dd HH24:mi') data_check_time ," + + metadata.getFiledName() + " from " + checkTypeInfo.getTableName() + " t " + + " where " + metadata.getFiledName() + " is not null" // +" and t.data_check_time >= trunc(sysdate-30)" - + " and t.detection_info_id in " + /*+ " and t.detection_info_id in " + "(select d.id from detection_info d where d.detection_set_info_id=" + dsiId - + " and d.seq_id = " + seqId + ")"; - + + " and d.seq_id = " + seqId + ")";*/ + + " and t.seq_id =" + seqId + + " and t.detection_set_info_id=" +dsiId ; if (null != startTime && !startTime.equals("") && null != endTime && !endTime.equals("")) { - lastSource += " and to_char(data_check_time,'yyyy-mm-dd')>= '" + startTime - + "' and to_char(data_check_time,'yyyy-mm-dd')<='" + endTime + "'"; + lastSource += " and to_char(t.data_check_time,'yyyy-mm-dd')>= '" + startTime + + "' and to_char(t.data_check_time,'yyyy-mm-dd')<='" + endTime + "'"; } else { - lastSource += " and t.data_check_time >= trunc(sysdate-1) "; + if(Constant.IS_MYSQL) { + lastSource += " and t.data_check_time >= '" + Common.getDateStr(new Date(), "yyyy-MM-dd 00:00:00") +"' " ; + }else { + lastSource += " and t.data_check_time >= trunc(sysdate-1) "; + } } if (sortFiledType[1].toString().equals("NUMBER") || sortFiledType[1].toString().equals("Number")) { - lastSource += " and " + sortFiledType[0] + " = " + row[1] + " order by data_check_time desc) ttt "; + lastSource += " and " + sortFiledType[0] + " = " + row[1] + " order by din.data_check_time desc ) ttt "; } else if (sortFiledType[1].toString().indexOf("VARCHAR2") != -1) { - lastSource += " and " + sortFiledType[0] + " = '" + row[1] + "' order by data_check_time desc) ttt "; + lastSource += " and " + sortFiledType[0] + " = '" + row[1] + "' order by din.data_check_time desc) ttt "; } + lastSource += " order by data_check_time desc "; /* lastSource += " where rownum < 21"; */ // @2018年4月10日18:45:00 fang 修改rownum 适配 mysql @@ -2904,7 +2921,11 @@ public class MonitorDataAction extends BaseAction { source += " and to_char(data_check_time,'yyyy-mm-dd')>= '" + startTime + "' and to_char(data_check_time,'yyyy-mm-dd')<='" + endTime + "'"; } else { - source += " and t.data_check_time >= trunc(sysdate-1) "; + if(Constant.IS_MYSQL) { + source += " and t.data_check_time >= '" + Common.getDateStr(new Date(), "yyyy-MM-dd 00:00:00") +"' " ; + }else { + source += " and t.data_check_time >= trunc(sysdate-1) "; + } } if (sortFiledType[1].toString().equals("NUMBER") || sortFiledType[1].toString().equals("Number")) { @@ -2930,11 +2951,12 @@ public class MonitorDataAction extends BaseAction { source += " order by data_check_time_digital desc) tttt "; // @2018年4月10日18:45:00 fang 修改rownum 适配 mysql - if (Constant.IS_MYSQL) { + /*if (Constant.IS_MYSQL) { source = source + " order by data_check_time_digital asc limit 20"; } else { source += " where rownum < 21 order by data_check_time_digital asc";// 查询最近时间的21条数据 - } + }*/ + source += " order by data_check_time_digital asc"; System.out.println("------NoFirstInSource--------sql:" + source); List lineSourceList = this.commonService.executeSQL(source); @@ -3012,7 +3034,11 @@ public class MonitorDataAction extends BaseAction { source += " and to_char(data_check_time,'yyyy-mm-dd')>= '" + startTime + "' and to_char(data_check_time,'yyyy-mm-dd')<='" + endTime + "'"; } else { - source += " and t.data_check_time >= trunc(sysdate-1) ";// 默认查询一天的数据 + if(Constant.IS_MYSQL) { + source += " and t.data_check_time >= '" + Common.getDateStr(new Date(), "yyyy-MM-dd 00:00:00") +"' " ; + }else { + source += " and t.data_check_time >= trunc(sysdate-1) "; + } } if (sortFiledType[1].toString().equals("NUMBER") || sortFiledType[1].toString().equals("Number")) { @@ -3032,11 +3058,12 @@ public class MonitorDataAction extends BaseAction { * ;//查询最近时间的21条数据 */ // @2018年4月10日18:45:00 fang 修改rownum 适配 mysql - if (Constant.IS_MYSQL) { + /*if (Constant.IS_MYSQL) { source = source + " order by data_check_time_digital asc limit 20"; } else { source += " where rownum < 21 order by data_check_time_digital asc";// 查询最近时间的21条数据 - } + }*/ + source = source + " order by data_check_time_digital asc"; System.out.println("------source--------sql:" + source); List lineSourceList = this.commonService.executeSQL(source); @@ -3097,7 +3124,9 @@ public class MonitorDataAction extends BaseAction { String jsonStr = JSONArray.fromObject(returnList).toString(); System.out.println(jsonStr); - this.getResponse().setCharacterEncoding("utf-8"); + HttpServletResponse response = this.getResponse(); + response.setCharacterEncoding("utf-8"); + response.setContentType("application/json"); PrintWriter printWriter = this.getResponse().getWriter(); printWriter.write(jsonStr); printWriter.close(); diff --git a/src/nis/nms/web/actions/detection/PoliceSetAction.java b/src/nis/nms/web/actions/detection/PoliceSetAction.java index 0bc3ec2..db0e985 100644 --- a/src/nis/nms/web/actions/detection/PoliceSetAction.java +++ b/src/nis/nms/web/actions/detection/PoliceSetAction.java @@ -235,10 +235,10 @@ public class PoliceSetAction extends BaseAction { + dataPoliceRelation.getMetadata().getId(); List list = this.commonService.executeSQL(sql); int num = Integer.parseInt(list.get(0).toString()); - if (num > 0) { + /*if (num > 0) { this.outHtmlString(""); return; - } + }*/ Metadata metadata = (Metadata) this.commonService.get( Metadata.class, dataPoliceRelation.getMetadata().getId()); @@ -286,10 +286,10 @@ public class PoliceSetAction extends BaseAction { "from DataPoliceRelation where detectionSetInfo.id=? and metadata.id=? and id<>?", Long.valueOf(detectionSetInfoId), dataPoliceRelation.getMetadata().getId(), dataPoliceRelation .getId()); - if (list != null && list.size() > 0) { + /*if (list != null && list.size() > 0) { this.outHtmlString(""); return; - } + }*/ DataPoliceRelation dpRelation = (DataPoliceRelation) this.commonService .get(DataPoliceRelation.class, dataPoliceRelation.getId()); DetectionSetInfo ds = null; diff --git a/src/nis/nms/web/actions/detection/SwitchDetectionAction.java b/src/nis/nms/web/actions/detection/SwitchDetectionAction.java index 6757af9..964ed69 100644 --- a/src/nis/nms/web/actions/detection/SwitchDetectionAction.java +++ b/src/nis/nms/web/actions/detection/SwitchDetectionAction.java @@ -167,6 +167,7 @@ public class SwitchDetectionAction extends BaseAction { if (!com.nis.util.StringUtil.isBlank(requestType) && requestType.equals("topo")) { resultpage = totalSwitchInfoStatisticsForTopo(); } else { + this.networElementType = "1"; resultpage = totalSwitchInfoStatistics(); }