diff --git a/src/main/java/com/nis/domain/restful/EventKeyProtection.java b/src/main/java/com/nis/domain/restful/EventKeyProtection.java new file mode 100644 index 0000000..13d811a --- /dev/null +++ b/src/main/java/com/nis/domain/restful/EventKeyProtection.java @@ -0,0 +1,168 @@ +package com.nis.domain.restful; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.nis.util.JsonDateSerializer; +import com.wordnik.swagger.annotations.ApiModel; +import com.wordnik.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +import org.apache.commons.httpclient.util.DateUtil; + +/** + * @author GouGe + * @data 2018/12/24 15:35 + */ +@ApiModel(value = "重点保障事件对象", description = "用来封装重点事件保障") +public class EventKeyProtection { + private static final long serialVersionUID = -3597060253861898787L; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "审核时间") + private Date taskTime; + + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "统计时间") + private Date reportTime; + + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "事件名称") + private String taskName; + + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "事件ID") + private long taskId; + + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "来函件数") + private long letterNum; + + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "配置总数") + private long configNum; + + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "监测数量") + private long monitorNum; + + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "管控数量") + private long controlNum; + + private String searchReportStartTime; + private String searchReportEndTime; + private String searchTaskStartTime; + private String searchTaskEndTime; + + + @JsonSerialize(using = JsonDateSerializer.class) + public Date getTaskTime() { + return taskTime; + } + + public void setTaskTime(Date taskTime) { + this.taskTime = taskTime; + } + + public String getTaskName() { + return taskName; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + public long getLetterNum() { + return letterNum; + } + + public void setLetterNum(long letterNum) { + this.letterNum = letterNum; + } + + public long getConfigNum() { + return configNum; + } + + public void setConfigNum(long configNum) { + this.configNum = configNum; + } + + public long getMonitorNum() { + return monitorNum; + } + + public void setMonitorNum(long monitorNum) { + this.monitorNum = monitorNum; + } + + public long getControlNum() { + return controlNum; + } + + public void setControlNum(long controlNum) { + this.controlNum = controlNum; + } + + @JsonIgnore + public String getSearchReportStartTime() { + return searchReportStartTime; + } + + public void setSearchReportStartTime(String searchReportStartTime) { + this.searchReportStartTime = searchReportStartTime; + } + + @JsonIgnore + public String getSearchReportEndTime() { + return searchReportEndTime; + } + + public void setSearchReportEndTime(String searchReportEndTime) { + this.searchReportEndTime = searchReportEndTime; + } + + @JsonIgnore + public String getSearchTaskStartTime() { + return searchTaskStartTime; + } + + public void setSearchTaskStartTime(String searchTaskStartTime) { + this.searchTaskStartTime = searchTaskStartTime; + } + + @JsonIgnore + public String getSearchTaskEndTime() { + return searchTaskEndTime; + } + + public void setSearchTaskEndTime(String searchTaskEndTime) { + this.searchTaskEndTime = searchTaskEndTime; + } + + public long getTaskId() { + return taskId; + } + + public void setTaskId(long taskId) { + this.taskId = taskId; + } + + @JsonSerialize(using = JsonDateSerializer.class) + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + @Override + public String toString() { + return "EventKeyProtection [taskTime=" + taskTime + ", reportTime=" + reportTime + ", taskName=" + taskName + + ", taskId=" + taskId + ", letterNum=" + letterNum + ", configNum=" + configNum + ", monitorNum=" + + monitorNum + ", controlNum=" + controlNum + "]"; + } + +} diff --git a/src/main/java/com/nis/domain/restful/EventMonitorOrBlock.java b/src/main/java/com/nis/domain/restful/EventMonitorOrBlock.java new file mode 100644 index 0000000..c2e362a --- /dev/null +++ b/src/main/java/com/nis/domain/restful/EventMonitorOrBlock.java @@ -0,0 +1,179 @@ +package com.nis.domain.restful; + +import java.util.Date; + +import org.apache.commons.httpclient.util.DateUtil; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.nis.util.JsonDateSerializer; +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * @author GouGe + * @data 2018/12/24 17:58 + */ +public class EventMonitorOrBlock { + private static final long serialVersionUID = -3597060253861898787L; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "审核时间") + private Date taskTime; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "统计时间") + private Date reportTime; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "事件名称") + private String taskName; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "事件ID") + private long taskId; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "ip数量") + private long ipNum; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "http数量") + private long httpNum; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "邮件数量") + private long mailNum; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "视频次数") + private long vedioNum; + @JsonInclude(value = JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "代理次数") + private long agentNum; + + private String searchReportStartTime; + private String searchReportEndTime; + private String searchTaskStartTime; + private String searchTaskEndTime; + private int reportType; + + + @JsonIgnore + public int getReportType() { + return reportType; + } + + public void setReportType(int reportType) { + this.reportType = reportType; + } + + @JsonSerialize(using = JsonDateSerializer.class) + public Date getTaskTime() { + return taskTime; + } + + public void setTaskTime(Date taskTime) { + this.taskTime = taskTime; + } + + public String getTaskName() { + return taskName; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + public long getIpNum() { + return ipNum; + } + + public void setIpNum(long ipNum) { + this.ipNum = ipNum; + } + + public long getHttpNum() { + return httpNum; + } + + public void setHttpNum(long httpNum) { + this.httpNum = httpNum; + } + + public long getMailNum() { + return mailNum; + } + + public void setMailNum(long mailNum) { + this.mailNum = mailNum; + } + + public long getVedioNum() { + return vedioNum; + } + + public void setVedioNum(long vedioNum) { + this.vedioNum = vedioNum; + } + + public long getAgentNum() { + return agentNum; + } + + public void setAgentNum(long agentNum) { + this.agentNum = agentNum; + } + + @JsonIgnore + public String getSearchReportStartTime() { + return searchReportStartTime; + } + + public void setSearchReportStartTime(String searchReportStartTime) { + this.searchReportStartTime = searchReportStartTime; + } + + @JsonIgnore + public String getSearchReportEndTime() { + return searchReportEndTime; + } + + public void setSearchReportEndTime(String searchReportEndTime) { + this.searchReportEndTime = searchReportEndTime; + } + + @JsonIgnore + public String getSearchTaskStartTime() { + return searchTaskStartTime; + } + + public void setSearchTaskStartTime(String searchTaskStartTime) { + this.searchTaskStartTime = searchTaskStartTime; + } + + @JsonIgnore + public String getSearchTaskEndTime() { + return searchTaskEndTime; + } + + public void setSearchTaskEndTime(String searchTaskEndTime) { + this.searchTaskEndTime = searchTaskEndTime; + } + + public long getTaskId() { + return taskId; + } + + public void setTaskId(long taskId) { + this.taskId = taskId; + } + + @JsonSerialize(using = JsonDateSerializer.class) + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + @Override + public String toString() { + return "EventMonitorOrBlock [taskTime=" + taskTime + ", reportTime=" + reportTime + ", taskName=" + taskName + + ", taskId=" + taskId + ", ipNum=" + ipNum + ", httpNum=" + httpNum + ", mailNum=" + mailNum + + ", vedioNum=" + vedioNum + ", agentNum=" + agentNum + "]"; + } +} diff --git a/src/main/java/com/nis/util/CalendarUtils.java b/src/main/java/com/nis/util/CalendarUtils.java index 23cc2b9..357d4e3 100644 --- a/src/main/java/com/nis/util/CalendarUtils.java +++ b/src/main/java/com/nis/util/CalendarUtils.java @@ -4,6 +4,7 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; +import java.util.GregorianCalendar; /** * 常用日历操作辅助类 @@ -169,4 +170,75 @@ public class CalendarUtils { // } // System.out.println(n); } + /** + * 获取time时间的前整点时间点 + * eg:2018-12-12 12:06:36 结果为:2018-12-12 00:00:00 + * 2018-12-12 00:59:36 结果为:2018-12-12 00:00:00 + * + * @param time + * @return 取前一个整天的时间, 如果返回为null检查输入的String类型时间格式 + */ + public static String getRangeOfday(String time) { + if (time == null || time.isEmpty()) { + return ""; + } + int length = time.length(); + int cut = 8; + if (length <= cut) { + return ""; + } + try { + time = time.substring(0, length - cut); + time = time.concat("00:00:00"); + } catch (Exception e) { + e.printStackTrace(); + return ""; + } + return time; + } + + /** + * 获取距离time时间hour小时的时间,之前需加符号-、之后为正+ + * + * @param time + * @param hour + * @return + */ + public static String getRangeNhourOfTime(String time, int hour) { + if (time == null) { + return ""; + } + Date date = DateUtils.parseDate(time); + GregorianCalendar gc = new GregorianCalendar(); + gc.setTime(date); + gc.add(Calendar.HOUR, hour); + return DateUtils.formatDateTime(gc.getTime()); + } + + /** + * 获取time时间的前整点时间点 + * eg:2018-12-12 12:06:36 结果为:2018-12-12 12:00:00 + * 2018-12-12 00:59:36 结果为:2018-12-12 00:00:00 + * + * @param time + * @return 取前一个整点的时间, 如果返回为null检查输入的String类型时间格式 + */ + public static String getRangeOfhour(String time) { + if (time == null || time.isEmpty()) { + return ""; + } + int length = time.length(); + int cut = 8; + if (length <= cut) { + return ""; + } + try { + time = time.substring(0, length - 5); + time = time.concat("00:00"); + } catch (Exception e) { + e.printStackTrace(); + return ""; + } + return time; + } } diff --git a/src/main/java/com/nis/web/controller/restful/EventInfoController.java b/src/main/java/com/nis/web/controller/restful/EventInfoController.java new file mode 100644 index 0000000..eb4b7ac --- /dev/null +++ b/src/main/java/com/nis/web/controller/restful/EventInfoController.java @@ -0,0 +1,97 @@ +package com.nis.web.controller.restful; + +import com.nis.domain.Page; +import com.nis.domain.restful.EventKeyProtection; +import com.nis.domain.restful.EventMonitorOrBlock; +import com.nis.restful.RestBusinessCode; +import com.nis.restful.RestServiceException; +import com.nis.restful.ServiceRuntimeException; +import com.nis.util.Constants; +import com.nis.web.service.ServicesRequestLogService; +import com.nis.web.controller.BaseRestController; +import com.nis.web.service.AuditLogThread; +import com.nis.web.service.restful.EventService; +import com.wordnik.swagger.annotations.Api; +import com.wordnik.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +/** + * @author GouGe + * @data 2018/12/24 15:21 + */ +@RestController +@RequestMapping("${servicePath}") +@Api(value = "EventInfoController", description = "事件封堵、监测、保障接口") +@SuppressWarnings("all") +public class EventInfoController extends BaseRestController { + @Autowired + ServicesRequestLogService servicesRequestLogService; + + @Autowired + EventService eventService; + + @RequestMapping(value = "/log/v1/ntcEventKeyProtection", method = RequestMethod.GET) + @ApiOperation(value = "重点保障事件总览", httpMethod = "GET", notes = "获取重点保障事件信息", response = Map.class) + public Map getEventKeyProtection(EventKeyProtection eventKeyProtection, HttpServletRequest request, HttpServletResponse response) { + long start = System.currentTimeMillis(); + AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); + + Page eventKeyProtectionPage = null; + try { + eventKeyProtectionPage = eventService.getEventsKeyProtection(eventKeyProtection); + } catch (Exception e) { + saveLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause()); + e.printStackTrace(); + logger.error(e.getMessage()); + if (!(e instanceof RestServiceException)) { + throw new ServiceRuntimeException(saveLogThread, System.currentTimeMillis() - start, + "获取重点保障事件信息失败:" + e.getMessage(), RestBusinessCode.service_runtime_error.getValue()); + } else { + throw ((RestServiceException) e); + } + } + return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "获取重点保障事件信息成功", + eventKeyProtectionPage, 0); + } + + @RequestMapping(value = "/log/v1/ntcEventsMonitorOrBlock", method = RequestMethod.GET) + @ApiOperation(value = "事件监测、封堵", httpMethod = "GET", notes = "获取事件监测、封堵信息", response = Map.class) + public Map getEventsMonitorOrBlock(EventMonitorOrBlock eventMonitorOrBlock, HttpServletRequest request, HttpServletResponse response) { + long start = System.currentTimeMillis(); + AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); + + int typeId = eventMonitorOrBlock.getReportType(); + String logMark = null; + if(typeId == 1){ + logMark = "事件封堵"; + }else if(typeId == 2){ + logMark = "事件监测"; + }else{ + logMark = "事件类型未定义、默认查询事件封堵"; + eventMonitorOrBlock.setReportType(1); + } + Page eventMonitorPage = null; + try { + eventMonitorPage = eventService.getEventsMonitorOrBlock(eventMonitorOrBlock,logMark); + } catch (Exception e) { + saveLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause()); + e.printStackTrace(); + logger.error(e.getMessage()); + if (!(e instanceof RestServiceException)) { + throw new ServiceRuntimeException(saveLogThread, System.currentTimeMillis() - start, + "获取"+logMark+"信息失败:" + e.getMessage(), RestBusinessCode.service_runtime_error.getValue()); + } else { + throw ((RestServiceException) e); + } + } + return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "获取"+logMark+"信息成功", + eventMonitorPage, 0); + } +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/EventServiceDao.java b/src/main/java/com/nis/web/dao/EventServiceDao.java new file mode 100644 index 0000000..5619088 --- /dev/null +++ b/src/main/java/com/nis/web/dao/EventServiceDao.java @@ -0,0 +1,19 @@ +package com.nis.web.dao; + +import com.nis.domain.restful.EventKeyProtection; +import com.nis.domain.restful.EventMonitorOrBlock; + +import java.util.List; + +/** + * @author GouGe + * @data 2018/12/24 17:00 + */ +@MyBatisDao +public interface EventServiceDao { + + List getEventsKeyProtection(EventKeyProtection eventKeyProtection); + + List getEventsMonitorOrBlock(EventMonitorOrBlock eventMonitorOrBlock); + +} diff --git a/src/main/java/com/nis/web/dao/EventServiceDao.xml b/src/main/java/com/nis/web/dao/EventServiceDao.xml new file mode 100644 index 0000000..3401394 --- /dev/null +++ b/src/main/java/com/nis/web/dao/EventServiceDao.xml @@ -0,0 +1,75 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/restful/EventService.java b/src/main/java/com/nis/web/service/restful/EventService.java new file mode 100644 index 0000000..17f2143 --- /dev/null +++ b/src/main/java/com/nis/web/service/restful/EventService.java @@ -0,0 +1,144 @@ +package com.nis.web.service.restful; + +import com.nis.domain.Page; +import com.nis.domain.restful.EventKeyProtection; +import com.nis.domain.restful.EventMonitorOrBlock; +import com.nis.util.CalendarUtils; +import com.nis.util.DateUtils; +import com.nis.web.dao.EventServiceDao; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.apache.log4j.Logger; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author GouGe + * @data 2018/12/24 15:30 + */ +@Service +public class EventService { + @Autowired + EventServiceDao eventServiceDao; + + protected final Logger logger = Logger.getLogger(SystemHomePageService.class); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + /** + * 重点保障事件 + * + * @param eventKeyProtection + * @return + * @throws ParseException + */ + public Page getEventsKeyProtection(EventKeyProtection eventKeyProtection) throws ParseException { + List list = new ArrayList(); + Page page = new Page<>(); + String searchReportStartTime = eventKeyProtection.getSearchReportStartTime(); + String searchReportEndTime = eventKeyProtection.getSearchReportEndTime(); + String searchTaskStartTime = eventKeyProtection.getSearchTaskStartTime(); + String searchTaskEndTime = eventKeyProtection.getSearchTaskEndTime(); + String taskName = eventKeyProtection.getTaskName(); + long taskId = eventKeyProtection.getTaskId(); + int countParamEmpty = 0; + try{ + logger.info("开始获取重点保障事件信息,参数为{" + + ((null == searchReportStartTime && !"".equals(searchReportStartTime)) ? "无"+countParamEmpty++ : format.parse(searchReportStartTime)) + + "},{" + + ((null == searchReportEndTime && !"".equals(searchReportEndTime)) ? "无"+countParamEmpty++ : format.parse(searchReportEndTime)) + + "},{" + + ((null == searchTaskStartTime && !"".equals(searchTaskStartTime)) ? "无"+countParamEmpty++ : format.parse(searchTaskStartTime)) + + "},{" + + ((null == searchTaskEndTime && !"".equals(searchTaskEndTime)) ? "无"+countParamEmpty++ : format.parse(searchTaskEndTime)) + + "},{" + + ((null == taskName && !"".equals(taskName)) ? "无"+countParamEmpty++ : taskName) + + "},{" + + ((null == String.valueOf(taskId) && !"".equals(String.valueOf(taskId))) ? "无"+countParamEmpty++ : (long)taskId)); + }catch(Exception ex){ + logger.error("时间参数处理转换异常,{}", ex); + String rangeOfday = CalendarUtils.getRangeOfday(DateUtils.getDateTime()); + String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24); + eventKeyProtection = new EventKeyProtection(); + eventKeyProtection.setSearchReportStartTime(startTemp); + logger.info("获取重点保障事件API请求参数转换异常,默认查询昨天"+startTemp+"至今数据"); + } + if(countParamEmpty == 6){ + String rangeOfday = CalendarUtils.getRangeOfday(DateUtils.getDateTime()); + String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24); + eventKeyProtection = new EventKeyProtection(); + eventKeyProtection.setSearchReportStartTime(startTemp); + logger.info("获取重点保障事件API请求参数为空,默认查询昨天"+startTemp+"至今数据"); + } + try { + list = eventServiceDao.getEventsKeyProtection(eventKeyProtection); + } catch (Exception ex) { + logger.error("重点保障事件查询异常,{}", ex); + } + page.setList(list); + return page; + } + + /** + * 事件监测、封堵 + * + * @param eventMonitorOrBlock + * @return + */ + public Page getEventsMonitorOrBlock(EventMonitorOrBlock eventMonitorOrBlock,String logMark) { + List list = new ArrayList(); + Page page = new Page<>(); + String searchReportStartTime = eventMonitorOrBlock.getSearchReportStartTime(); + String searchReportEndTime = eventMonitorOrBlock.getSearchReportEndTime(); + String searchTaskStartTime = eventMonitorOrBlock.getSearchTaskStartTime(); + String searchTaskEndTime = eventMonitorOrBlock.getSearchTaskEndTime(); + String taskName = eventMonitorOrBlock.getTaskName(); + long taskId = eventMonitorOrBlock.getTaskId(); + int countParamEmpty = 0; + if (taskName != null) { + eventMonitorOrBlock.setTaskName(taskName.trim()); + } + try{ + logger.info("开始获取"+logMark+",参数为{" + + ((null == searchReportStartTime && !"".equals(searchReportStartTime)) ? "无"+countParamEmpty++ : format.parse(searchReportStartTime)) + + "},{" + + ((null == searchReportEndTime && !"".equals(searchReportEndTime)) ? "无"+countParamEmpty++ : format.parse(searchReportEndTime)) + + "},{" + + ((null == searchTaskStartTime && !"".equals(searchTaskStartTime)) ? "无"+countParamEmpty++ : format.parse(searchTaskStartTime)) + + "},{" + + ((null == searchTaskEndTime && !"".equals(searchTaskEndTime)) ? "无"+countParamEmpty++ : format.parse(searchTaskEndTime)) + + "},{" + + ((null == taskName && !"".equals(taskName)) ? "无"+countParamEmpty++ : taskName) + + "},{" + + ((null == String.valueOf(taskId) && !"".equals(String.valueOf(taskId))) ? "无"+countParamEmpty++ : (long)taskId)); + }catch(Exception ex){ + logger.error("时间参数处理转换异常,{}", ex); + String rangeNhourOfTime = CalendarUtils.getRangeOfhour(DateUtils.getDateTime()); + String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -1); + int typeId = eventMonitorOrBlock.getReportType(); + eventMonitorOrBlock = new EventMonitorOrBlock(); + eventMonitorOrBlock.setSearchReportStartTime(startTemp); + eventMonitorOrBlock.setReportType(typeId); + logger.info("获取"+logMark+"API请求参数转换异常,默认查询上一小时"+startTemp+"到现在的数据"); + } + if(countParamEmpty==6){ + String rangeNhourOfTime = CalendarUtils.getRangeOfhour(DateUtils.getDateTime()); + String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -1); + int typeId = eventMonitorOrBlock.getReportType(); + eventMonitorOrBlock = new EventMonitorOrBlock(); + eventMonitorOrBlock.setSearchReportStartTime(startTemp); + eventMonitorOrBlock.setReportType(typeId); + logger.info("获取"+logMark+"API请求参数为空,默认查询上一小时"+startTemp+"到现在的数据"); + } + try { + list = eventServiceDao.getEventsMonitorOrBlock(eventMonitorOrBlock); + } catch (Exception ex) { + logger.error(logMark+"查询异常,{}", ex); + } + page.setList(list); + return page; + } +}