上步漏提交的

This commit is contained in:
chenjinsong
2018-08-17 16:27:16 +08:00
parent 9888290add
commit a7d2b937a5
3 changed files with 329 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
package com.nis.domain.log;
public class NtBgpLog extends BaseLogEntity<NtBgpLog> {
private static final long serialVersionUID = 1000090441108515598L;
}

View File

@@ -0,0 +1,71 @@
package com.nis.web.controller.log.ntc;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.util.FileUtil;
import org.springframework.beans.BeanUtils;
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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.nis.domain.Page;
import com.nis.domain.PageLog;
import com.nis.domain.log.NtcIpLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
@Controller
@RequestMapping("${adminPath}/log/ntc/other/bgpLogs")
public class BgpLogController extends BaseController {
@RequestMapping(value = {"list", ""})
public String list(@ModelAttribute("log") NtcIpLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
try {
PageLog<NtcIpLog> page = new PageLog<NtcIpLog>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
initLogSearchValue(log, params);
String url = Constants.LOG_BASE_URL + Constants.NTC_BGP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
logger.info("查询结果:" + recv);
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcIpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcIpLog>>(){}.getType());
if (fromJson.getStatus().intValue() == 200) {
page.setList(fromJson.getData().getList());
List<NtcIpLog> list = page.getList();
for (NtcIpLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l);
}
model.addAttribute("page", page);
}
}
} catch (Exception e) {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/bgpList";
}
}

View File

@@ -0,0 +1,251 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title>
BGP<spring:message code="log"></spring:message>
</title>
<script>
$(document).ready(function() {
//reset
$("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){
$(this).selectpicker('val',$(this).find('option:first').val());
$(this).find("option").attr("selected",false);
$(this).find("option:first").attr("selected",true);
});
$(".Wdate").attr("value",'');
$(':input','#searchForm')
.not(':button,:submit,:reset,:hidden')
.attr("value",'');
$("#searchForm")[0].reset();
});
//筛选功能
filterActionInit();
});
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
</div>
<h3 class="page-title">
<spring:message code="bgp_control"/>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="log" action="${ctx}/log/ntc/other/bgpLogs" method="post" class="form-search">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<input id="functionId" name="functionId" type="hidden" value="${log.functionId}"/>
<!-- 筛选按钮展开状态-->
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${log.isFilterAction }"/>
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
<div class="pull-left">
<form:select path="action" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="action"/></form:option>
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="dict">
<c:if test="${(dict.itemValue eq 'action_monit') or (dict.itemValue eq 'action_reject')}">
<form:option value="${dict.itemCode}"><spring:message code="${dict.itemValue}"/></form:option>
</c:if>
</c:forEach>
</form:select>
</div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
</div>
<input name="searchFoundStartTime" type="text" readonly="readonly" maxlength="20" class="form-control Wdate input-medium"
value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
</div>
<input name="searchFoundEndTime" type="text" readonly="readonly" maxlength="20" class="form-control Wdate input-medium"
value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="pull-left">
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/><i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
</a>
</div>
</div>
<!-- 搜索内容与操作按钮栏 -->
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label class="control-label"><spring:message code='protocol_type'/></label>
<form:select path="transProto" class="selectpicker form-control">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="protocol" >
<form:option value="${protocol.itemCode}"><spring:message code="${protocol.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label class="control-label"><spring:message code='direct'/></label>
<form:select path="direction" class="selectpicker form-control">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="direction" >
<form:option value="${direction.itemCode}"><spring:message code="${direction.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="entrance"/></label>
<form:select path="entranceId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="entrance" >
<form:option value="${entrance.itemCode}"><spring:message code="${entrance.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="clj_ip"></spring:message></label>
<input name="capIp" type="text" class="form-control" value="${log.capIp }"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="clientip"></spring:message></label>
<input name="sIp" type="text" class="form-control" value="${log.sIp }"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="serverip"></spring:message></label>
<input name="dIp" type="text" class="form-control" value="${log.dIp }"/>
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<div class="table-responsive">
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap logTb">
<thead>
<tr>
<th><spring:message code="cfg_id"/></th>
<th><spring:message code="action"/></th>
<th><spring:message code="found_time"/></th>
<th><spring:message code="entrance"/></th>
<th><spring:message code="clj_ip"/></th>
<th><spring:message code="protocol"/></th>
<th><spring:message code='addr_type'/></th>
<th><spring:message code="server_ip"/></th>
<th><spring:message code="client_ip"/></th>
<th><spring:message code="server_port"/></th>
<th><spring:message code="client_port"/></th>
<th><spring:message code="deviceid"/></th>
<th><spring:message code="direction"/></th>
<th><spring:message code="stream_type"/></th>
<%-- <th><spring:message code="nest_addr_list"/></th> --%>
<th><spring:message code='server_locate'/></th>
<th><spring:message code='client_locate'/></th>
<th><spring:message code='s_asn'/></th>
<th><spring:message code='d_asn'/></th>
<th><spring:message code='s_subscribe_id'/></th>
<th><spring:message code='d_subscribe_id'/></th>
<th><spring:message code='scene_file'/></th>
</tr>
</thead>
<tbody>
<c:forEach var="log" items="${page.list }" varStatus="status">
<tr>
<td>${log.cfgId }
<a href="javascript:void(0)" name="viewLogInfo"><i class="icon-book-open"></i></a>
</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="dict">
<c:if test="${dict.itemCode eq log.action}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</td>
<td>${log.foundTime }</td>
<td>
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="dic">
<c:if test="${dic.itemCode eq log.entranceId}">
<spring:message code="${dic.itemValue}"/>
</c:if>
</c:forEach>
</td>
<td title="${log.capIp }">${fns:abbr(log.capIp, 42)}</td>
<td>${log.transProto }</td>
<td>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
</c:forEach>
</td>
<td title="${log.dIp }">${fns:abbr(log.dIp, 42)}</td>
<td title="${log.sIp }">${fns:abbr(log.sIp, 42)}</td>
<td>${log.dPort }</td>
<td>${log.sPort }</td>
<td>
<c:forEach items="${fns:getDictList('DEVICE')}" var="device">
<c:if test="${device.itemCode eq log.deviceId}"><spring:message code="${device.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="direction">
<c:if test="${direction.itemCode eq log.direction}"><spring:message code="${direction.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('LOG_STREAM_TYPE')}" var="streamType">
<c:if test="${streamType.itemCode eq log.streamDir}">${streamType.itemValue}</c:if>
</c:forEach>
</td>
<%-- <td>${log.addrList }</td> --%>
<td>${log.serverLocate}</td>
<td>${log.clientLocate}</td>
<td>${log.sAsn}</td>
<td>${log.dAsn}</td>
<td>${log.sSubscribeId}</td>
<td>${log.dSubscribeId}</td>
<td>${log.sceneFile}</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>