1.日志总量查询日志修改 2.提交p2p监测sql

This commit is contained in:
zhangwenqing
2018-09-13 16:46:56 +08:00
parent ae5cb30aa1
commit 14c02a80ee
35 changed files with 67 additions and 34 deletions

View File

@@ -40,6 +40,8 @@ public class BaseLogEntity<T> extends BaseEntity<T> {
protected String searchFoundStartTime;//开始时间格式为yyyy-mm-dd hh24:mi:ss
protected String searchFoundEndTime;//结束时间,格式同上
protected String isLogTotalSearch;//由配置列表点击日志总量进行查询的标识
public String getFoundTime() {
return foundTime;
}
@@ -220,27 +222,24 @@ public class BaseLogEntity<T> extends BaseEntity<T> {
public void setDate(String date) {
this.date = date;
}
public String getIsLogTotalSearch() {
return isLogTotalSearch;
}
public void setIsLogTotalSearch(String isLogTotalSearch) {
this.isLogTotalSearch = isLogTotalSearch;
}
@Override
public String toString() {
return "{\"cfgId\"=\"" + cfgId + "\", \"foundTime\"=\"" + foundTime
+ "\", \"recvTime\"=\"" + recvTime + "\", \"transProto\"=\""
+ transProto + "\", \"addrType\"=\"" + addrType
+ "\", \"dIp\"=\"" + dIp + "\", \"sIp\"=\"" + sIp
+ "\", \"dPort\"=\"" + dPort + "\", \"sPort\"=\"" + sPort
+ "\", \"service\"=\"" + service + "\", \"entranceId\"=\""
+ entranceId + "\", \"deviceId\"=\"" + deviceId
+ "\", \"direction\"=\"" + direction + "\", \"streamDir\"=\""
+ streamDir + "\", \"capIp\"=\"" + capIp
+ "\", \"addrList\"=\"" + addrList + "\", \"serverLocate\"=\""
+ serverLocate + "\", \"clientLocate\"=\"" + clientLocate
+ "\", \"userRegion\"=\"" + userRegion + "\", \"sAsn\"=\""
+ sAsn + "\", \"dAsn\"=\"" + dAsn + "\", \"sSubscribeId\"=\""
+ sSubscribeId + "\", \"dSubscribeId\"=\"" + dSubscribeId
+ "\", \"sceneFile\"=\"" + sceneFile + "\", \"functionId\"=\""
+ functionId + "\", \"action\"=\"" + action
+ "\", \"seltype\"=\"" + seltype
+ "\", \"searchFoundStartTime\"=\"" + searchFoundStartTime
+ "\", \"searchFoundEndTime\"=\"" + searchFoundEndTime + "}";
return "BaseLogEntity [cfgId=" + cfgId + ", foundTime=" + foundTime + ", recvTime=" + recvTime + ", transProto="
+ transProto + ", addrType=" + addrType + ", dIp=" + dIp + ", sIp=" + sIp + ", dPort=" + dPort
+ ", sPort=" + sPort + ", service=" + service + ", entranceId=" + entranceId + ", deviceId=" + deviceId
+ ", direction=" + direction + ", streamDir=" + streamDir + ", capIp=" + capIp + ", addrList="
+ addrList + ", serverLocate=" + serverLocate + ", clientLocate=" + clientLocate + ", userRegion="
+ userRegion + ", sAsn=" + sAsn + ", dAsn=" + dAsn + ", sSubscribeId=" + sSubscribeId
+ ", dSubscribeId=" + dSubscribeId + ", sceneFile=" + sceneFile + ", functionId=" + functionId
+ ", action=" + action + ", date=" + date + ", seltype=" + seltype + ", searchFoundStartTime="
+ searchFoundStartTime + ", searchFoundEndTime=" + searchFoundEndTime + ", isLogTotalSearch="
+ isLogTotalSearch + "]";
}

View File

@@ -674,7 +674,7 @@ public class BaseController {
params.put("searchFoundEndTime", entry.getSearchFoundEndTime());
}else{
// 判断是否是从配置界面过来的日志查询
if(entry.getCfgId() != null) {
if(StringUtils.isNotBlank(entry.getIsLogTotalSearch())) {
// 判断startTime是否有值
if(StringUtils.isNotBlank(Constants.LOG_TIME_START)) {
String endTime = Constants.LOG_TIME_END;
@@ -687,7 +687,9 @@ public class BaseController {
entry.setSearchFoundEndTime(endTime);
}else {
Calendar startTimeCal = Calendar.getInstance();
startTimeCal.setTimeInMillis(Long.parseLong(entry.getDate()));// 同步日志总量查询时间
if(StringUtils.isNotEmpty(entry.getDate())) {
startTimeCal.setTimeInMillis(Long.parseLong(entry.getDate()));// 同步日志总量查询时间
}
// 时间间隔
int interval = Constants.LOG_TIME_RANGE/1000/60;
if(interval < 60) {
@@ -702,7 +704,7 @@ public class BaseController {
}
Calendar endTimeCal = Calendar.getInstance();
endTimeCal.setTimeInMillis(startTimeCal.getTimeInMillis());
endTimeCal.add(Calendar.SECOND, -1);
//endTimeCal.add(Calendar.SECOND, -1);
startTimeCal.add(Calendar.MINUTE, -interval); //开始时间减去时间间隔

View File

@@ -15,8 +15,8 @@ import com.nis.web.controller.BaseController;
public class LogSearchController extends BaseController{
@RequestMapping(value = {"list",""})
public String LogSearch(BaseLogEntity<Object> entity, Integer compileId,RedirectAttributes attr,
HttpServletRequest request, HttpServletResponse response) {
public String LogSearch(BaseLogEntity<Object> entity, RedirectAttributes attr, HttpServletRequest request,
HttpServletResponse response) {
/**
* url: logUrl
* searchCfgId: compileId
@@ -26,10 +26,11 @@ public class LogSearchController extends BaseController{
String logUrl = menuService.getLogUrl(entity.getFunctionId());
Integer serviceId = menuService.getServiceId(entity.getFunctionId(),entity.getAction());
attr.addAttribute("cfgId", compileId);
attr.addAttribute("service", serviceId);
attr.addAttribute("cfgId", entity.getCfgId());
attr.addAttribute("functionId", entity.getFunctionId());
attr.addAttribute("date", entity.getDate());
attr.addAttribute("isLogTotalSearch", entity.getIsLogTotalSearch());
return "redirect:"+adminPath+logUrl;
}
}