实时报表->事件报表(查询,界面,导出):1.事件监测 2.事件封堵 3.重点保障

This commit is contained in:
lihaochen
2018-12-25 18:40:58 +08:00
parent b6b5bf190a
commit 84c4423a78
11 changed files with 1642 additions and 4 deletions

View File

@@ -0,0 +1,228 @@
package com.nis.web.controller.report;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
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.servlet.mvc.support.RedirectAttributes;
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.maat.LogRecvData;
import com.nis.domain.report.NtcEventMonitorOrBlockReport;
import com.nis.util.Constants;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
@Controller
@RequestMapping("${adminPath}/eventBlock")
public class NtcEventBlockController extends BaseController {
/**
* EventBlock
*
* @param log
* @param model
* @param request
* @param response
* @return
*/
@RequestMapping(value = { "/eventBlockList", "" })
public String eventBlockList(@ModelAttribute("log") NtcEventMonitorOrBlockReport log, Model model,
HttpServletRequest request, HttpServletResponse response) {
try {
PageLog<NtcEventMonitorOrBlockReport> page = new PageLog<NtcEventMonitorOrBlockReport>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
// 判断请求参数
if (StringUtils.isNotBlank(log.getSearchReportStartTime())
&& StringUtils.isNotBlank(log.getSearchReportEndTime())) {
params.put("searchReportStartTime", log.getSearchReportStartTime());
params.put("searchReportEndTime", log.getSearchReportEndTime());
}
if (StringUtils.isNotBlank(log.getSearchTaskStartTime())
&& StringUtils.isNotBlank(log.getSearchTaskEndTime())) {
params.put("searchTaskStartTime", log.getSearchTaskStartTime());
params.put("searchTaskEndTime", log.getSearchTaskEndTime());
}
if (StringUtils.isNotBlank(log.getTaskName())) {
params.put("taskName", log.getTaskName());
}
if (StringUtils.isNotBlank(log.getTaskId())) {
params.put("taskId", log.getTaskId());
}
params.put("reportType", 1);
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
// String url =
// "http://192.168.11.56:8080/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock?reportType=1";
String recv = HttpClientUtil.getMsg(url, params, request);
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcEventMonitorOrBlockReport> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<NtcEventMonitorOrBlockReport>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcEventMonitorOrBlockReport> data = fromJson.getData();
page.setCount(data.getCount());
page.setLast(data.getLast());
page.setList(data.getList());
model.addAttribute("page", page);
}
}
} catch (Exception e) {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/report/eventBlockList";
}
// eventMonitorExport
@RequestMapping(value = "eventBlockExport")
public void eventBlockExport(@ModelAttribute("log") NtcEventMonitorOrBlockReport log, Model model, String hColumns,
String type, HttpServletRequest request, HttpServletResponse response,
RedirectAttributes redirectAttributes) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcEventMonitorOrBlockReport> page = new PageLog<NtcEventMonitorOrBlockReport>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
// 判断请求参数
if (StringUtils.isNotBlank(log.getSearchReportStartTime())
&& StringUtils.isNotBlank(log.getSearchReportEndTime())) {
params.put("searchReportStartTime", log.getSearchReportStartTime());
params.put("searchReportEndTime", log.getSearchReportEndTime());
}
if (StringUtils.isNotBlank(log.getSearchTaskStartTime())
&& StringUtils.isNotBlank(log.getSearchTaskEndTime())) {
params.put("searchTaskStartTime", log.getSearchTaskStartTime());
params.put("searchTaskEndTime", log.getSearchTaskEndTime());
}
if (StringUtils.isNotBlank(log.getTaskName())) {
params.put("taskName", log.getTaskName());
}
if (StringUtils.isNotBlank(log.getTaskId())) {
params.put("taskId", log.getTaskId());
}
params.put("reportType", 1);
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
// String url =
// "http://192.168.11.56:8080/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock?reportType=1";
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcEventMonitorOrBlockReport> list = new ArrayList<>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcEventMonitorOrBlockReport> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<NtcEventMonitorOrBlockReport>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcEventMonitorOrBlockReport> data = fromJson.getData();
list = data.getList();
}
}
//
titleList.add("ntc_event_block_report");
classMap.put("ntc_event_block_report", NtcEventMonitorOrBlockReport.class);
String cfgIndexInfoNoExport = "";
noExportMap.put("ntc_event_block_report", cfgIndexInfoNoExport);
Properties msgProp = getMsgProp();
NtcEventMonitorOrBlockReport ntcEventMonitorOrBlockReport = new NtcEventMonitorOrBlockReport();
long ipNum = 0;
long httpNum = 0;
long mailNum = 0;
long vedioNum = 0;
long agentNum = 0;
for (NtcEventMonitorOrBlockReport entity : list) {
ipNum += entity.getIpNum();
httpNum += entity.getHttpNum();
mailNum += entity.getMailNum();
vedioNum += entity.getVedioNum();
agentNum += entity.getAgentNum();
}
String report_total = msgProp.getProperty("report_total");
ntcEventMonitorOrBlockReport.setIpNum(ipNum);
ntcEventMonitorOrBlockReport.setHttpNum(httpNum);
ntcEventMonitorOrBlockReport.setMailNum(mailNum);
ntcEventMonitorOrBlockReport.setVedioNum(vedioNum);
ntcEventMonitorOrBlockReport.setAgentNum(agentNum);
ntcEventMonitorOrBlockReport.setTaskId(report_total);
ntcEventMonitorOrBlockReport.setTaskName("    一   ");
ntcEventMonitorOrBlockReport.setTaskTime("    一   ");
ntcEventMonitorOrBlockReport.setReportTime("    一   ");
list.add(ntcEventMonitorOrBlockReport);
dataMap.put("ntc_event_block_report", list);
String timeRange = initHttpMap(log, "ntc_event_block_report");
noExportMap.put("timeRange", timeRange);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "ntc_event_block_report", titleList,
classMap, dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "ntc_event_block_report", titleList,
classMap, dataMap, noExportMap);
}
} catch (Exception e) {
logger.error("ntc_event_block_report export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
public String initHttpMap(NtcEventMonitorOrBlockReport log, String title) {
Properties msgProp = getMsgProp();
String logTime = msgProp.getProperty(title, title);
;
if (StringUtils.isNotBlank(log.getSearchReportStartTime())) {
logTime += " " + msgProp.getProperty("begin_date") + "" + log.getSearchReportStartTime();
}
if (StringUtils.isNotBlank(log.getSearchReportEndTime())) {
logTime += " " + msgProp.getProperty("end_date") + "" + log.getSearchReportEndTime();
}
if (StringUtils.isNotBlank(log.getSearchTaskStartTime())) {
logTime += " " + msgProp.getProperty("task_begin_time") + "" + log.getSearchTaskStartTime();
}
if (StringUtils.isNotBlank(log.getSearchTaskEndTime())) {
logTime += " " + msgProp.getProperty("task_end_time") + "" + log.getSearchTaskEndTime();
}
return logTime;
}
}

View File

@@ -0,0 +1,221 @@
package com.nis.web.controller.report;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
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.servlet.mvc.support.RedirectAttributes;
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.maat.LogRecvData;
import com.nis.domain.report.NtcEventKeyProtectionReport;
import com.nis.util.Constants;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
@Controller
@RequestMapping("${adminPath}/eventKeyProtection")
public class NtcEventKeyProtectionController extends BaseController {
/**
* EventBlock
*
* @param log
* @param model
* @param request
* @param response
* @return
*/
@RequestMapping(value = { "/eventKeyProtectionList", "" })
public String eventKeyProtectionList(@ModelAttribute("log") NtcEventKeyProtectionReport log, Model model,
HttpServletRequest request, HttpServletResponse response) {
try {
PageLog<NtcEventKeyProtectionReport> page = new PageLog<NtcEventKeyProtectionReport>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
// 判断请求参数
if (StringUtils.isNotBlank(log.getSearchReportStartTime())
&& StringUtils.isNotBlank(log.getSearchReportEndTime())) {
params.put("searchReportStartTime", log.getSearchReportStartTime());
params.put("searchReportEndTime", log.getSearchReportEndTime());
}
if (StringUtils.isNotBlank(log.getSearchTaskStartTime())
&& StringUtils.isNotBlank(log.getSearchTaskEndTime())) {
params.put("searchTaskStartTime", log.getSearchTaskStartTime());
params.put("searchTaskEndTime", log.getSearchTaskEndTime());
}
if (StringUtils.isNotBlank(log.getTaskName())) {
params.put("taskName", log.getTaskName());
}
if (StringUtils.isNotBlank(log.getTaskId())) {
params.put("taskId", log.getTaskId());
}
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
// String url =
// "http://192.168.11.56:8080/galaxy-service/service/log/v1/ntcEventKeyProtection";
String recv = HttpClientUtil.getMsg(url, params, request);
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcEventKeyProtectionReport> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<NtcEventKeyProtectionReport>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcEventKeyProtectionReport> data = fromJson.getData();
page.setCount(data.getCount());
page.setLast(data.getLast());
page.setList(data.getList());
model.addAttribute("page", page);
}
}
} catch (Exception e) {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/report/eventKeyProtectionList";
}
// eventMonitorExport
@RequestMapping(value = "eventKeyProtectionExport")
public void eventKeyProtectionExport(@ModelAttribute("log") NtcEventKeyProtectionReport log, Model model,
String hColumns, String type, HttpServletRequest request, HttpServletResponse response,
RedirectAttributes redirectAttributes) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcEventKeyProtectionReport> page = new PageLog<NtcEventKeyProtectionReport>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
// 判断请求参数
if (StringUtils.isNotBlank(log.getSearchReportStartTime())
&& StringUtils.isNotBlank(log.getSearchReportEndTime())) {
params.put("searchReportStartTime", log.getSearchReportStartTime());
params.put("searchReportEndTime", log.getSearchReportEndTime());
}
if (StringUtils.isNotBlank(log.getSearchTaskStartTime())
&& StringUtils.isNotBlank(log.getSearchTaskEndTime())) {
params.put("searchTaskStartTime", log.getSearchTaskStartTime());
params.put("searchTaskEndTime", log.getSearchTaskEndTime());
}
if (StringUtils.isNotBlank(log.getTaskName())) {
params.put("taskName", log.getTaskName());
}
if (StringUtils.isNotBlank(log.getTaskId())) {
params.put("taskId", log.getTaskId());
}
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
// String url =
// "http://192.168.11.56:8080/galaxy-service/service/log/v1/ntcEventKeyProtection";
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcEventKeyProtectionReport> list = new ArrayList<>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcEventKeyProtectionReport> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<NtcEventKeyProtectionReport>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcEventKeyProtectionReport> data = fromJson.getData();
list = data.getList();
}
}
//
titleList.add("ntc_event_key_protection_report");
classMap.put("ntc_event_key_protection_report", NtcEventKeyProtectionReport.class);
String cfgIndexInfoNoExport = "";
noExportMap.put("ntc_event_key_protection_report", cfgIndexInfoNoExport);
Properties msgProp = getMsgProp();
NtcEventKeyProtectionReport ntcEventKeyProtectionReport = new NtcEventKeyProtectionReport();
long letterNum = 0;
long configNum = 0;
long monitorNum = 0;
long controlNum = 0;
for (NtcEventKeyProtectionReport entity : list) {
letterNum += entity.getLetterNum();
configNum += entity.getConfigNum();
monitorNum += entity.getMonitorNum();
controlNum += entity.getControlNum();
}
String report_total = msgProp.getProperty("report_total");
ntcEventKeyProtectionReport.setLetterNum(letterNum);
ntcEventKeyProtectionReport.setConfigNum(configNum);
ntcEventKeyProtectionReport.setMonitorNum(monitorNum);
ntcEventKeyProtectionReport.setControlNum(controlNum);
ntcEventKeyProtectionReport.setTaskId(report_total);
ntcEventKeyProtectionReport.setTaskName("     一     ");
ntcEventKeyProtectionReport.setTaskTime("     一     ");
ntcEventKeyProtectionReport.setReportTime("    一     ");
list.add(ntcEventKeyProtectionReport);
dataMap.put("ntc_event_key_protection_report", list);
String timeRange = initHttpMap(log, "ntc_event_key_protection_report");
noExportMap.put("timeRange", timeRange);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "ntc_event_key_protection_report",
titleList, classMap, dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "ntc_event_key_protection_report", titleList,
classMap, dataMap, noExportMap);
}
} catch (Exception e) {
logger.error("ntc_event_key_protection_report export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
public String initHttpMap(NtcEventKeyProtectionReport log, String title) {
Properties msgProp = getMsgProp();
String logTime = msgProp.getProperty(title, title);
;
if (StringUtils.isNotBlank(log.getSearchReportStartTime())) {
logTime += " " + msgProp.getProperty("begin_date") + "" + log.getSearchReportStartTime();
}
if (StringUtils.isNotBlank(log.getSearchReportEndTime())) {
logTime += " " + msgProp.getProperty("end_date") + "" + log.getSearchReportEndTime();
}
if (StringUtils.isNotBlank(log.getSearchTaskStartTime())) {
logTime += " " + msgProp.getProperty("task_begin_time") + "" + log.getSearchTaskStartTime();
}
if (StringUtils.isNotBlank(log.getSearchTaskEndTime())) {
logTime += " " + msgProp.getProperty("task_end_time") + "" + log.getSearchTaskEndTime();
}
return logTime;
}
}

View File

@@ -0,0 +1,231 @@
package com.nis.web.controller.report;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
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.servlet.mvc.support.RedirectAttributes;
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.maat.LogRecvData;
import com.nis.domain.report.BaseReport;
import com.nis.domain.report.NtcEventMonitorOrBlockReport;
import com.nis.domain.report.NtcURLReport;
import com.nis.util.Constants;
import com.nis.util.DateUtils;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
@Controller
@RequestMapping("${adminPath}/eventMonitor")
public class NtcEventMonitorController extends BaseController {
/**
* EventMonitor
*
* @param log
* @param model
* @param request
* @param response
* @return
*/
@RequestMapping(value = { "/eventMonitorList", "" })
public String eventMonitorList(@ModelAttribute("log") NtcEventMonitorOrBlockReport log, Model model,
HttpServletRequest request, HttpServletResponse response) {
try {
PageLog<NtcEventMonitorOrBlockReport> page = new PageLog<NtcEventMonitorOrBlockReport>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
// 判断请求参数
if (StringUtils.isNotBlank(log.getSearchReportStartTime())
&& StringUtils.isNotBlank(log.getSearchReportEndTime())) {
params.put("searchReportStartTime", log.getSearchReportStartTime());
params.put("searchReportEndTime", log.getSearchReportEndTime());
}
if (StringUtils.isNotBlank(log.getSearchTaskStartTime())
&& StringUtils.isNotBlank(log.getSearchTaskEndTime())) {
params.put("searchTaskStartTime", log.getSearchTaskStartTime());
params.put("searchTaskEndTime", log.getSearchTaskEndTime());
}
if (StringUtils.isNotBlank(log.getTaskName())) {
params.put("taskName", log.getTaskName());
}
if (StringUtils.isNotBlank(log.getTaskId())) {
params.put("taskId", log.getTaskId());
}
params.put("reportType", 2);
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
// String url =
// "http://192.168.11.56:8080/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock?reportType=2";
String recv = HttpClientUtil.getMsg(url, params, request);
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcEventMonitorOrBlockReport> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<NtcEventMonitorOrBlockReport>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcEventMonitorOrBlockReport> data = fromJson.getData();
page.setCount(data.getCount());
page.setLast(data.getLast());
page.setList(data.getList());
model.addAttribute("page", page);
}
}
} catch (Exception e) {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/report/eventMonitorList";
}
// eventMonitorExport
@RequestMapping(value = "eventMonitorExport")
public void eventMonitorExport(@ModelAttribute("log") NtcEventMonitorOrBlockReport log, Model model,
String hColumns, String type, HttpServletRequest request, HttpServletResponse response,
RedirectAttributes redirectAttributes) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcEventMonitorOrBlockReport> page = new PageLog<NtcEventMonitorOrBlockReport>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
// 判断请求参数
if (StringUtils.isNotBlank(log.getSearchReportStartTime())
&& StringUtils.isNotBlank(log.getSearchReportEndTime())) {
params.put("searchReportStartTime", log.getSearchReportStartTime());
params.put("searchReportEndTime", log.getSearchReportEndTime());
}
if (StringUtils.isNotBlank(log.getSearchTaskStartTime())
&& StringUtils.isNotBlank(log.getSearchTaskEndTime())) {
params.put("searchTaskStartTime", log.getSearchTaskStartTime());
params.put("searchTaskEndTime", log.getSearchTaskEndTime());
}
if (StringUtils.isNotBlank(log.getTaskName())) {
params.put("taskName", log.getTaskName());
}
if (StringUtils.isNotBlank(log.getTaskId())) {
params.put("taskId", log.getTaskId());
}
params.put("reportType", 2);
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
// String url =
// "http://192.168.11.56:8080/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock?reportType=2";
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcEventMonitorOrBlockReport> list = new ArrayList<>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcEventMonitorOrBlockReport> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<NtcEventMonitorOrBlockReport>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcEventMonitorOrBlockReport> data = fromJson.getData();
list = data.getList();
}
}
//
titleList.add("ntc_event_monitor_report");
classMap.put("ntc_event_monitor_report", NtcEventMonitorOrBlockReport.class);
String cfgIndexInfoNoExport = "";
noExportMap.put("ntc_event_monitor_report", cfgIndexInfoNoExport);
Properties msgProp = getMsgProp();
NtcEventMonitorOrBlockReport ntcEventMonitorOrBlockReport = new NtcEventMonitorOrBlockReport();
long ipNum = 0;
long httpNum = 0;
long mailNum = 0;
long vedioNum = 0;
long agentNum = 0;
for (NtcEventMonitorOrBlockReport entity : list) {
ipNum += entity.getIpNum();
httpNum += entity.getHttpNum();
mailNum += entity.getMailNum();
vedioNum += entity.getVedioNum();
agentNum += entity.getAgentNum();
}
String report_total = msgProp.getProperty("report_total");
ntcEventMonitorOrBlockReport.setIpNum(ipNum);
ntcEventMonitorOrBlockReport.setHttpNum(httpNum);
ntcEventMonitorOrBlockReport.setMailNum(mailNum);
ntcEventMonitorOrBlockReport.setVedioNum(vedioNum);
ntcEventMonitorOrBlockReport.setAgentNum(agentNum);
ntcEventMonitorOrBlockReport.setTaskId(report_total);
ntcEventMonitorOrBlockReport.setTaskName("    一   ");
ntcEventMonitorOrBlockReport.setTaskTime("    一   ");
ntcEventMonitorOrBlockReport.setReportTime("    一   ");
list.add(ntcEventMonitorOrBlockReport);
dataMap.put("ntc_event_monitor_report", list);
String timeRange = initHttpMap(log, "ntc_event_monitor_report");
noExportMap.put("timeRange", timeRange);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "ntc_event_monitor_report", titleList,
classMap, dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "ntc_event_monitor_report", titleList,
classMap, dataMap, noExportMap);
}
} catch (Exception e) {
logger.error("ntc_event_monitor_report export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
public String initHttpMap(NtcEventMonitorOrBlockReport log, String title) {
Properties msgProp = getMsgProp();
String logTime = msgProp.getProperty(title, title);
;
if (StringUtils.isNotBlank(log.getSearchReportStartTime())) {
logTime += " " + msgProp.getProperty("begin_date") + "" + log.getSearchReportStartTime();
}
if (StringUtils.isNotBlank(log.getSearchReportEndTime())) {
logTime += " " + msgProp.getProperty("end_date") + "" + log.getSearchReportEndTime();
}
if (StringUtils.isNotBlank(log.getSearchTaskStartTime())) {
logTime += " " + msgProp.getProperty("task_begin_time") + "" + log.getSearchTaskStartTime();
}
if (StringUtils.isNotBlank(log.getSearchTaskEndTime())) {
logTime += " " + msgProp.getProperty("task_end_time") + "" + log.getSearchTaskEndTime();
}
return logTime;
}
}